Skip to content

Commit c62e20f

Browse files
committed
Adjust navigation buttons on mobile
1 parent b2ac008 commit c62e20f

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

src/ReactSpreadsheetImport.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const defaultRSIProps: Partial<RsiProps<any>> = {
1414
autoMapSelectValues: false,
1515
allowInvalidSubmit: true,
1616
autoMapDistance: 2,
17+
isNavigationEnabled: false,
1718
translations: translations,
1819
uploadStepHook: async (value) => value,
1920
selectHeaderStepHook: async (headerValues, data) => ({ headerValues, data }),

src/components/ContinueButton.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,21 @@ type ContinueButtonProps = {
1111

1212
export const ContinueButton = ({ onContinue, onBack, title, backTitle, isLoading }: ContinueButtonProps) => {
1313
const styles = useStyleConfig("Modal") as (typeof themeOverrides)["components"]["Modal"]["baseStyle"]
14+
const nextButtonMobileWidth = onBack ? "8rem" : "100%"
1415
return (
1516
<ModalFooter>
1617
{onBack && (
1718
<Button size="md" sx={styles.backButton} onClick={onBack} isLoading={isLoading} variant="link">
1819
{backTitle}
1920
</Button>
2021
)}
21-
<Button size="lg" w="21rem" sx={styles.continueButton} onClick={onContinue} isLoading={isLoading}>
22+
<Button
23+
size="lg"
24+
w={{ base: nextButtonMobileWidth, md: "21rem" }}
25+
sx={styles.continueButton}
26+
onClick={onContinue}
27+
isLoading={isLoading}
28+
>
2229
{title}
2330
</Button>
2431
</ModalFooter>

src/stories/Default.stories.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ export const Basic = () => {
2222
<Link href="./exampleFile.csv" border="2px solid #718096" p="8px" borderRadius="8px" download="exampleCSV">
2323
Download example file
2424
</Link>
25-
<ReactSpreadsheetImport
26-
{...mockRsiValues}
27-
isOpen={isOpen}
28-
onClose={onClose}
29-
onSubmit={setData}
30-
isNavigationEnabled={true}
31-
/>
25+
<ReactSpreadsheetImport {...mockRsiValues} isOpen={isOpen} onClose={onClose} onSubmit={setData} />
3226
{!!data && (
3327
<Box pt={64} display="flex" gap="8px" flexDirection="column">
3428
<b>Returned data (showing first 100 rows):</b>

src/theme.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -316,17 +316,17 @@ export const themeOverrides = {
316316
fontSize: "lg",
317317
color: "textColor",
318318
},
319-
footer: {
320-
position: "relative",
321-
},
322319
closeModalButton: {},
323320
backButton: {
324-
position: "absolute",
325-
left: "2rem",
326-
top: "0",
327-
bottom: "0",
321+
gridColumn: "1",
322+
gridRow: "1",
323+
justifySelf: "start",
324+
},
325+
continueButton: {
326+
gridColumn: "1 / 3",
327+
gridRow: "1",
328+
justifySelf: "center",
328329
},
329-
continueButton: {},
330330
},
331331
variants: {
332332
rsi: {
@@ -348,7 +348,12 @@ export const themeOverrides = {
348348
footer: {
349349
bg: "secondaryBackground",
350350
py: "1.5rem",
351+
px: "2rem",
351352
justifyContent: "center",
353+
display: "grid",
354+
gridTemplateColumns: "1fr 1fr",
355+
gridTemplateRows: "1fr",
356+
gap: "1rem",
352357
},
353358
dialog: {
354359
outline: "unset",

0 commit comments

Comments
 (0)