-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
KeziahMoselle
committed
May 5, 2023
1 parent
4680f69
commit 6ce517a
Showing
3 changed files
with
335 additions
and
179 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import Link from "next/link"; | ||
import classNames from "classnames"; | ||
import { useRouter } from "next/router"; | ||
|
||
const ITEMS = [ | ||
{ | ||
label: "Main story", | ||
href: "/database/stories/main", | ||
}, | ||
{ | ||
label: "Characters", | ||
href: "/database/stories/character", | ||
}, | ||
{ | ||
label: "EX characters", | ||
href: "/database/stories/ex-character", | ||
}, | ||
{ | ||
label: "Recollections of Dusk", | ||
href: "/database/stories/rod-character", | ||
}, | ||
{ | ||
label: "Events", | ||
href: "/database/stories/events", | ||
}, | ||
{ | ||
label: "Anecdotes", | ||
href: "/database/stories/anecdotes", | ||
}, | ||
{ | ||
label: "Hidden stories", | ||
href: "/database/stories/hidden-stories", | ||
}, | ||
{ | ||
label: "Lost archives", | ||
href: "/database/stories/lost-archives", | ||
}, | ||
{ | ||
label: "Costumes", | ||
href: "/database/stories/costumes", | ||
}, | ||
{ | ||
label: "Weapons", | ||
href: "/database/stories/weapons", | ||
}, | ||
{ | ||
label: "Companions", | ||
href: "/database/stories/companions", | ||
}, | ||
{ | ||
label: "Memoirs", | ||
href: "/database/stories/memoirs", | ||
}, | ||
]; | ||
|
||
export default function StoriesLayout({ children }): JSX.Element { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-4"> | ||
<aside className="col-span-1 flex flex-col mb-8 lg:col-span-3 lg:mb-0"> | ||
{ITEMS.map((item) => ( | ||
<Link | ||
key={item.label} | ||
href={item.href} | ||
className={classNames( | ||
"flex items-center justify-center text-center p-4 transition-colors ease-out-cubic relative bordered", | ||
router.asPath.includes(item.href) | ||
? "active bg-beige active" | ||
: "bg-grey-lighter" | ||
)} | ||
> | ||
<span | ||
className={classNames( | ||
"font-display font-bold text-xl tracking-wider transition-colors ease-out-cubic", | ||
router.asPath.includes(item.href) | ||
? "text-grey-lighter" | ||
: "text-beige" | ||
)} | ||
> | ||
{item.label} | ||
</span> | ||
</Link> | ||
))} | ||
</aside> | ||
|
||
<div className="col-span-1 lg:col-span-9">{children}</div> | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.