@@ -6,7 +6,6 @@ import { CATEGORIES, getPrimaryCategory } from '@/app/(landing)/studio/tag-color
66interface StudioSidebarProps {
77 activeTag ?: string | null
88}
9-
109export async function StudioSidebar ( { activeTag } : StudioSidebarProps ) {
1110 const allPosts = await getAllPostMeta ( )
1211
@@ -20,6 +19,7 @@ export async function StudioSidebar({ activeTag }: StudioSidebarProps) {
2019 }
2120
2221 const totalCount = allPosts . length
22+ const allActive = ! activeTag
2323
2424 return (
2525 < aside className = 'flex w-full shrink-0 flex-col border-r border-[#2A2A2A] bg-[#1C1C1C] p-8 lg:sticky lg:top-[52px] lg:h-[calc(100vh-52px)] lg:w-72 lg:overflow-y-auto' >
@@ -42,53 +42,81 @@ export async function StudioSidebar({ activeTag }: StudioSidebarProps) {
4242 />
4343 </ div >
4444 </ div >
45- < div className = 'flex flex-col gap-1 ' >
46- < h2 className = 'mb-4 font-mono text-[10px] uppercase tracking-widest text-[#666 ]' >
45+ < div className = 'flex flex-col border-t border-[#2A2A2A] pt-8 ' >
46+ < h2 className = 'mb-3 font-mono text-[10px] uppercase tracking-widest text-[#ECECEC ]' >
4747 Categories
4848 </ h2 >
49- < Link
50- href = '/studio'
51- className = { `group flex items-center justify-between py-2 font-mono text-[11px] uppercase tracking-wider transition-colors ${
52- ! activeTag ? 'text-[#00F701]' : 'text-[#999] hover:text-[#ECECEC]'
53- } `}
54- >
55- < span > All Posts</ span >
56- < span
57- className = { `${ ! activeTag ? 'text-[#00F701]' : 'text-[#666] group-hover:text-[#999]' } ` }
58- >
59- { totalCount }
60- </ span >
61- </ Link >
62- { CATEGORIES . map ( ( cat ) => {
63- const isActive = activeTag === cat . id
64- const count = categoryCounts [ cat . id ] ?? 0
65-
66- return (
49+ < ul className = 'flex flex-col' >
50+ < li >
6751 < Link
68- key = { cat . id }
69- href = { `/studio?tag=${ encodeURIComponent ( cat . id ) } ` }
70- className = { `group flex items-center justify-between py-2 font-mono text-[11px] uppercase tracking-wider transition-colors ${
71- isActive ? '' : 'text-[#999] hover:text-[#ECECEC]'
72- } `}
73- style = { isActive ? { color : cat . color } : undefined }
52+ href = '/studio'
53+ className = 'mx-1 mb-0.5 flex items-center justify-between rounded-sm px-3 py-2 text-[13px] transition-all'
54+ style = {
55+ allActive
56+ ? {
57+ backgroundColor : 'rgba(0, 247, 1, 0.05)' ,
58+ color : '#00F701' ,
59+ border : '1px solid #00F701' ,
60+ }
61+ : {
62+ color : '#999' ,
63+ border : '1px solid transparent' ,
64+ }
65+ }
7466 >
75- < span className = 'flex items-center gap-2' >
76- < span
77- className = 'inline-block h-1.5 w-1.5 shrink-0'
78- style = { { backgroundColor : cat . color } }
79- aria-hidden = 'true'
80- />
81- { cat . label }
82- </ span >
67+ < span > All Posts</ span >
8368 < span
84- className = { `${ isActive ? '' : 'text-[#666] group-hover:text-[#999]' } ` }
85- style = { isActive ? { color : cat . color } : undefined }
69+ className = 'font-mono text-[10px]'
70+ style = { {
71+ padding : '2px 6px' ,
72+ borderRadius : '2px' ,
73+ border : allActive ? '1px solid #00F701' : '1px solid #2A2A2A' ,
74+ color : allActive ? '#00F701' : '#666' ,
75+ } }
8676 >
87- { count }
77+ { String ( totalCount ) . padStart ( 2 , '0' ) }
8878 </ span >
8979 </ Link >
90- )
91- } ) }
80+ </ li >
81+ { CATEGORIES . map ( ( cat ) => {
82+ const isActive = activeTag === cat . id
83+ const count = categoryCounts [ cat . id ] ?? 0
84+
85+ return (
86+ < li key = { cat . id } >
87+ < Link
88+ href = { `/studio?tag=${ encodeURIComponent ( cat . id ) } ` }
89+ className = 'group mx-1 mb-0.5 flex items-center justify-between rounded-sm px-3 py-2 text-[13px] transition-all hover:bg-[#181818] hover:text-[#ECECEC]'
90+ style = {
91+ isActive
92+ ? {
93+ backgroundColor : `${ cat . color } 0D` ,
94+ color : cat . color ,
95+ border : `1px solid ${ cat . color } ` ,
96+ }
97+ : {
98+ color : '#999' ,
99+ border : '1px solid transparent' ,
100+ }
101+ }
102+ >
103+ < span > { cat . label } </ span >
104+ < span
105+ className = 'font-mono text-[10px]'
106+ style = { {
107+ padding : '2px 6px' ,
108+ borderRadius : '2px' ,
109+ border : isActive ? `1px solid ${ cat . color } ` : '1px solid #2A2A2A' ,
110+ color : isActive ? cat . color : '#666' ,
111+ } }
112+ >
113+ { String ( count ) . padStart ( 2 , '0' ) }
114+ </ span >
115+ </ Link >
116+ </ li >
117+ )
118+ } ) }
119+ </ ul >
92120 </ div >
93121 </ div >
94122 </ aside >
0 commit comments