1
1
import React , { ReactNode } from "react"
2
- import styled from "@emotion/styled"
3
- import Emoji from "./OldEmoji"
4
-
5
- const StyledCard = styled . div `
6
- display: flex;
7
- flex-direction: column;
8
- background: ${ ( props ) => props . theme . colors . ednBackground } ;
9
- border-radius: 2px;
10
- border: 1px solid ${ ( props ) => props . theme . colors . lightBorder } ;
11
- padding: 1.5rem;
12
- `
13
-
14
- const Title = styled . h3 `
15
- margin-top: 0;
16
- `
17
-
18
- const Description = styled . p `
19
- opacity: 0.8;
20
- margin: 0;
21
- `
22
-
23
- const StyledEmoji = styled ( Emoji ) `
24
- margin-bottom: 1rem;
25
- `
26
-
27
- const TopContent = styled . div ``
2
+ import { Flex , Heading , Text } from "@chakra-ui/react"
3
+ import Emoji from "./Emoji"
28
4
29
5
export interface IProps {
30
6
children ?: React . ReactNode
@@ -41,14 +17,31 @@ const Card: React.FC<IProps> = ({
41
17
children,
42
18
className,
43
19
} ) => (
44
- < StyledCard className = { className } >
45
- < TopContent >
46
- { emoji && < StyledEmoji size = { 3 } text = { emoji } /> }
47
- { title && < Title > { title } </ Title > }
48
- { description && < Description > { description } </ Description > }
49
- </ TopContent >
20
+ < Flex
21
+ direction = "column"
22
+ bg = "ednBackground"
23
+ borderRadius = "sm"
24
+ border = "1px"
25
+ borderStyle = "solid"
26
+ borderColor = "lightBorder"
27
+ p = { 6 }
28
+ className = { className }
29
+ >
30
+ < div >
31
+ { emoji && < Emoji fontSize = "5xl" text = { emoji } mb = { 4 } /> }
32
+ { title && (
33
+ < Heading as = "h3" mt = { 0 } fontSize = "2xl" lineHeight = { 1.4 } >
34
+ { title }
35
+ </ Heading >
36
+ ) }
37
+ { description && (
38
+ < Text opacity = { 0.8 } m = { 0 } >
39
+ { description }
40
+ </ Text >
41
+ ) }
42
+ </ div >
50
43
{ children }
51
- </ StyledCard >
44
+ </ Flex >
52
45
)
53
46
54
47
export default Card
0 commit comments