Skip to content

Commit e1a8044

Browse files
authored
Merge pull request #7750 from vdusart/feat/convert-Callout-Chakra
Feat/convert callout chakra
2 parents b0d2ab3 + 9cda698 commit e1a8044

File tree

1 file changed

+36
-52
lines changed

1 file changed

+36
-52
lines changed

src/components/Callout.tsx

Lines changed: 36 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,11 @@
11
// Libraries
22
import React from "react"
3-
import styled from "@emotion/styled"
43
import { GatsbyImage, IGatsbyImageData } from "gatsby-plugin-image"
54
import Translation from "./Translation"
65
import { TranslationKey } from "../utils/translations"
7-
86
// 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"
499

5010
export interface IProps {
5111
children?: React.ReactNode
@@ -66,21 +26,45 @@ const Callout: React.FC<IProps> = ({
6626
children,
6727
className,
6828
}) => (
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">
7256
<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}>
7559
<Translation id={titleKey} />
76-
</h3>
77-
<Description>
60+
</Heading>
61+
<Text color="text200" fontSize="xl" lineHeight="140%">
7862
<Translation id={descriptionKey} />
79-
</Description>
63+
</Text>
8064
</div>
8165
{children}
82-
</Content>
83-
</StyledCard>
66+
</Flex>
67+
</Flex>
8468
)
8569

8670
export default Callout

0 commit comments

Comments
 (0)