Skip to content

Commit 9f4c97a

Browse files
authored
Merge pull request #7893 from ameeetgaikwad/dev
Refactor HorizontalCard for Chakra UI
2 parents ecff6f4 + edb9707 commit 9f4c97a

File tree

1 file changed

+11
-29
lines changed

1 file changed

+11
-29
lines changed

src/components/HorizontalCard.tsx

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
11
import React, { ReactNode } from "react"
2-
import styled from "@emotion/styled"
3-
import Emoji from "./OldEmoji"
4-
5-
const StyledCard = styled.div`
6-
border-radius: 4px;
7-
display: flex;
8-
`
9-
10-
const Content = styled.div`
11-
flex: 0 1 75%;
12-
margin-left: 2rem;
13-
`
14-
15-
const Description = styled.p`
16-
opacity: 0.8;
17-
margin-top: -1rem;
18-
margin-bottom: 0.5rem;
19-
`
20-
21-
const Title = styled.p`
22-
font-size: 1.25rem;
23-
`
2+
import Emoji from "./Emoji"
3+
import { Text, Box, Flex } from "@chakra-ui/react"
244

255
export interface IProps {
266
children?: React.ReactNode
@@ -39,14 +19,16 @@ const HorizontalCard: React.FC<IProps> = ({
3919
className,
4020
emojiSize,
4121
}) => (
42-
<StyledCard className={className}>
43-
<Emoji size={emojiSize} text={emoji} />
44-
<Content>
45-
<Title>{title}</Title>
46-
<Description>{description}</Description>
22+
<Flex borderRadius="base" className={className}>
23+
<Emoji fontSize={`${emojiSize}rem`} text={emoji} />
24+
<Box flexGrow="0" flexShrink="1" flexBasis="75%" ml="8">
25+
<Text fontSize="lg">{title}</Text>
26+
<Text opacity="0.8" mt="-4" mb="2">
27+
{description}
28+
</Text>
4729
{children}
48-
</Content>
49-
</StyledCard>
30+
</Box>
31+
</Flex>
5032
)
5133

5234
export default HorizontalCard

0 commit comments

Comments
 (0)