-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #866 from alleslabs/feature/cfe-342-sticky-cta
[CFE-342] Feature: sticky CTA
- Loading branch information
Showing
29 changed files
with
467 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
import { Flex } from "@chakra-ui/react"; | ||
import type { BoxProps } from "@chakra-ui/react"; | ||
import { Box } from "@chakra-ui/react"; | ||
import type { ReactNode } from "react"; | ||
|
||
type WasmPageContainerProps = { | ||
children: ReactNode; | ||
width?: string; | ||
boxProps?: BoxProps; | ||
}; | ||
|
||
const WasmPageContainer = ({ | ||
children, | ||
width = "540px", | ||
}: WasmPageContainerProps) => ( | ||
<Flex | ||
const WasmPageContainer = ({ children, boxProps }: WasmPageContainerProps) => ( | ||
<Box | ||
as="main" | ||
align="center" | ||
width={width} | ||
w={540} | ||
mx="auto" | ||
py={12} | ||
direction="column" | ||
minH="inherit" | ||
py={12} | ||
{...boxProps} | ||
> | ||
{children} | ||
</Flex> | ||
</Box> | ||
); | ||
|
||
export default WasmPageContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import type { ButtonProps } from "@chakra-ui/react"; | ||
import { Box, Button, Flex, Spinner } from "@chakra-ui/react"; | ||
|
||
interface FooterCTAProps { | ||
loading?: boolean; | ||
cancelButton: ButtonProps; | ||
cancelLabel?: string; | ||
actionButton: ButtonProps; | ||
actionLabel?: string; | ||
} | ||
|
||
export const FooterCTA = ({ | ||
loading = false, | ||
cancelButton, | ||
cancelLabel = "Previous", | ||
actionButton, | ||
actionLabel = "Submit", | ||
}: FooterCTAProps) => ( | ||
<Box | ||
w="full" | ||
bg="gray.900" | ||
h="70px" | ||
bottom="0" | ||
position="sticky" | ||
zIndex={2} | ||
id="footer-cta" | ||
> | ||
<Flex align="center" justify="space-between" w="540px" h="full" mx="auto"> | ||
<Button variant="outline-gray" w="128px" {...cancelButton}> | ||
{cancelLabel} | ||
</Button> | ||
<Button variant="primary" w="128px" {...actionButton}> | ||
{loading ? <Spinner size="md" variant="light" /> : actionLabel} | ||
</Button> | ||
</Flex> | ||
</Box> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./FooterCTA"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.