Skip to content

Commit 3e38565

Browse files
committed
refactor(tailwind migration): migrate SocialListItem.tsx to tailwind
1 parent e15d6d4 commit 3e38565

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

src/components/SocialListItem.tsx

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
FaXTwitter,
77
FaYoutube,
88
} from "react-icons/fa6"
9-
import { Box, Flex, Icon } from "@chakra-ui/react"
9+
10+
import { Flex } from "./ui/flex"
1011

1112
const socialColors = {
1213
reddit: "#ff4301",
@@ -30,25 +31,18 @@ type SocialListItemProps = {
3031
socialIcon: keyof typeof icons
3132
}
3233

33-
const SocialListItem = ({ children, socialIcon }: SocialListItemProps) => (
34-
<Flex w="100%" py="2" px="0" align="center">
35-
<Icon
36-
as={icons[socialIcon]}
37-
pe={3}
38-
boxSize={10}
39-
color={socialColors[socialIcon]}
40-
/>
41-
<Box
42-
fontStyle="italic"
43-
sx={{
44-
"> a": {
45-
fontStyle: "normal",
46-
},
47-
}}
48-
>
49-
{children}
50-
</Box>
51-
</Flex>
52-
)
34+
const SocialListItem = ({ children, socialIcon }: SocialListItemProps) => {
35+
const SocialIcon = icons[socialIcon]
36+
37+
return (
38+
<Flex className="w-full items-center px-0 py-2">
39+
<SocialIcon
40+
className="size-10 shrink-0 pe-3"
41+
style={{ color: socialColors[socialIcon] }}
42+
/>
43+
<div className="italic [&>a]:not-italic">{children}</div>
44+
</Flex>
45+
)
46+
}
5347

5448
export default SocialListItem

0 commit comments

Comments
 (0)