File tree Expand file tree Collapse file tree 1 file changed +29
-34
lines changed Expand file tree Collapse file tree 1 file changed +29
-34
lines changed Original file line number Diff line number Diff line change 1
1
import React from "react"
2
- import styled from "@emotion/styled"
3
-
4
- const Container = styled . div `
5
- position: relative;
6
- margin-top: 0.5rem;
7
- align-self: stretch;
8
- `
9
-
10
- const BaseCard = styled . div `
11
- height: 100%;
12
- width: 100%;
13
- border-radius: 2px;
14
- `
15
-
16
- const Card = styled ( BaseCard ) `
17
- z-index: 2;
18
- padding: 1.5rem;
19
- text-align: left;
20
- border: 1px solid ${ ( props ) => props . theme . colors . border } ;
21
- background-color: ${ ( props ) => props . theme . colors . ghostCardBackground } ;
22
- `
23
-
24
- const Ghost = styled ( BaseCard ) `
25
- z-index: -1;
26
- position: absolute;
27
- bottom: 0.5rem;
28
- left: 0.5rem;
29
- border: 1px solid ${ ( props ) => props . theme . colors . border } ;
30
- background-color: ${ ( props ) => props . theme . colors . ghostCardGhost } ;
31
- `
2
+ import { Box } from "@chakra-ui/react"
32
3
33
4
export interface IProps {
34
5
children ?: React . ReactNode
35
6
className ?: string
36
7
}
37
8
38
9
const GhostCard : React . FC < IProps > = ( { children, className } ) => (
39
- < Container className = { className } >
40
- < Ghost />
41
- < Card className = "ghost-card-base" > { children } </ Card >
42
- </ Container >
10
+ < Box position = "relative" mt = "2" alignSelf = "stretch" className = { className } >
11
+ < Box
12
+ zIndex = "hide"
13
+ position = "absolute"
14
+ backgroundColor = "ghostCardGhost"
15
+ bottom = "2"
16
+ left = "2"
17
+ border = "1px solid"
18
+ borderColor = "border"
19
+ borderRadius = "2px"
20
+ height = "full"
21
+ width = "full"
22
+ />
23
+ < Box
24
+ className = "ghost-card-base"
25
+ height = "full"
26
+ width = "full"
27
+ borderRadius = "2px"
28
+ zIndex = { 2 }
29
+ padding = "6"
30
+ background = "ghostCardBackground"
31
+ border = "1px solid"
32
+ borderColor = "border"
33
+ textAlign = "left"
34
+ >
35
+ { children }
36
+ </ Box >
37
+ </ Box >
43
38
)
44
39
45
40
export default GhostCard
You can’t perform that action at this time.
0 commit comments