From 4ad043fd03edb493ced2caff93d1cd54643fbc79 Mon Sep 17 00:00:00 2001 From: johannes Date: Thu, 29 Oct 2026 16:11:00 +0100 Subject: [PATCH 01/67] feat(frontend): legg til profilside og lenke i header --- frontend/src/App.tsx | 2 + frontend/src/components/Header/Header.tsx | 14 ++- frontend/src/components/Reviews/Reviews.tsx | 8 +- frontend/src/hooks/useProfile.ts | 23 +++++ frontend/src/mocks/profile.ts | 72 +++++++++++++ frontend/src/pages/Profile/Profile.css | 74 +++++++++++++ frontend/src/pages/Profile/Profile.tsx | 109 ++++++++++++++++++++ frontend/src/types/profile.ts | 10 ++ frontend/src/utils/reviewFormat.ts | 6 ++ 9 files changed, 307 insertions(+), 11 deletions(-) create mode 100644 frontend/src/hooks/useProfile.ts create mode 100644 frontend/src/mocks/profile.ts create mode 100644 frontend/src/pages/Profile/Profile.css create mode 100644 frontend/src/pages/Profile/Profile.tsx create mode 100644 frontend/src/types/profile.ts create mode 100644 frontend/src/utils/reviewFormat.ts diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 425fcf4a..f04586c0 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -18,6 +18,7 @@ import { useDebounce } from './hooks/useDebounce'; import { defaultFilters, toFilterInput, type GameFilters } from './types/filters'; import { Login } from './pages/Login/Login'; import { SideArt } from './components/SideArt/SideArt'; +import { Profile } from './pages/Profile/Profile'; //dette er antall spill per side const PAGE_SIZE = 20; @@ -308,6 +309,7 @@ function App() { /> } /> + } /> {/* Ukjente adresser sendes til forsiden */} } /> diff --git a/frontend/src/components/Header/Header.tsx b/frontend/src/components/Header/Header.tsx index 1680e263..87c0b1ff 100644 --- a/frontend/src/components/Header/Header.tsx +++ b/frontend/src/components/Header/Header.tsx @@ -4,7 +4,7 @@ import type { Suggestion } from '../../graphql/searchSuggestions'; import { ThemeToggle } from '../ThemeToggle/ThemeToggle'; import './Header.css'; import { useAuth } from '../../hooks/useAuth'; -import { Link, useLocation } from 'react-router'; +import { Link, NavLink, useLocation } from 'react-router'; interface HeaderProps { onSearch: (term: string) => void; @@ -39,9 +39,15 @@ export function Header({