Skip to content

Commit 8c5d794

Browse files
committed
fix(navlinks): update navlinks color logic
1 parent 128e6d9 commit 8c5d794

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

apps/docs/components/ui/NavLinks.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ import clsx from 'clsx';
1313
import * as heroIcons from '@heroicons/react/24/solid';
1414
import { iconResolver } from "@/lib/iconResolver";
1515

16-
const colors = [
17-
"blue", "purple", "pink", "green", "teal", "yellow", "red", "lime"
18-
]
16+
const colorClasses = [
17+
"text-blue-500",
18+
"text-purple-500",
19+
"text-pink-500",
20+
"text-green-500",
21+
"text-teal-500",
22+
"text-yellow-500",
23+
"text-red-500",
24+
"text-lime-500",
25+
];
1926

2027
export const navbarLinks: LinkItemType[] = [
2128
{
@@ -32,7 +39,7 @@ export const navbarLinks: LinkItemType[] = [
3239
<item.icon className={
3340
clsx(
3441
"mr-3 h-5 w-5",
35-
index < 8 && `text-${colors[index]}-500`
42+
colorClasses[index % colorClasses.length]
3643
)
3744
}
3845
/>
@@ -68,7 +75,7 @@ export const navbarLinks: LinkItemType[] = [
6875
<item.icon className={
6976
clsx(
7077
"mr-3 h-5 w-5",
71-
index < 8 && `text-${colors[8-(index+1)]}-500`
78+
colorClasses[8-(index+1) % colorClasses.length]
7279
)
7380
}
7481
/>
@@ -99,7 +106,7 @@ export const navbarLinks: LinkItemType[] = [
99106
<item.icon className={
100107
clsx(
101108
"mr-3 h-5 w-5",
102-
index < 8 && `text-${colors[(index * 3 % colors.length)]}-500`
109+
colorClasses[(index * 3 % colorClasses.length)]
103110
)
104111
}
105112
/>
@@ -130,7 +137,7 @@ export const navbarLinks: LinkItemType[] = [
130137
<item.icon className={
131138
clsx(
132139
"mr-3 h-5 w-5",
133-
index < 8 && (["About Us", "Support Us"].includes(item.title) ? "text-red-500" : `text-${colors[(index * 5 % colors.length)]}-500`)
140+
(["About Us", "Support Us"].includes(item.title) ? "text-red-500" : colorClasses[index % colorClasses.length])
134141
)
135142
}
136143
/>

0 commit comments

Comments
 (0)