-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Card component and asset row cards in balance page
- Loading branch information
Showing
5 changed files
with
127 additions
and
17 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
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,72 @@ | ||
import { PropsWithChildren } from "react"; | ||
import { css } from "react-strict-dom"; | ||
import { Box } from "@/components/Box/Box"; | ||
import { MarginPadding } from "@/utils/useMarginPaddingValues"; | ||
|
||
const style = css.create({ | ||
shadowWrapper: { | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0, | ||
}, | ||
content: { | ||
zIndex: 1, | ||
}, | ||
}); | ||
|
||
type CardProps = PropsWithChildren< | ||
MarginPadding & { | ||
active?: boolean; | ||
} | ||
>; | ||
|
||
export function Card({ | ||
children, | ||
active, | ||
m, | ||
mx, | ||
my, | ||
mt, | ||
mr, | ||
mb, | ||
ml, | ||
p = 4, | ||
px, | ||
py, | ||
pt, | ||
pr, | ||
pb, | ||
pl, | ||
}: CardProps) { | ||
return ( | ||
<Box m={m} mx={mx} my={my} mt={mt} mr={mr} mb={mb} ml={ml} pr={1} pb={1}> | ||
<Box | ||
borderRadius={4} | ||
borderWidth={1} | ||
borderColor="border" | ||
p={p} | ||
px={px} | ||
py={py} | ||
pt={pt} | ||
pr={pr} | ||
pb={pb} | ||
pl={pl} | ||
style={style.content} | ||
bg="background" | ||
> | ||
{children} | ||
</Box> | ||
<Box style={style.shadowWrapper} pl={1} pt={1}> | ||
<Box | ||
borderRadius={4} | ||
borderWidth={1} | ||
borderColor="border" | ||
flexGrow={1} | ||
bg={active ? "backgroundInverse" : "background"} | ||
/> | ||
</Box> | ||
</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
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,9 +1,11 @@ | ||
export { Box } from "@/components/Box/Box"; | ||
export { Button } from "@/components/Button/Button"; | ||
export { IconButton } from "@/components/Button/IconButton"; | ||
export { Card } from "@/components/Card/Card"; | ||
export { HStack, VStack } from "@/components/Stack/Stack"; | ||
export { Text } from "@/components/Text/Text"; | ||
export { TextInput } from "@/components/TextInput/TextInput"; | ||
export { Icon } from "@/components/Icon/Icon"; | ||
export { IconButton } from "@/components/Button/IconButton"; | ||
export { Tabs } from "@/components/Tabs/Tabs"; | ||
export { Text } from "@/components/Text/Text"; | ||
export { TextInput } from "@/components/TextInput/TextInput"; | ||
|
||
export { css } from "react-strict-dom"; |