Skip to content

Commit bf6903c

Browse files
committed
change tag colors to default
1 parent 6bcc5b0 commit bf6903c

File tree

2 files changed

+2
-43
lines changed

2 files changed

+2
-43
lines changed

src/components/IssuesList/index.tsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
11
import Emoji from "react-emoji-render"
22
import {
33
Avatar,
4-
ColorMode,
54
Flex,
65
HStack,
76
SimpleGrid,
87
SimpleGridProps,
98
Stack,
109
Text,
11-
useColorMode,
1210
} from "@chakra-ui/react"
1311

1412
import type { GHIssue } from "@/lib/types"
1513

16-
import { getContrastYIQ } from "@/lib/utils/getContrastYIQ"
17-
1814
import InlineLink from "../Link"
1915
import Tag from "../Tag"
2016

2117
type IssuesListProps = SimpleGridProps & {
2218
issues: GHIssue[]
2319
}
2420

25-
function pickTagColorsByColorMode(color: string, colorMode: ColorMode) {
26-
if (colorMode === "dark") {
27-
return {
28-
color: getContrastYIQ(`#${color}`),
29-
bgColor: `#${color}90`,
30-
}
31-
} else {
32-
return {
33-
color: getContrastYIQ(`#${color}`),
34-
bgColor: `#${color}`,
35-
}
36-
}
37-
}
38-
3921
const IssuesList = ({ issues, ...props }: IssuesListProps) => {
40-
const { colorMode } = useColorMode()
41-
4222
return (
4323
<SimpleGrid columns={[1, null, 2]} spacing={4} {...props}>
4424
{issues.map((issue) => (
@@ -58,7 +38,7 @@ const IssuesList = ({ issues, ...props }: IssuesListProps) => {
5838
w="32px"
5939
h="32px"
6040
/>
61-
<Text>by {issue.user.login}</Text>
41+
<Text size="sm">by {issue.user.login}</Text>
6242
</HStack>
6343

6444
<InlineLink href={issue.html_url} textDecor="none">
@@ -71,7 +51,7 @@ const IssuesList = ({ issues, ...props }: IssuesListProps) => {
7151
<Tag
7252
key={label.id}
7353
label={<Emoji text={label.name} />}
74-
{...pickTagColorsByColorMode(label.color, colorMode)}
54+
variant="outline"
7555
/>
7656
)
7757
})}

src/lib/utils/getContrastYIQ.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)