File tree Expand file tree Collapse file tree 4 files changed +29
-52
lines changed Expand file tree Collapse file tree 4 files changed +29
-52
lines changed Original file line number Diff line number Diff line change 1
1
import React from "react"
2
- import { Box , BoxProps } from "@chakra-ui/react"
3
2
4
- export type GhostCardProps = BoxProps
3
+ import { cn } from "@/lib/utils/cn"
5
4
6
- const GhostCard = ( { children, ...rest } : GhostCardProps ) => (
7
- < Box position = "relative" alignSelf = "stretch" { ...rest } >
8
- < Box
9
- zIndex = "hide"
10
- position = "absolute"
11
- backgroundColor = "ghostCardGhost"
12
- bottom = "2"
13
- insetInlineStart = "2"
14
- border = "1px solid"
15
- borderColor = "border"
16
- borderRadius = "2px"
17
- height = "full"
18
- width = "full"
19
- />
20
- < Box
21
- className = "ghost-card-base"
22
- height = "full"
23
- width = "full"
24
- borderRadius = "2px"
25
- zIndex = { 2 }
26
- padding = "6"
27
- background = "ghostCardBackground"
28
- border = "1px solid"
29
- borderColor = "border"
30
- textAlign = "start"
31
- >
32
- { children }
33
- </ Box >
34
- </ Box >
35
- )
5
+ import { Card } from "./ui/card"
6
+
7
+ interface GhostCardProps extends React . HTMLAttributes < HTMLDivElement > {
8
+ children : React . ReactNode
9
+ }
10
+
11
+ const GhostCard : React . FC < GhostCardProps > = ( {
12
+ children,
13
+ className,
14
+ ...props
15
+ } ) => {
16
+ return (
17
+ < div className = { cn ( "relative self-stretch" , className ) } >
18
+ < 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" />
19
+ < Card
20
+ className = { cn (
21
+ "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"
22
+ ) }
23
+ { ...props }
24
+ >
25
+ { children }
26
+ </ Card >
27
+ </ div >
28
+ )
29
+ }
36
30
37
31
export default GhostCard
Original file line number Diff line number Diff line change @@ -1854,15 +1854,7 @@ const DappsPage = () => {
1854
1854
</ FullWidthContainer >
1855
1855
< Content >
1856
1856
< ImageContainer id = "what-are-dapps" >
1857
- < GhostCard
1858
- mt = { 2 }
1859
- sx = { {
1860
- ".ghost-card-base" : {
1861
- display : "flex" ,
1862
- justifyContent : "center" ,
1863
- } ,
1864
- } }
1865
- >
1857
+ < GhostCard className = "mt-2 flex items-center" >
1866
1858
< Image
1867
1859
bgSize = "cover"
1868
1860
bgRepeat = "no-repeat"
Original file line number Diff line number Diff line change @@ -273,12 +273,7 @@ const GasPage = () => {
273
273
</ InlineLink >
274
274
</ Text >
275
275
</ Box >
276
- < GhostCard
277
- flex = "40%"
278
- maxW = "640px"
279
- alignSelf = "center"
280
- mt = { { base : 16 , lg : 2 } }
281
- >
276
+ < GhostCard className = "mt-16 max-w-[640px] self-center md:w-2/5 lg:mt-2" >
282
277
< Emoji text = ":cat:" className = "text-5xl" />
283
278
< H3 > { t ( "page-gas-attack-of-the-cryptokitties-header" ) } </ H3 >
284
279
< Text > { t ( "page-gas-attack-of-the-cryptokitties-text" ) } </ Text >
Original file line number Diff line number Diff line change @@ -463,11 +463,7 @@ const StablecoinsPage = ({ markets, marketsHasError }) => {
463
463
</ Box >
464
464
) ) }
465
465
</ Box >
466
- < GhostCard
467
- maxW = "640px"
468
- me = { { base : 0 , lg : 8 } }
469
- mt = { { base : 16 , lg : 2 } }
470
- >
466
+ < GhostCard className = "mb-0 mt-16 max-w-[640px] lg:mb-8 lg:mt-2" >
471
467
< Emoji text = ":pizza:" className = "text-5xl" />
472
468
< H3 > { t ( "page-stablecoins-bitcoin-pizza" ) } </ H3 >
473
469
< Text > { t ( "page-stablecoins-bitcoin-pizza-body" ) } </ Text >
You can’t perform that action at this time.
0 commit comments