-
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.
Showing
6 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
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.
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,30 @@ | ||
import React from "react" | ||
import { | ||
Card, | ||
CardBody, | ||
CardFooter, | ||
CardHeader, | ||
CardProps, | ||
Image, | ||
ImageProps, | ||
} from "@chakra-ui/react" | ||
|
||
type IconCardProps = CardProps & { | ||
header: React.ReactNode | ||
body: React.ReactNode | ||
icon: ImageProps | ||
} | ||
|
||
export default function IconCard(props: IconCardProps) { | ||
const { header, body, icon, ...restProps } = props | ||
|
||
return ( | ||
<Card variant="icon" {...restProps}> | ||
<CardHeader>{header}</CardHeader> | ||
<CardBody>{body}</CardBody> | ||
<CardFooter> | ||
<Image pointerEvents="none" {...icon} /> | ||
</CardFooter> | ||
</Card> | ||
) | ||
} |
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,47 @@ | ||
import React, { useMemo } from "react" | ||
import { Box, Flex, VStack, HStack } from "@chakra-ui/react" | ||
import boostCardIcon from "#/assets/images/card-icon-boost-arrow.png" | ||
import misteryCardIcon from "#/assets/images/card-icon-question-mark.png" | ||
import { useCountdown } from "#/hooks" | ||
import IconCard from "./IconCard" | ||
|
||
const MOCK_SEASON_DUE_TIMESTAMP = new Date(2024, 3, 20).getTime() / 1000 | ||
|
||
export default function LandingPage() { | ||
const countdown = useCountdown(MOCK_SEASON_DUE_TIMESTAMP) | ||
const unlockableDuePeriod = useMemo( | ||
() => | ||
Object.entries(countdown) | ||
.filter(([label]) => label !== "seconds") | ||
.reduce( | ||
(acc, [label, value]) => | ||
`${acc} ${value}${label.charAt(0).toLowerCase()}`, | ||
"", | ||
) | ||
.trim(), | ||
[countdown], | ||
) | ||
|
||
return ( | ||
// TODO: To be removed, changes for testing purposes only | ||
<Flex w="full" flexFlow="column" px={10} h="400vh"> | ||
<Box h="336px" /> | ||
<VStack spacing={4} mx={32}> | ||
<HStack spacing={5} align="stretch" mb={1} w="full"> | ||
<IconCard | ||
flex={1} | ||
header="Rewards Boost" | ||
body="Platinum Boost" | ||
icon={{ src: boostCardIcon, maxH: 239 }} | ||
/> | ||
<IconCard | ||
flex={1} | ||
header="Mystery Box" | ||
body={`Unlockable in ${unlockableDuePeriod}`} | ||
icon={{ src: misteryCardIcon, maxH: 177 }} | ||
/> | ||
</HStack> | ||
</VStack> | ||
</Flex> | ||
) | ||
} |
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