Skip to content

Commit 3fbd6a7

Browse files
authored
Merge pull request #8413 from douglasmakey/dev
refactor: Migrate GhostCard from emotion to chakra-ui.
2 parents 9f4c97a + 5e766c1 commit 3fbd6a7

File tree

1 file changed

+29
-34
lines changed

1 file changed

+29
-34
lines changed

src/components/GhostCard.tsx

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,40 @@
11
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"
323

334
export interface IProps {
345
children?: React.ReactNode
356
className?: string
367
}
378

389
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>
4338
)
4439

4540
export default GhostCard

0 commit comments

Comments
 (0)