Skip to content

Commit e401fb1

Browse files
committed
feat/navigation
- add styles for nav buttons
1 parent cdb022d commit e401fb1

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/components/ContinueButton.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Button, ModalFooter } from "@chakra-ui/react"
1+
import { Button, ModalFooter, useStyleConfig } from "@chakra-ui/react"
2+
import { themeOverrides } from "../theme"
23

34
type ContinueButtonProps = {
45
onContinue: (val: any) => void
@@ -8,15 +9,18 @@ type ContinueButtonProps = {
89
isLoading?: boolean
910
}
1011

11-
export const ContinueButton = ({ onContinue, onBack, title, backTitle, isLoading }: ContinueButtonProps) => (
12-
<ModalFooter justifyContent={onBack && "space-between"}>
13-
{onBack && (
14-
<Button size="lg" w="21rem" onClick={onBack} isLoading={isLoading}>
15-
{backTitle}
12+
export const ContinueButton = ({ onContinue, onBack, title, backTitle, isLoading }: ContinueButtonProps) => {
13+
const styles = useStyleConfig("Modal") as (typeof themeOverrides)["components"]["Modal"]["baseStyle"]
14+
return (
15+
<ModalFooter justifyContent={onBack && "space-between"}>
16+
{onBack && (
17+
<Button size="lg" w="21rem" sx={styles.backButton} onClick={onBack} isLoading={isLoading}>
18+
{backTitle}
19+
</Button>
20+
)}
21+
<Button size="lg" w="21rem" sx={styles.continueButton} onClick={onContinue} isLoading={isLoading}>
22+
{title}
1623
</Button>
17-
)}
18-
<Button size="lg" w="21rem" onClick={onContinue} isLoading={isLoading}>
19-
{title}
20-
</Button>
21-
</ModalFooter>
22-
)
24+
</ModalFooter>
25+
)
26+
}

src/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ export const themeOverrides = {
313313
color: "textColor",
314314
},
315315
closeModalButton: {},
316+
backButton: {},
317+
continueButton: {},
316318
},
317319
variants: {
318320
rsi: {

0 commit comments

Comments
 (0)