Skip to content

Commit a2270b3

Browse files
committed
Fix borders and padding
1 parent f8ae030 commit a2270b3

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/app/(main)/resources/[category]/category-tools-libraries-section.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import slugMap from "@/code/slug-map.json"
1111
import { type Topic } from "@/resources/types"
1212
import { StripesDecoration } from "@/app/conf/_design-system/stripes-decoration"
1313

14-
import { icons } from "./icons"
1514
import { ChevronRight } from "@/app/conf/_design-system/pixelarticons/chevron-right"
15+
import { Icon, IconName } from "./icons"
1616

1717
interface LibraryEntry {
1818
name: string
@@ -130,21 +130,19 @@ export async function CategoryToolsLibrariesSection({
130130
const breakIndex =
131131
columns === 2 ? Math.floor(group.items.length / 2) : 0
132132

133-
const Icon = icons[group.id]
133+
console.log({ index, group: group.name, breakIndex })
134134

135135
return (
136136
<div
137137
key={group.id}
138138
className="min-w-[480px] shrink-0 grow border border-neu-200 bg-neu-50 dark:bg-neu-50/50 lg:w-1/3 lg:min-w-0"
139139
>
140-
<div className="typography-body-lg flex items-center gap-3 border-b border-inherit bg-neu-50 px-4 py-3 text-neu-900">
141-
{Icon && (
142-
<div className="border-r border-inherit p-3">
143-
<Icon className="size-10" />
144-
</div>
145-
)}
146-
{group.name}
147-
<div className="border-l border-inherit p-3 max-md:hidden">
140+
<div className="typography-body-lg flex items-center gap-3 border-b border-inherit bg-neu-50 text-neu-900">
141+
<div className="border-r border-inherit p-3">
142+
<Icon icon={group.id as IconName} className="size-10" />
143+
</div>
144+
<div className="px-4 py-3">{group.name}</div>
145+
<div className="border-l border-inherit p-3 md:hidden">
148146
{/* TODO: On mobile */}
149147
<ChevronRight className="rotate-90" />
150148
</div>
@@ -156,10 +154,14 @@ export async function CategoryToolsLibrariesSection({
156154
{group.items.map((item, i) => (
157155
<li
158156
key={`${group.id}-${item.name}`}
159-
style={{
160-
borderTop: breakIndex === i ? "none" : "",
161-
borderLeftWidth: breakIndex >= i ? "1px" : "",
162-
}}
157+
style={
158+
breakIndex
159+
? {
160+
borderTop: i === breakIndex ? "none" : "",
161+
borderLeftWidth: i >= breakIndex ? "1px" : "",
162+
}
163+
: {}
164+
}
163165
>
164166
{item.href ? (
165167
<a

0 commit comments

Comments
 (0)