Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate GhostCard to tailwind #14045

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 26 additions & 32 deletions src/components/GhostCard.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
import React from "react"
import { Box, BoxProps } from "@chakra-ui/react"

export type GhostCardProps = BoxProps
import { cn } from "@/lib/utils/cn"

const GhostCard = ({ children, ...rest }: GhostCardProps) => (
<Box position="relative" alignSelf="stretch" {...rest}>
<Box
zIndex="hide"
position="absolute"
backgroundColor="ghostCardGhost"
bottom="2"
insetInlineStart="2"
border="1px solid"
borderColor="border"
borderRadius="2px"
height="full"
width="full"
/>
<Box
className="ghost-card-base"
height="full"
width="full"
borderRadius="2px"
zIndex={2}
padding="6"
background="ghostCardBackground"
border="1px solid"
borderColor="border"
textAlign="start"
>
{children}
</Box>
</Box>
)
import { Card } from "./ui/card"

interface GhostCardProps extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode
}

const GhostCard: React.FC<GhostCardProps> = ({
children,
className,
...props
}) => {
return (
<div className={cn("relative self-stretch", className)}>
<div className="absolute bottom-2 left-2 -z-10 h-full w-full rounded-sm border-[1px] border-border bg-background-highlight dark:bg-gray-400" />
<Card
className={cn(
"text-card-foreground z-10 h-full w-full rounded-sm border-[1px] border-border bg-white p-6 text-left dark:bg-gray-600"
)}
{...props}
>
{children}
</Card>
</div>
)
}

export default GhostCard
10 changes: 1 addition & 9 deletions src/pages/dapps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1854,15 +1854,7 @@ const DappsPage = () => {
</FullWidthContainer>
<Content>
<ImageContainer id="what-are-dapps">
<GhostCard
mt={2}
sx={{
".ghost-card-base": {
display: "flex",
justifyContent: "center",
},
}}
>
<GhostCard className="mt-2 flex items-center">
<Image
bgSize="cover"
bgRepeat="no-repeat"
Expand Down
7 changes: 1 addition & 6 deletions src/pages/gas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,7 @@ const GasPage = () => {
</InlineLink>
</Text>
</Box>
<GhostCard
flex="40%"
maxW="640px"
alignSelf="center"
mt={{ base: 16, lg: 2 }}
>
<GhostCard className="mt-16 max-w-[640px] self-center md:w-2/5 lg:mt-2">
<Emoji text=":cat:" className="text-5xl" />
<H3>{t("page-gas-attack-of-the-cryptokitties-header")}</H3>
<Text>{t("page-gas-attack-of-the-cryptokitties-text")}</Text>
Expand Down
6 changes: 1 addition & 5 deletions src/pages/stablecoins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,7 @@ const StablecoinsPage = ({ markets, marketsHasError }) => {
</Box>
))}
</Box>
<GhostCard
maxW="640px"
me={{ base: 0, lg: 8 }}
mt={{ base: 16, lg: 2 }}
>
<GhostCard className="mb-0 mt-16 max-w-[640px] lg:mb-8 lg:mt-2">
pettinarip marked this conversation as resolved.
Show resolved Hide resolved
<Emoji text=":pizza:" className="text-5xl" />
<H3>{t("page-stablecoins-bitcoin-pizza")}</H3>
<Text>{t("page-stablecoins-bitcoin-pizza-body")} </Text>
Expand Down
Loading