Skip to content

Commit 00b026e

Browse files
authored
Merge pull request #14073 from Baystef/migrate/gitstars
Migrate Gitstars component to shadcn/tailwind
2 parents 61a235c + 95ccc38 commit 00b026e

File tree

1 file changed

+11
-33
lines changed

1 file changed

+11
-33
lines changed

src/components/GitStars.tsx

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useRouter } from "next/router"
22
import { FaGithub } from "react-icons/fa"
3-
import { Center, Flex, Icon } from "@chakra-ui/react"
3+
4+
import { Center, Flex } from "@/components/ui/flex"
5+
import { BaseLink, LinkProps } from "@/components/ui/Link"
46

57
import Emoji from "./Emoji"
6-
import { BaseLink, LinkProps } from "./Link"
7-
import Text from "./OldText"
88

99
type GitHubRepo = {
1010
stargazerCount: number
@@ -25,45 +25,23 @@ const GitStars = ({ gitHubRepo, hideStars, ...props }: GitStarsProps) => {
2525

2626
return (
2727
<BaseLink
28+
className="ms-auto text-body no-underline hover:underline"
2829
href={gitHubRepo.url}
2930
hideArrow
30-
ms="auto"
31-
textDecoration="none"
3231
{...props}
3332
>
34-
<Flex
35-
background="lightBorder"
36-
textDecoration="none"
37-
border="1px solid"
38-
borderColor="lightBorder"
39-
borderRadius="base"
40-
color="text"
41-
_hover={{
42-
boxShadow: "0 0 1px var(--eth-colors-primary-base)",
43-
path: { fill: "primary.base" },
44-
}}
45-
>
33+
<Flex className="items-stretch overflow-hidden rounded bg-background-medium">
4634
{hideStars ? (
47-
<Icon as={FaGithub} m={1} />
35+
<FaGithub className="m-1 text-2xl" />
4836
) : (
4937
<>
50-
<Center
51-
w="36px"
52-
justifyContent="space-between"
53-
fontSize="s"
54-
mx="0.325rem"
55-
>
56-
<Icon as={FaGithub} />
38+
<Center className="mx-1.5 w-9 justify-between text-2xl">
39+
<FaGithub />
5740
<Emoji text=":star:" />
5841
</Center>
59-
<Text
60-
fontSize="0.8125rem"
61-
px="0.325rem"
62-
my="0"
63-
background="searchBackgroundEmpty"
64-
>
65-
{starsString}
66-
</Text>
42+
<Flex className="items-center bg-background-highlight px-1.5">
43+
<p className="my-0 text-xs text-body">{starsString}</p>
44+
</Flex>
6745
</>
6846
)}
6947
</Flex>

0 commit comments

Comments
 (0)