1
1
// Libraries
2
2
import React from "react"
3
- import styled from "@emotion/styled"
4
3
import { GatsbyImage , IGatsbyImageData } from "gatsby-plugin-image"
5
4
import Translation from "./Translation"
6
5
import { TranslationKey } from "../utils/translations"
7
-
8
6
// Components
9
- import Emoji from "./OldEmoji"
10
-
11
- const StyledCard = styled . div `
12
- display: flex;
13
- flex-direction: column;
14
- background: linear-gradient(
15
- 49.21deg,
16
- rgba(127, 127, 213, 0.2) 19.87%,
17
- rgba(134, 168, 231, 0.2) 58.46%,
18
- rgba(145, 234, 228, 0.2) 97.05%
19
- );
20
- padding: 1.5rem;
21
- margin: 1rem;
22
- margin-top: 8rem;
23
- border-radius: 4px;
24
- @media (max-width: ${ ( props ) => props . theme . breakpoints . l } ) {
25
- margin-bottom: 4rem;
26
- }
27
- `
28
-
29
- const Description = styled . p `
30
- font-size: 1.25rem;
31
- line-height: 140%;
32
- color: ${ ( props ) => props . theme . colors . text200 } ;
33
- `
34
-
35
- const Image = styled ( GatsbyImage ) `
36
- margin-top: -10rem;
37
- align-self: center;
38
- max-width: 263px;
39
- min-height: 200px;
40
- `
41
-
42
- const Content = styled . div `
43
- margin-top: 2.5rem;
44
- display: flex;
45
- flex-direction: column;
46
- justify-content: space-between;
47
- height: 100%;
48
- `
7
+ import Emoji from "./Emoji"
8
+ import { Flex , Heading , Image , Text } from "@chakra-ui/react"
49
9
50
10
export interface IProps {
51
11
children ?: React . ReactNode
@@ -66,21 +26,45 @@ const Callout: React.FC<IProps> = ({
66
26
children,
67
27
className,
68
28
} ) => (
69
- < StyledCard className = { className } >
70
- { image && < Image image = { image } alt = { alt || "" } /> }
71
- < Content >
29
+ < Flex
30
+ direction = "column"
31
+ bgGradient = "linear-gradient(
32
+ 49.21deg,
33
+ rgba(127, 127, 213, 0.2) 19.87%,
34
+ rgba(134, 168, 231, 0.2) 58.46%,
35
+ rgba(145, 234, 228, 0.2) 97.05%
36
+ )"
37
+ p = { 6 }
38
+ m = { 4 }
39
+ mt = { 32 }
40
+ mb = { { base : 16 , lg : 4 } }
41
+ borderRadius = "base"
42
+ className = { className }
43
+ >
44
+ { image && (
45
+ < Image
46
+ as = { GatsbyImage }
47
+ image = { image }
48
+ alt = { alt || "" }
49
+ mt = { - 40 }
50
+ alignSelf = "center"
51
+ maxW = "263px"
52
+ minH = "200px"
53
+ />
54
+ ) }
55
+ < Flex direction = "column" justify = "space-between" mt = { 10 } h = "full" >
72
56
< div >
73
- { emoji && < Emoji text = { emoji } size = { 3 } /> }
74
- < h3 >
57
+ { emoji && < Emoji text = { emoji } fontSize = "5xl" /> }
58
+ < Heading as = "h3" fontSize = "2xl" lineHeight = { 1.4 } >
75
59
< Translation id = { titleKey } />
76
- </ h3 >
77
- < Description >
60
+ </ Heading >
61
+ < Text color = "text200" fontSize = "xl" lineHeight = "140%" >
78
62
< Translation id = { descriptionKey } />
79
- </ Description >
63
+ </ Text >
80
64
</ div >
81
65
{ children }
82
- </ Content >
83
- </ StyledCard >
66
+ </ Flex >
67
+ </ Flex >
84
68
)
85
69
86
70
export default Callout
0 commit comments