-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into set-sepolia-maintainer
- Loading branch information
Showing
76 changed files
with
811 additions
and
763 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,19 @@ | ||
import React, { ElementType } from "react" | ||
import { useModal } from "#/hooks" | ||
import { ModalType } from "#/types" | ||
import TransactionModal from "../TransactionModal" | ||
|
||
const MODALS: Record<ModalType, ElementType> = { | ||
STAKE: TransactionModal, | ||
UNSTAKE: TransactionModal, | ||
} as const | ||
|
||
export default function ModalRoot() { | ||
const { modalType, modalProps, closeModal } = useModal() | ||
|
||
if (!modalType) { | ||
return null | ||
} | ||
const SpecificModal = MODALS[modalType] | ||
return <SpecificModal closeModal={closeModal} {...modalProps} /> | ||
} |
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,29 @@ | ||
import React, { ComponentType } from "react" | ||
import { Modal, ModalContent, ModalOverlay } from "@chakra-ui/react" | ||
import { BaseModalProps } from "#/types" | ||
|
||
export const MODAL_BASE_SIZE = "lg" | ||
|
||
function withBaseModal<T extends BaseModalProps>( | ||
WrappedModalContent: ComponentType<T>, | ||
) { | ||
return function ModalBase(props: T) { | ||
const { closeModal } = props | ||
return ( | ||
<Modal | ||
isOpen | ||
onClose={closeModal} | ||
scrollBehavior="inside" | ||
closeOnOverlayClick={false} | ||
size={MODAL_BASE_SIZE} | ||
> | ||
<ModalOverlay mt="header_height" /> | ||
<ModalContent mt="modal_shift"> | ||
<WrappedModalContent {...props} /> | ||
</ModalContent> | ||
</Modal> | ||
) | ||
} | ||
} | ||
|
||
export default withBaseModal |
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,81 @@ | ||
import React from "react" | ||
import { | ||
Box, | ||
Card, | ||
CardBody, | ||
Flex, | ||
useMultiStyleConfig, | ||
Image, | ||
} from "@chakra-ui/react" | ||
import { useSidebar, useDocsDrawer } from "#/hooks" | ||
import rewardsBoostArrow from "#/assets/images/rewards-boost-arrow.svg" | ||
import mysteryBoxIcon from "#/assets/images/mystery-box.svg" | ||
import seasonKeyIcon from "#/assets/images/season-key.svg" | ||
import ButtonLink from "./shared/ButtonLink" | ||
import { TextSm } from "./shared/Typography" | ||
|
||
const BUTTONS = [ | ||
{ label: "Docs", variant: "solid" }, | ||
{ label: "FAQ", colorScheme: "gold" }, | ||
{ label: "Token Contract", colorScheme: "gold" }, | ||
{ label: "Bridge Contract", colorScheme: "gold" }, | ||
] | ||
|
||
const BENEFITS = [ | ||
{ label: "1x Rewards Boost", iconSrc: rewardsBoostArrow }, | ||
{ label: "1x Mystery Box", iconSrc: mysteryBoxIcon }, | ||
{ label: "1x Season Key", iconSrc: seasonKeyIcon }, | ||
] | ||
|
||
export default function Sidebar() { | ||
const { isOpen } = useSidebar() | ||
const { onOpen: openDocsDrawer } = useDocsDrawer() | ||
const styles = useMultiStyleConfig("Sidebar") | ||
|
||
return ( | ||
<Box | ||
as="aside" | ||
mt="header_height" | ||
w={isOpen ? "sidebar_width" : "0"} | ||
__css={styles.sidebarContainer} | ||
> | ||
<Box __css={styles.sidebar}> | ||
<TextSm fontWeight="bold">Rewards you’ll unlock</TextSm> | ||
|
||
<Flex mt={2} mb={7} flexDir="column" gap={2}> | ||
{BENEFITS.map(({ label, iconSrc }) => ( | ||
<Card | ||
key={label} | ||
bg="gold.300" | ||
borderWidth="1px" | ||
borderColor="white" | ||
> | ||
<CardBody | ||
display="flex" | ||
flexDirection="row" | ||
justifyContent="space-between" | ||
alignItems="center" | ||
py={0} | ||
px={4} | ||
> | ||
<TextSm fontWeight="semibold">{label}</TextSm> | ||
<Image src={iconSrc} boxSize="3.75rem" /> | ||
</CardBody> | ||
</Card> | ||
))} | ||
</Flex> | ||
|
||
{BUTTONS.map(({ label, variant, colorScheme }) => ( | ||
<ButtonLink | ||
key={label} | ||
onClick={openDocsDrawer} | ||
variant={variant} | ||
colorScheme={colorScheme} | ||
> | ||
{label} | ||
</ButtonLink> | ||
))} | ||
</Box> | ||
</Box> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
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.