diff --git a/ui/src/app/bot/page.tsx b/ui/src/api/characters.types.ts similarity index 100% rename from ui/src/app/bot/page.tsx rename to ui/src/api/characters.types.ts diff --git a/ui/src/app/campaigns/page.tsx b/ui/src/app/campaigns/page.tsx new file mode 100644 index 0000000..e892a07 --- /dev/null +++ b/ui/src/app/campaigns/page.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export default function Page() { + return <>; +} diff --git a/ui/src/app/characters/[id]/page.tsx b/ui/src/app/characters/[id]/page.tsx new file mode 100644 index 0000000..3cd2f3f --- /dev/null +++ b/ui/src/app/characters/[id]/page.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export default function Page({ params }: { params: { id: string } }) { + return <>{params.id}; +} diff --git a/ui/src/app/characters/create/page.tsx b/ui/src/app/characters/create/page.tsx new file mode 100644 index 0000000..c8442ed --- /dev/null +++ b/ui/src/app/characters/create/page.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export default function Page() { + return

Create new Character

; +} diff --git a/ui/src/app/characters/page.tsx b/ui/src/app/characters/page.tsx new file mode 100644 index 0000000..e892a07 --- /dev/null +++ b/ui/src/app/characters/page.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export default function Page() { + return <>; +} diff --git a/ui/src/app/page.tsx b/ui/src/app/page.tsx index d4fc22c..7b29c53 100644 --- a/ui/src/app/page.tsx +++ b/ui/src/app/page.tsx @@ -4,6 +4,16 @@ import React from 'react'; // Home page for siren export default function Page() { return ( + //
+ //

Siren is a Dungeon Master's best friend.

+ //

Features:

+ // + //
diff --git a/ui/src/components/Header/headerItems.ts b/ui/src/components/Header/headerItems.ts index 1925049..d0f5f22 100644 --- a/ui/src/components/Header/headerItems.ts +++ b/ui/src/components/Header/headerItems.ts @@ -1,36 +1,49 @@ export interface HeaderItem { - name: string; - link: string; - role?: string; + label: string; + link?: string; + links?: HeaderItem[]; } export const headerItems: HeaderItem[] = [ { - name: 'Races', - link: '/races' + label: 'Campaigns', + link: '/campaigns' }, { - name: 'Classes', - link: '/classes' + label: 'Characters', + link: '/characters' }, { - name: 'Feats', - link: '/feats' - }, - { - name: 'Options & Features', - link: '/options' - }, - { - name: 'Backgrounds', - link: '/backgrounds' - }, - { - name: 'Items', - link: '/items' - }, - { - name: 'Spells', - link: '/spells' + label: 'Resources', + links: [ + { + label: 'Races', + link: '/races' + }, + { + label: 'Classes', + link: '/classes' + }, + { + label: 'Feats', + link: '/feats' + }, + { + label: 'Options & Features', + link: '/options' + }, + { + label: 'Backgrounds', + link: '/backgrounds' + }, + { + label: 'Items', + link: '/items' + }, + { + label: 'Spells', + link: '/spells' + } + ] } ]; diff --git a/ui/src/components/Header/index.tsx b/ui/src/components/Header/index.tsx index 815a319..5ef5d8a 100644 --- a/ui/src/components/Header/index.tsx +++ b/ui/src/components/Header/index.tsx @@ -1,9 +1,9 @@ 'use client'; import Link from 'next/link'; -import { usePathname } from 'next/navigation'; +import { usePathname, useRouter } from 'next/navigation'; import './header.css'; -import { Avatar, Button, Card, FileButton, Grid, Group, Menu, Text, UnstyledButton } from '@mantine/core'; +import { Avatar, Button, Card, Center, FileButton, Grid, Group, Menu, Text, UnstyledButton } from '@mantine/core'; import Cookies from 'js-cookie'; import { useEffect, useState } from 'react'; import { logout, refresh, refreshLoggedIn } from '@/api/auth'; @@ -13,14 +13,16 @@ import { HeaderItem, headerItems } from './headerItems'; import { userState } from '@/state/auth'; import { useRecoilState } from 'recoil'; import { getPicture, setPicture } from '@/api/users'; +import { BsChevronDown } from 'react-icons/bs'; export default function Header() { const pathName = usePathname(); const [modalType, toggle] = useToggle([undefined, 'login', 'register', 'reset']); - const [headers, setHeaders] = useState([]); + const [headers] = useState(headerItems); const [user, setUser] = useRecoilState(userState); const [refreshId, setRefreshId] = useState(undefined); const [profilePicture, setProfilePicture] = useState(null); + const router = useRouter(); useEffect(() => { if (!user || !Cookies.get('logged_in')) { @@ -40,16 +42,6 @@ export default function Header() { } }, [user]); - useEffect(() => { - const h: HeaderItem[] = []; - headerItems.forEach((item) => { - if (item.role == undefined || user?.role == item.role) { - h.push(item); - } - setHeaders(h); - }); - }, [user]); - return ( <>