From 19106451898ec539f1168a167d229cf62508e0b7 Mon Sep 17 00:00:00 2001 From: Nebs Date: Tue, 4 Oct 2022 16:32:49 +0200 Subject: [PATCH 1/2] MyPraise is moved to start page and merged to it --- .../frontend/src/components/ui/Button.tsx | 2 +- .../src/navigation/AuthenticatedRoutes.tsx | 5 --- packages/frontend/src/navigation/Nav.tsx | 5 --- .../src/pages/MyPraise/MyPraisePage.tsx | 23 ---------- .../frontend/src/pages/Start/StartPage.tsx | 44 +++++++++++++++++-- .../components/MyPraiseTable.tsx | 0 6 files changed, 41 insertions(+), 38 deletions(-) delete mode 100644 packages/frontend/src/pages/MyPraise/MyPraisePage.tsx rename packages/frontend/src/pages/{MyPraise => Start}/components/MyPraiseTable.tsx (100%) diff --git a/packages/frontend/src/components/ui/Button.tsx b/packages/frontend/src/components/ui/Button.tsx index 9eda2f3d1..958789382 100644 --- a/packages/frontend/src/components/ui/Button.tsx +++ b/packages/frontend/src/components/ui/Button.tsx @@ -30,7 +30,7 @@ export const Button = ({ 'disabled:cursor-default disabled:bg-themecolor-3/50 disabled:text-white/50'; const defaultClass = `px-4 py-2 font-bold text-white rounded-md bg-themecolor-3 hover:bg-themecolor-4 ${disabledModifier}`; - const outlineClass = `px-4 py-2 font-bold text-white rounded-md bg-themecolor-3 hover:bg-themecolor-4 ${disabledModifier}`; + const outlineClass = `border-2 border-themecolor-3 px-4 py-2 font-bold text-white rounded-md bg-themecolor-3 hover:bg-themecolor-4 ${disabledModifier}`; const roundClass = `flex items-center justify-center rounded-full hover:bg-warm-gray-300 w-7 h-7 dark:text-white dark:hover:bg-slate-800 ${disabledModifier}`; let variantClass = defaultClass; diff --git a/packages/frontend/src/navigation/AuthenticatedRoutes.tsx b/packages/frontend/src/navigation/AuthenticatedRoutes.tsx index eeb96eba6..eb496be03 100644 --- a/packages/frontend/src/navigation/AuthenticatedRoutes.tsx +++ b/packages/frontend/src/navigation/AuthenticatedRoutes.tsx @@ -5,7 +5,6 @@ import { ROLE_ADMIN, ROLE_QUANTIFIER } from '@/model/auth'; const StartPage = React.lazy(() => import('@/pages/Start/StartPage')); const SettingsPage = React.lazy(() => import('@/pages/Settings/SettingsPage')); -const MyPraisePage = React.lazy(() => import('@/pages/MyPraise/MyPraisePage')); const UserDetailsPage = React.lazy( () => import('@/pages/UserDetails/UserDetailsPage') ); @@ -87,10 +86,6 @@ export const AuthenticatedRoutes = ({ }: Props): JSX.Element | null => { return ( - - - - { - { - return ( - - - - - - - - - - ); -}; - -// eslint-disable-next-line import/no-default-export -export default MyPraise; diff --git a/packages/frontend/src/pages/Start/StartPage.tsx b/packages/frontend/src/pages/Start/StartPage.tsx index 8b8733911..0b678900a 100644 --- a/packages/frontend/src/pages/Start/StartPage.tsx +++ b/packages/frontend/src/pages/Start/StartPage.tsx @@ -1,20 +1,56 @@ -import { faPrayingHands } from '@fortawesome/free-solid-svg-icons'; -import React from 'react'; +import { + faPrayingHands, + faUser, + faUsers, +} from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { useState } from 'react'; import { BreadCrumb } from '@/components/ui/BreadCrumb'; import { ActiveNoticesBoard } from '@/components/periods/ActiveNoticesBoard'; import { Box } from '@/components/ui/Box'; import { Page } from '@/components/ui/Page'; +import { Button } from '@/components/ui/Button'; import { PraiseTable } from './components/PraiseTable'; +import { MyPraiseTable } from './components/MyPraiseTable'; const StartPage = (): JSX.Element => { + const pageViews = { + praiseView: 1, + myPraiseView: 2, + }; + + const [view, setView] = useState(pageViews.praiseView); + return ( - +
+ + +
+ - + {view === pageViews.praiseView ? : }
); diff --git a/packages/frontend/src/pages/MyPraise/components/MyPraiseTable.tsx b/packages/frontend/src/pages/Start/components/MyPraiseTable.tsx similarity index 100% rename from packages/frontend/src/pages/MyPraise/components/MyPraiseTable.tsx rename to packages/frontend/src/pages/Start/components/MyPraiseTable.tsx From 660e081e5f6e5383e324cf713035e6ff265f25c9 Mon Sep 17 00:00:00 2001 From: kristoferlund Date: Fri, 7 Oct 2022 08:43:03 +0200 Subject: [PATCH 2/2] Styling adjustments --- packages/frontend/src/pages/Start/StartPage.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/pages/Start/StartPage.tsx b/packages/frontend/src/pages/Start/StartPage.tsx index 0b678900a..477b8a130 100644 --- a/packages/frontend/src/pages/Start/StartPage.tsx +++ b/packages/frontend/src/pages/Start/StartPage.tsx @@ -26,11 +26,13 @@ const StartPage = (): JSX.Element => { -
+