From 42092ed45986f0ede11979fb864a8f5e57afa005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mi=C5=82ek?= Date: Wed, 18 Dec 2024 18:44:21 +0100 Subject: [PATCH 1/3] 279: Move fallbacks --- frontend/src/main.tsx | 2 +- frontend/src/routes/{fallbacks => }/MainFallback.tsx | 0 frontend/src/routes/{fallbacks => }/PageFallback.tsx | 2 +- frontend/src/routes/about/page.tsx | 2 +- frontend/src/routes/dashboard/page.tsx | 2 +- frontend/src/routes/login/page.tsx | 4 ++-- frontend/src/routes/page.tsx | 2 +- frontend/src/routes/report/page.tsx | 9 ++------- frontend/src/routes/settings/page.tsx | 2 +- frontend/src/routes/user/userPage/page.tsx | 5 +++-- 10 files changed, 13 insertions(+), 17 deletions(-) rename frontend/src/routes/{fallbacks => }/MainFallback.tsx (100%) rename frontend/src/routes/{fallbacks => }/PageFallback.tsx (92%) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 29bdbb3..c133091 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -7,7 +7,7 @@ import { RouterProvider } from 'react-router-dom'; import router from './routes/router.tsx'; import Providers from './providers/Providers.tsx'; import { ErrorBoundary } from 'react-error-boundary'; -import { MainFallback } from './routes/fallbacks/MainFallback.tsx'; +import { MainFallback } from './routes/MainFallback.tsx'; createRoot(document.getElementById('root')!).render( diff --git a/frontend/src/routes/fallbacks/MainFallback.tsx b/frontend/src/routes/MainFallback.tsx similarity index 100% rename from frontend/src/routes/fallbacks/MainFallback.tsx rename to frontend/src/routes/MainFallback.tsx diff --git a/frontend/src/routes/fallbacks/PageFallback.tsx b/frontend/src/routes/PageFallback.tsx similarity index 92% rename from frontend/src/routes/fallbacks/PageFallback.tsx rename to frontend/src/routes/PageFallback.tsx index 81740c1..edd6edf 100644 --- a/frontend/src/routes/fallbacks/PageFallback.tsx +++ b/frontend/src/routes/PageFallback.tsx @@ -1,4 +1,4 @@ -import { Center, Stack, Title, Text, Card } from '@mantine/core'; +import { Card, Center, Stack, Text, Title } from '@mantine/core'; import { IconAlertCircle } from '@tabler/icons-react'; export const PageFallback = ({ error }) => { diff --git a/frontend/src/routes/about/page.tsx b/frontend/src/routes/about/page.tsx index 5c89fe4..200d918 100644 --- a/frontend/src/routes/about/page.tsx +++ b/frontend/src/routes/about/page.tsx @@ -1,7 +1,7 @@ import Section from './Section'; import { Box } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; /** * About page, contains information about the project and the team. diff --git a/frontend/src/routes/dashboard/page.tsx b/frontend/src/routes/dashboard/page.tsx index 55f9d2b..a4d5d84 100644 --- a/frontend/src/routes/dashboard/page.tsx +++ b/frontend/src/routes/dashboard/page.tsx @@ -1,6 +1,6 @@ import { Title } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; /** * Dashboard page, gets user info asynchronously diff --git a/frontend/src/routes/login/page.tsx b/frontend/src/routes/login/page.tsx index adaea42..3734933 100644 --- a/frontend/src/routes/login/page.tsx +++ b/frontend/src/routes/login/page.tsx @@ -4,10 +4,10 @@ import { useSetAtom } from 'jotai'; import Cookies from 'js-cookie'; import { userInfoAtom } from '../../atoms'; import { useNavigate } from 'react-router-dom'; -import { Center, Stack, Title, Box, Card } from '@mantine/core'; +import { Box, Card, Center, Stack, Title } from '@mantine/core'; import { notifications } from '@mantine/notifications'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; /** * Login card with Google sign in button diff --git a/frontend/src/routes/page.tsx b/frontend/src/routes/page.tsx index 7f503a3..acd442c 100644 --- a/frontend/src/routes/page.tsx +++ b/frontend/src/routes/page.tsx @@ -1,7 +1,7 @@ import Demo from '../components/Demo'; import { Center, Container, Title } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from './fallbacks/PageFallback.tsx'; +import { PageFallback } from './PageFallback.tsx'; const Root = () => { return ( diff --git a/frontend/src/routes/report/page.tsx b/frontend/src/routes/report/page.tsx index 6171904..059aa28 100644 --- a/frontend/src/routes/report/page.tsx +++ b/frontend/src/routes/report/page.tsx @@ -16,18 +16,13 @@ import { } from '@mantine/core'; import { useForm } from '@mantine/form'; import { useEffect, useState } from 'react'; -import { DataSource } from './schema.ts'; +import { DataSource, ReportFormValidationSchema, ReportFormValues, RowWrapper } from './schema.ts'; import { zodResolver } from 'mantine-form-zod-resolver'; import { DataSourceTable } from './DataSourceTable.tsx'; -import { - ReportFormValidationSchema, - ReportFormValues, - RowWrapper, -} from './schema.ts'; import { transformJson } from './transformJson.ts'; import { RMoodsClient } from '../../rmoods/client/RMoodsClient.ts'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; import { IconLock, IconWorld } from '@tabler/icons-react'; /** diff --git a/frontend/src/routes/settings/page.tsx b/frontend/src/routes/settings/page.tsx index 23e5c05..3075827 100644 --- a/frontend/src/routes/settings/page.tsx +++ b/frontend/src/routes/settings/page.tsx @@ -1,6 +1,6 @@ import { Box } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; const Settings = () => { return Work in progress; diff --git a/frontend/src/routes/user/userPage/page.tsx b/frontend/src/routes/user/userPage/page.tsx index 4db6756..876df5d 100644 --- a/frontend/src/routes/user/userPage/page.tsx +++ b/frontend/src/routes/user/userPage/page.tsx @@ -1,4 +1,4 @@ -import { Box, Text, Loader, Flex } from '@mantine/core'; +import { Box, Flex, Loader, Text } from '@mantine/core'; import Cookies from 'js-cookie'; import { jwtDecode } from 'jwt-decode'; import UserCard from '../userCard/UserCard.tsx'; @@ -7,8 +7,9 @@ import { JwtClaims } from '../../../rmoods/jwt.ts'; import authFetch from '../../../rmoods/client/authFetch.ts'; import { useQuery } from '@tanstack/react-query'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../../PageFallback.tsx'; import classes from './page.module.scss'; + /** * User interface representing the user data. */ From b61d84b93e1d2dfdf7ccfe2cc4838b375742aeff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mi=C5=82ek?= Date: Wed, 18 Dec 2024 19:16:34 +0100 Subject: [PATCH 2/3] 279: Add placeholder pages, refactor src/routes --- .../src/routes/about/{ => faq}/Section.tsx | 0 frontend/src/routes/about/{ => faq}/page.tsx | 4 +-- frontend/src/routes/about/thesis/page.tsx | 19 +++++++++++ frontend/src/routes/browse/reports/page.tsx | 19 +++++++++++ frontend/src/routes/browse/users/page.tsx | 19 +++++++++++ frontend/src/routes/login/page.tsx | 2 +- .../GoogleSignInButton.module.scss | 0 .../googleSignInButton/GoogleSignInButton.tsx | 2 +- frontend/src/routes/releases/page.tsx | 19 +++++++++++ frontend/src/routes/router.tsx | 33 ++++++++++++++++--- frontend/src/routes/sandbox/page.tsx | 19 +++++++++++ .../user/{userPage => }/page.module.scss | 0 .../src/routes/user/{userPage => }/page.tsx | 10 +++--- .../profilePicture/ProfilePicture.module.scss | 0 .../profilePicture/ProfilePicture.tsx | 5 +-- .../ProfilePictureFallback.module.scss | 0 .../ProfilePictureFallback.tsx | 0 .../statisticItem/StatisticItem.module.scss | 0 .../{ => ui}/statisticItem/StatisticItem.tsx | 1 + .../{ => ui}/userCard/UserCard.module.scss | 0 .../user/{ => ui}/userCard/UserCard.tsx | 3 +- 21 files changed, 139 insertions(+), 16 deletions(-) rename frontend/src/routes/about/{ => faq}/Section.tsx (100%) rename frontend/src/routes/about/{ => faq}/page.tsx (96%) create mode 100644 frontend/src/routes/about/thesis/page.tsx create mode 100644 frontend/src/routes/browse/reports/page.tsx create mode 100644 frontend/src/routes/browse/users/page.tsx rename frontend/src/routes/login/{ => ui}/googleSignInButton/GoogleSignInButton.module.scss (100%) rename frontend/src/routes/login/{ => ui}/googleSignInButton/GoogleSignInButton.tsx (90%) create mode 100644 frontend/src/routes/releases/page.tsx create mode 100644 frontend/src/routes/sandbox/page.tsx rename frontend/src/routes/user/{userPage => }/page.module.scss (100%) rename frontend/src/routes/user/{userPage => }/page.tsx (91%) rename frontend/src/routes/user/{ => ui}/profilePicture/ProfilePicture.module.scss (100%) rename frontend/src/routes/user/{ => ui}/profilePicture/ProfilePicture.tsx (93%) rename frontend/src/routes/user/{ => ui}/profilePictureFallback/ProfilePictureFallback.module.scss (100%) rename frontend/src/routes/user/{ => ui}/profilePictureFallback/ProfilePictureFallback.tsx (100%) rename frontend/src/routes/user/{ => ui}/statisticItem/StatisticItem.module.scss (100%) rename frontend/src/routes/user/{ => ui}/statisticItem/StatisticItem.tsx (99%) rename frontend/src/routes/user/{ => ui}/userCard/UserCard.module.scss (100%) rename frontend/src/routes/user/{ => ui}/userCard/UserCard.tsx (96%) diff --git a/frontend/src/routes/about/Section.tsx b/frontend/src/routes/about/faq/Section.tsx similarity index 100% rename from frontend/src/routes/about/Section.tsx rename to frontend/src/routes/about/faq/Section.tsx diff --git a/frontend/src/routes/about/page.tsx b/frontend/src/routes/about/faq/page.tsx similarity index 96% rename from frontend/src/routes/about/page.tsx rename to frontend/src/routes/about/faq/page.tsx index 200d918..58d9cc8 100644 --- a/frontend/src/routes/about/page.tsx +++ b/frontend/src/routes/about/faq/page.tsx @@ -1,7 +1,7 @@ -import Section from './Section'; +import Section from './Section.tsx'; import { Box } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../PageFallback.tsx'; +import { PageFallback } from '../../PageFallback.tsx'; /** * About page, contains information about the project and the team. diff --git a/frontend/src/routes/about/thesis/page.tsx b/frontend/src/routes/about/thesis/page.tsx new file mode 100644 index 0000000..8d81465 --- /dev/null +++ b/frontend/src/routes/about/thesis/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../../PageFallback'; + +const ThesisPage = () => { + return ( + + Thesis + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/browse/reports/page.tsx b/frontend/src/routes/browse/reports/page.tsx new file mode 100644 index 0000000..e6ade1d --- /dev/null +++ b/frontend/src/routes/browse/reports/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../../PageFallback'; + +const BrowseReportsPage = () => { + return ( + + Browse Reports + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/browse/users/page.tsx b/frontend/src/routes/browse/users/page.tsx new file mode 100644 index 0000000..73f07db --- /dev/null +++ b/frontend/src/routes/browse/users/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../../PageFallback'; + +const BrowseUsersPage = () => { + return ( + + Browse Users + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/login/page.tsx b/frontend/src/routes/login/page.tsx index 3734933..62e90b6 100644 --- a/frontend/src/routes/login/page.tsx +++ b/frontend/src/routes/login/page.tsx @@ -1,5 +1,5 @@ import { useGoogleLogin } from '@react-oauth/google'; -import GoogleSignInButton from './googleSignInButton/GoogleSignInButton.tsx'; +import GoogleSignInButton from './ui/googleSignInButton/GoogleSignInButton.tsx'; import { useSetAtom } from 'jotai'; import Cookies from 'js-cookie'; import { userInfoAtom } from '../../atoms'; diff --git a/frontend/src/routes/login/googleSignInButton/GoogleSignInButton.module.scss b/frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.module.scss similarity index 100% rename from frontend/src/routes/login/googleSignInButton/GoogleSignInButton.module.scss rename to frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.module.scss diff --git a/frontend/src/routes/login/googleSignInButton/GoogleSignInButton.tsx b/frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.tsx similarity index 90% rename from frontend/src/routes/login/googleSignInButton/GoogleSignInButton.tsx rename to frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.tsx index 79671f0..23334ef 100644 --- a/frontend/src/routes/login/googleSignInButton/GoogleSignInButton.tsx +++ b/frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.tsx @@ -1,4 +1,4 @@ -import { Button, Image, Center, Box } from '@mantine/core'; +import { Box, Button, Center, Image } from '@mantine/core'; import classes from './GoogleSignInButton.module.scss'; export default function GoogleSignInButton({ diff --git a/frontend/src/routes/releases/page.tsx b/frontend/src/routes/releases/page.tsx new file mode 100644 index 0000000..f4bf4fa --- /dev/null +++ b/frontend/src/routes/releases/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../PageFallback.tsx'; + +const ReleasesPage = () => { + return ( + + Releases + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/router.tsx b/frontend/src/routes/router.tsx index 4d12906..9535ad4 100644 --- a/frontend/src/routes/router.tsx +++ b/frontend/src/routes/router.tsx @@ -1,15 +1,20 @@ import { createHashRouter } from 'react-router-dom'; -import About from './about/page.tsx'; +import Faq from './about/faq/page.tsx'; import Dashboard from './dashboard/page.tsx'; import Login from './login/page.tsx'; import Root from './page.tsx'; -import UserPage from './user/userPage/page.tsx'; +import UserPage from './user/page.tsx'; import Report from './report/page.tsx'; import Layout from '../layouts/standard/layout/Layout.tsx'; import ProtectedRoute from './ProtectedRoute.tsx'; import DashboardLayout from '../layouts/dashboard/layout/DashboardLayout.tsx'; import Settings from './settings/page.tsx'; import WebsocketProvider from '../providers/WebsocketProvider.tsx'; +import Releases from './releases/page.tsx'; +import Thesis from './about/thesis/page.tsx'; +import BrowseReports from './browse/reports/page.tsx'; +import BrowseUsers from './browse/users/page.tsx'; +import Sandbox from './sandbox/page.tsx'; const router = createHashRouter([ { @@ -37,6 +42,18 @@ const router = createHashRouter([ path: '/settings', element: , }, + { + path: '/browse/reports', + element: , + }, + { + path: '/browse/users', + element: , + }, + { + path: '/sandbox', + element: , + }, ], }, { @@ -47,13 +64,21 @@ const router = createHashRouter([ element: , }, { - path: '/about', - element: , + path: '/about/faq', + element: , + }, + { + path: '/about/thesis', + element: , }, { path: '/login', element: , }, + { + path: '/releases', + element: , + }, ], }, ]); diff --git a/frontend/src/routes/sandbox/page.tsx b/frontend/src/routes/sandbox/page.tsx new file mode 100644 index 0000000..875c8c7 --- /dev/null +++ b/frontend/src/routes/sandbox/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../PageFallback.tsx'; + +const SandboxPage = () => { + return ( + + NLP Sandbox + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/user/userPage/page.module.scss b/frontend/src/routes/user/page.module.scss similarity index 100% rename from frontend/src/routes/user/userPage/page.module.scss rename to frontend/src/routes/user/page.module.scss diff --git a/frontend/src/routes/user/userPage/page.tsx b/frontend/src/routes/user/page.tsx similarity index 91% rename from frontend/src/routes/user/userPage/page.tsx rename to frontend/src/routes/user/page.tsx index 876df5d..f6928c0 100644 --- a/frontend/src/routes/user/userPage/page.tsx +++ b/frontend/src/routes/user/page.tsx @@ -1,13 +1,13 @@ import { Box, Flex, Loader, Text } from '@mantine/core'; import Cookies from 'js-cookie'; import { jwtDecode } from 'jwt-decode'; -import UserCard from '../userCard/UserCard.tsx'; -import StatisticItem from '../statisticItem/StatisticItem.tsx'; -import { JwtClaims } from '../../../rmoods/jwt.ts'; -import authFetch from '../../../rmoods/client/authFetch.ts'; +import UserCard from './ui/userCard/UserCard.tsx'; +import StatisticItem from './ui/statisticItem/StatisticItem.tsx'; +import { JwtClaims } from '../../rmoods/jwt.ts'; +import authFetch from '../../rmoods/client/authFetch.ts'; import { useQuery } from '@tanstack/react-query'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../../PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; import classes from './page.module.scss'; /** diff --git a/frontend/src/routes/user/profilePicture/ProfilePicture.module.scss b/frontend/src/routes/user/ui/profilePicture/ProfilePicture.module.scss similarity index 100% rename from frontend/src/routes/user/profilePicture/ProfilePicture.module.scss rename to frontend/src/routes/user/ui/profilePicture/ProfilePicture.module.scss diff --git a/frontend/src/routes/user/profilePicture/ProfilePicture.tsx b/frontend/src/routes/user/ui/profilePicture/ProfilePicture.tsx similarity index 93% rename from frontend/src/routes/user/profilePicture/ProfilePicture.tsx rename to frontend/src/routes/user/ui/profilePicture/ProfilePicture.tsx index c124840..d3aba3b 100644 --- a/frontend/src/routes/user/profilePicture/ProfilePicture.tsx +++ b/frontend/src/routes/user/ui/profilePicture/ProfilePicture.tsx @@ -1,9 +1,10 @@ import React from 'react'; -import { Image, Box, Flex } from '@mantine/core'; -import { changeDefaultGoogleProfilePictureSize } from '../../../utility/changeDefaultGoogleProfilePictureSize.ts'; +import { Flex, Image } from '@mantine/core'; +import { changeDefaultGoogleProfilePictureSize } from '../../../../utility/changeDefaultGoogleProfilePictureSize.ts'; import { ErrorBoundary } from 'react-error-boundary'; import { ProfilePictureFallback } from '../profilePictureFallback/ProfilePictureFallback.tsx'; import classes from './ProfilePicture.module.scss'; + /** * Props for the ProfilePicture component. */ diff --git a/frontend/src/routes/user/profilePictureFallback/ProfilePictureFallback.module.scss b/frontend/src/routes/user/ui/profilePictureFallback/ProfilePictureFallback.module.scss similarity index 100% rename from frontend/src/routes/user/profilePictureFallback/ProfilePictureFallback.module.scss rename to frontend/src/routes/user/ui/profilePictureFallback/ProfilePictureFallback.module.scss diff --git a/frontend/src/routes/user/profilePictureFallback/ProfilePictureFallback.tsx b/frontend/src/routes/user/ui/profilePictureFallback/ProfilePictureFallback.tsx similarity index 100% rename from frontend/src/routes/user/profilePictureFallback/ProfilePictureFallback.tsx rename to frontend/src/routes/user/ui/profilePictureFallback/ProfilePictureFallback.tsx diff --git a/frontend/src/routes/user/statisticItem/StatisticItem.module.scss b/frontend/src/routes/user/ui/statisticItem/StatisticItem.module.scss similarity index 100% rename from frontend/src/routes/user/statisticItem/StatisticItem.module.scss rename to frontend/src/routes/user/ui/statisticItem/StatisticItem.module.scss diff --git a/frontend/src/routes/user/statisticItem/StatisticItem.tsx b/frontend/src/routes/user/ui/statisticItem/StatisticItem.tsx similarity index 99% rename from frontend/src/routes/user/statisticItem/StatisticItem.tsx rename to frontend/src/routes/user/ui/statisticItem/StatisticItem.tsx index 0425d6c..a465ab0 100644 --- a/frontend/src/routes/user/statisticItem/StatisticItem.tsx +++ b/frontend/src/routes/user/ui/statisticItem/StatisticItem.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Box, Text } from '@mantine/core'; import classes from './StatisticItem.module.scss'; + /** * Props for the StatisticItem component. */ diff --git a/frontend/src/routes/user/userCard/UserCard.module.scss b/frontend/src/routes/user/ui/userCard/UserCard.module.scss similarity index 100% rename from frontend/src/routes/user/userCard/UserCard.module.scss rename to frontend/src/routes/user/ui/userCard/UserCard.module.scss diff --git a/frontend/src/routes/user/userCard/UserCard.tsx b/frontend/src/routes/user/ui/userCard/UserCard.tsx similarity index 96% rename from frontend/src/routes/user/userCard/UserCard.tsx rename to frontend/src/routes/user/ui/userCard/UserCard.tsx index d517e50..a6f14ac 100644 --- a/frontend/src/routes/user/userCard/UserCard.tsx +++ b/frontend/src/routes/user/ui/userCard/UserCard.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { Box, Divider, Flex, Text, Title } from '@mantine/core'; import ProfilePicture from '../profilePicture/ProfilePicture.tsx'; -import { User } from '../userPage/page.tsx'; +import { User } from '../../page.tsx'; import classes from './UserCard.module.scss'; + /** * Props for the UserCard component. */ From dd6c558248835cf0113c41cb3b8c85708c3e16f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mi=C5=82ek?= Date: Wed, 18 Dec 2024 19:24:13 +0100 Subject: [PATCH 3/3] 279: Update sidebar --- .../src/layouts/dashboard/sidebar/Sidebar.tsx | 10 +++++----- frontend/src/routes/router.tsx | 13 +++++++++---- frontend/src/routes/settings/page.tsx | 8 ++++++-- frontend/src/routes/user/reports/page.tsx | 19 +++++++++++++++++++ 4 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 frontend/src/routes/user/reports/page.tsx diff --git a/frontend/src/layouts/dashboard/sidebar/Sidebar.tsx b/frontend/src/layouts/dashboard/sidebar/Sidebar.tsx index aa9669f..61f9d84 100644 --- a/frontend/src/layouts/dashboard/sidebar/Sidebar.tsx +++ b/frontend/src/layouts/dashboard/sidebar/Sidebar.tsx @@ -19,15 +19,15 @@ const sidebarItems: SidebarEntryProps[] = [ { label: 'My Reports', icon: IconReport, - link: '/myreports', + link: '/user/reports', }, { label: 'Browse', icon: IconSearch, initiallyOpened: true, links: [ - { label: 'Reports', link: '/reports' }, - { label: 'Users', link: '/users' }, + { label: 'Reports', link: '/browse/reports' }, + { label: 'Users', link: '/browse/users' }, ], }, { @@ -49,8 +49,8 @@ const sidebarItems: SidebarEntryProps[] = [ label: 'About', icon: IconInfoCircle, links: [ - { label: 'FAQ', link: '/faq' }, - { label: 'Thesis', link: '/thesis' }, + { label: 'FAQ', link: '/about/faq' }, + { label: 'Thesis', link: '/about/thesis' }, ], }, ]; diff --git a/frontend/src/routes/router.tsx b/frontend/src/routes/router.tsx index 9535ad4..39755b5 100644 --- a/frontend/src/routes/router.tsx +++ b/frontend/src/routes/router.tsx @@ -15,6 +15,7 @@ import Thesis from './about/thesis/page.tsx'; import BrowseReports from './browse/reports/page.tsx'; import BrowseUsers from './browse/users/page.tsx'; import Sandbox from './sandbox/page.tsx'; +import UserReports from './user/reports/page.tsx'; const router = createHashRouter([ { @@ -38,6 +39,10 @@ const router = createHashRouter([ path: '/user', element: , }, + { + path: '/user/reports', + element: , + }, { path: '/settings', element: , @@ -54,6 +59,10 @@ const router = createHashRouter([ path: '/sandbox', element: , }, + { + path: '/releases', + element: , + }, ], }, { @@ -75,10 +84,6 @@ const router = createHashRouter([ path: '/login', element: , }, - { - path: '/releases', - element: , - }, ], }, ]); diff --git a/frontend/src/routes/settings/page.tsx b/frontend/src/routes/settings/page.tsx index 3075827..1da79e5 100644 --- a/frontend/src/routes/settings/page.tsx +++ b/frontend/src/routes/settings/page.tsx @@ -1,9 +1,13 @@ -import { Box } from '@mantine/core'; +import { Box, Title } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; import { PageFallback } from '../PageFallback.tsx'; const Settings = () => { - return Work in progress; + return ( + + Settings + + ); }; export default function () { diff --git a/frontend/src/routes/user/reports/page.tsx b/frontend/src/routes/user/reports/page.tsx new file mode 100644 index 0000000..4320070 --- /dev/null +++ b/frontend/src/routes/user/reports/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../../PageFallback'; + +const UserReportsPage = () => { + return ( + + My Reports + + ); +}; + +export default function () { + return ( + + + + ); +}