-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfdd7dd
commit 09769be
Showing
4 changed files
with
41 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import Note from '@/components/Note/Note'; | ||
import { PartialNote } from '@/types/Note'; | ||
import { ReactNode } from 'react'; | ||
|
||
interface SubSidebarProps { | ||
notes: PartialNote[]; | ||
children?: ReactNode; | ||
title: string; | ||
href: 'favourites' | 'archived'; | ||
} | ||
|
||
export default function SubSidebar({ | ||
notes, | ||
children, | ||
title, | ||
href, | ||
}: SubSidebarProps) { | ||
if (!notes || notes.length <= 0) return children; | ||
return ( | ||
<aside className='w-64 shrink-0 h-full flex flex-col border-r border-midnight relative'> | ||
<h1 className='font-semibold text-2xl py-10 sticky top-0 z-20 bg-black px-3'> | ||
{title} | ||
</h1> | ||
<div className='w-full h-full flex flex-col gap-1.5 overflow-y-scroll scrollbar-thin scrollbar-thumb-silver scrollbar-track-black px-3'> | ||
{notes.map((note) => ( | ||
<Note | ||
key={note.id} | ||
href={href} | ||
uid={note.id} | ||
name={note.title} | ||
date={note.createdAt} | ||
colour={note.colour} | ||
text={note.content} | ||
/> | ||
))} | ||
</div> | ||
</aside> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.