From 70b53c5af808ec054211b7e073025756d3092bee Mon Sep 17 00:00:00 2001 From: pikiou Date: Tue, 29 Mar 2022 00:47:02 +0200 Subject: [PATCH] Change menu into tabs, change push notif into temporary question --- src/app/styles.module.scss | 3 +- src/components/LoginForm/index.tsx | 2 +- src/components/Navigation/MainMenu.tsx | 29 ++- src/components/Navigation/styles.module.scss | 21 +- src/components/Notifications/index.tsx | 256 ++++++++++--------- src/components/ui/Content/styles.module.scss | 1 + src/pages/Announcements/Announcements.tsx | 6 +- src/routes/index.ts | 13 + src/store/auth.ts | 4 + src/store/utils.ts | 8 +- 10 files changed, 205 insertions(+), 138 deletions(-) diff --git a/src/app/styles.module.scss b/src/app/styles.module.scss index 7f6366e..494f4ed 100755 --- a/src/app/styles.module.scss +++ b/src/app/styles.module.scss @@ -9,6 +9,7 @@ background-color: $color-white; border-top: $border-large; border-bottom: $border-large; + height: 52px; @include desktop { margin: 20px 0 35px; @@ -63,7 +64,7 @@ @include desktop { top: auto; - bottom: 5px; + bottom: 0; left: 420px; right: 10px; text-align: center; diff --git a/src/components/LoginForm/index.tsx b/src/components/LoginForm/index.tsx index 7304cc0..ff729bc 100644 --- a/src/components/LoginForm/index.tsx +++ b/src/components/LoginForm/index.tsx @@ -43,7 +43,7 @@ const LoginForm = (): JSX.Element => { {loginError &&
{loginError}
}
- Demander un nouveau mot de passe + Demander un nouveau mot de passe
) diff --git a/src/components/Navigation/MainMenu.tsx b/src/components/Navigation/MainMenu.tsx index 971996f..cb8b6e0 100644 --- a/src/components/Navigation/MainMenu.tsx +++ b/src/components/Navigation/MainMenu.tsx @@ -1,11 +1,12 @@ import { FC, useCallback, useState } from "react" import { useSelector } from "react-redux" import classnames from "classnames" -import { isUserConnected } from "../../store/auth" +import { isUserConnected, routerSelector } from "../../store/auth" import styles from "./styles.module.scss" const MainMenu: FC = (): JSX.Element | null => { const connected = useSelector(isUserConnected) + const router = useSelector(routerSelector) const [opened, setOpened] = useState(false) @@ -19,21 +20,24 @@ const MainMenu: FC = (): JSX.Element | null => { if (!connected) return null + function createMenuItem(name: string, pathname: string): JSX.Element { + const isActive = (router as any)?.location?.pathname === pathname + return ( +
  • + {name} +
  • + ) + } + return (