chore: add topics link

This commit is contained in:
Aslam H
2024-09-24 00:41:40 +07:00
parent cc578b1ab8
commit 8d23963b6e
2 changed files with 7 additions and 11 deletions
@@ -27,7 +27,7 @@ export const TopicSection: React.FC<{ pathname: string }> = ({ pathname }) => {
if (!me) return null if (!me) return null
return ( return (
<div className="group/pages flex flex-col gap-px py-2"> <div className="group/topics flex flex-col gap-px py-2">
<TopicSectionHeader topicCount={topicCount} isActive={isActive} /> <TopicSectionHeader topicCount={topicCount} isActive={isActive} />
<List <List
topicsWantToLearn={me.root.topicsWantToLearn} topicsWantToLearn={me.root.topicsWantToLearn}
@@ -50,15 +50,12 @@ const TopicSectionHeader: React.FC<TopicSectionHeaderProps> = ({ topicCount, isA
isActive ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground" isActive ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground"
)} )}
> >
<Button <Link href="/topics" className="flex flex-1 items-center justify-start rounded-md px-2 py-1">
variant="ghost" <p className="text-xs">
className="size-6 flex-1 items-center justify-start rounded-md px-2 py-1 focus-visible:outline-none focus-visible:ring-0"
>
<p className="flex items-center text-xs font-medium">
Topics Topics
{topicCount > 0 && <span className="text-muted-foreground ml-1">{topicCount}</span>} {topicCount > 0 && <span className="text-muted-foreground ml-1">{topicCount}</span>}
</p> </p>
</Button> </Link>
</div> </div>
) )
@@ -78,7 +75,7 @@ const List: React.FC<ListProps> = ({ topicsWantToLearn, topicsLearning, topicsLe
count={topicsWantToLearn.length} count={topicsWantToLearn.length}
label="To Learn" label="To Learn"
value="wantToLearn" value="wantToLearn"
href="/me/wantToLearn" href="#"
isActive={pathname === "/me/wantToLearn"} isActive={pathname === "/me/wantToLearn"}
/> />
<ListItem <ListItem
@@ -86,7 +83,7 @@ const List: React.FC<ListProps> = ({ topicsWantToLearn, topicsLearning, topicsLe
label="Learning" label="Learning"
value="learning" value="learning"
count={topicsLearning.length} count={topicsLearning.length}
href="/me/learning" href="#"
isActive={pathname === "/me/learning"} isActive={pathname === "/me/learning"}
/> />
<ListItem <ListItem
@@ -94,7 +91,7 @@ const List: React.FC<ListProps> = ({ topicsWantToLearn, topicsLearning, topicsLe
label="Learned" label="Learned"
value="learned" value="learned"
count={topicsLearned.length} count={topicsLearned.length}
href="/me/learned" href="#"
isActive={pathname === "/me/learned"} isActive={pathname === "/me/learned"}
/> />
</div> </div>
-1
View File
@@ -258,7 +258,6 @@ const LinkList: React.FC<LinkListProps> = () => {
setEditId(null) setEditId(null)
setActiveItemIndex(lastActiveIndexRef.current) setActiveItemIndex(lastActiveIndexRef.current)
setKeyboardActiveIndex(lastActiveIndexRef.current) setKeyboardActiveIndex(lastActiveIndexRef.current)
console.log(keyboardActiveIndex)
}} }}
index={index} index={index}
onItemSelected={link => setEditId(link.id)} onItemSelected={link => setEditId(link.id)}