Skip to content

Commit 0900d2c

Browse files
feat: Responsive design improvements (#352)
2 parents af2520c + 81fd3d5 commit 0900d2c

File tree

28 files changed

+5414
-8489
lines changed

28 files changed

+5414
-8489
lines changed

apps/widget/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@impler/shared": "^0.7.2",
4444
"@mantine/core": "^5.6.3",
4545
"@mantine/dropzone": "^5.6.3",
46+
"@mantine/hooks": "^6.0.19",
4647
"@mantine/notifications": "5.6.3",
4748
"@sentry/react": "^7.19.0",
4849
"@sentry/tracing": "^7.19.0",

apps/widget/src/components/Common/Footer/Footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ export function Footer(props: IFooterProps) {
8080
};
8181

8282
return (
83-
<Group className={classes.wrapper}>
83+
<Group className={classes.wrapper} spacing="xs">
8484
<a className={classes.poweredBy} href={variables.implerWebsite} target="_blank" rel="noopener noreferrer">
8585
<Text size="xs">
8686
Powered by <img src="/logo-full.png" className={classes.implerImage} />
8787
</Text>
8888
</a>
89-
<Group spacing="md">{FooterActions[active]}</Group>
89+
<Group spacing="xs">{FooterActions[active]}</Group>
9090
</Group>
9191
);
9292
}

apps/widget/src/components/Common/Footer/Styles.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { colors } from '@config';
33
import { createStyles, MantineTheme } from '@mantine/core';
44

55
export const getWrapperStyles = (theme: MantineTheme): React.CSSProperties => ({
6+
flexDirection: 'column-reverse',
67
justifyContent: 'space-between',
8+
[`@media (min-width: ${theme.breakpoints.md}px)`]: {
9+
flexDirection: 'row',
10+
},
711
});
812

913
export const getPoweredByLinkStyles = (theme: MantineTheme): React.CSSProperties => ({

apps/widget/src/components/Common/Heading/Heading.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Group, Title, useMantineTheme } from '@mantine/core';
1+
import { Group, MediaQuery, Title, useMantineTheme } from '@mantine/core';
22
import { Stepper } from '@ui/Stepper';
33
import { TEXTS, variables } from '@config';
44
import { PhasesEum } from '@types';
@@ -27,9 +27,11 @@ export function Heading({ active, title }: IHeadingProps) {
2727
const theme = useMantineTheme();
2828

2929
return (
30-
<Group style={{ justifyContent: 'space-between' }} mb="lg">
31-
<Title order={3}>{title}</Title>
32-
<Stepper active={active} steps={Steps} primaryColor={theme.colors.primary[variables.colorIndex]} />
33-
</Group>
30+
<MediaQuery smallerThan="md" styles={{ display: 'none' }}>
31+
<Group style={{ justifyContent: 'space-between' }} mb="lg">
32+
<Title order={3}>{title}</Title>
33+
<Stepper active={active} steps={Steps} primaryColor={theme.colors.primary[variables.colorIndex]} />
34+
</Group>
35+
</MediaQuery>
3436
);
3537
}

apps/widget/src/components/Common/Layout/Styles.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
22
import { createStyles, MantineTheme } from '@mantine/core';
33

4-
export const getRootStyles = (theme: MantineTheme): React.CSSProperties => ({
5-
paddingRight: 24,
6-
paddingLeft: 24,
7-
paddingBottom: 24,
4+
export const getRootStyles = (theme: MantineTheme) => ({
5+
paddingBottom: 16,
6+
'@media (min-width: 768px)': {
7+
paddingRight: 24,
8+
paddingLeft: 24,
9+
paddingBottom: 24,
10+
},
811
border: '1px solid transparent',
912
display: 'flex',
1013
flexDirection: 'column',

apps/widget/src/components/widget/Phases/Phase1/Phase1.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function Phase1(props: IPhase1Props) {
5959
/>
6060
)}
6161
<div className={classes.download}>
62-
<Button loading={isDownloadInProgress} size="sm" leftIcon={<Download />} onClick={onDownload}>
62+
<Button loading={isDownloadInProgress} leftIcon={<Download />} onClick={onDownload}>
6363
{TEXTS.PHASE1.DOWNLOAD_SAMPLE}
6464
</Button>
6565
</div>

apps/widget/src/components/widget/Phases/Phase2/MappingHeading/MappingHeading.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export const MappingHeading = React.forwardRef<HTMLDivElement, {}>((props, ref)
99
return (
1010
<Group style={{ justifyContent: 'space-between' }} noWrap ref={ref}>
1111
<Group className={classes.textWrapper} align="stretch" noWrap>
12-
<Text color="dimmed" style={{ width: '50%' }}>
12+
<Text color="dimmed" className={classes.text}>
1313
{TEXTS.PHASE2.NAME_IN_SCHEMA_TITLE}
1414
</Text>
15-
<Text color="dimmed" style={{ width: '50%' }}>
15+
<Text color="dimmed" className={classes.text}>
1616
{TEXTS.PHASE2.NAME_IN_SHEET_TITLE}
1717
</Text>
1818
</Group>

apps/widget/src/components/widget/Phases/Phase2/MappingHeading/Styles.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ export const getTextWrapperStyles = (theme: MantineTheme): React.CSSProperties =
1010
},
1111
});
1212

13+
export const getTextStyles = (theme: MantineTheme): React.CSSProperties => ({
14+
width: '50%',
15+
fontSize: theme.fontSizes.xs,
16+
[`@media (min-width: ${theme.breakpoints.md}px)`]: {
17+
fontSize: theme.fontSizes.sm,
18+
},
19+
});
20+
1321
export default createStyles((theme: MantineTheme, params, getRef): Record<string, any> => {
1422
return {
1523
textWrapper: getTextWrapperStyles(theme),
24+
text: getTextStyles(theme),
1625
};
1726
});

apps/widget/src/components/widget/Phases/Phase3/Phase3.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ export function Phase3(props: IPhase3Props) {
6363
return (
6464
<>
6565
<LoadingOverlay visible={!isInitialDataLoaded || isConfirmReviewLoading} />
66-
<Group className={classes.textContainer} align="center">
66+
<Group className={classes.textContainer} align="center" spacing="xs">
6767
<Group align="center" spacing="xs">
6868
<Warning fill={colors.red} className={classes.warningIcon} />
69-
<Text color={colors.red}>{TEXTS.PHASE3.INVALID_DATA_INFO}</Text>
69+
<Text size="xs" inline color={colors.red} style={{ flex: 1 }}>
70+
{TEXTS.PHASE3.INVALID_DATA_INFO}
71+
</Text>
7072
</Group>
71-
<Button size="sm" leftIcon={<Download />} onClick={onExportData}>
73+
<Button leftIcon={<Download />} onClick={onExportData}>
7274
{TEXTS.PHASE3.EXPORT_DATA}
7375
</Button>
7476
</Group>

apps/widget/src/components/widget/Phases/Phase4/Phase4.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export function Phase4(props: IPhase4Props) {
2222
<>
2323
<Group className={classes.wrapper}>
2424
<CheckIcon className={classes.check} />
25-
<Title color={primaryColor} order={2} mt="md">
25+
<Title className={classes.title} color={primaryColor} order={2} mt="md">
2626
{replaceVariablesInString(TEXTS.COMPLETE.title, { count: numberFormatter(rowsCount) })}
2727
</Title>
28-
<Text size="xl" color="dimmed">
28+
<Text className={classes.subTitle} color="dimmed">
2929
{replaceVariablesInString(TEXTS.COMPLETE.subTitle, { count: numberFormatter(rowsCount) })}
3030
</Text>
3131
</Group>

0 commit comments

Comments
 (0)