From 75fbe843648b6e206a2be95005076df5ad018347 Mon Sep 17 00:00:00 2001 From: Daniel Aschwanden Date: Fri, 2 Feb 2024 01:44:12 +0100 Subject: [PATCH] fix(ui): adjust styling of clock in Navbar --- src/App.scss | 8 ++++---- src/components/Navbar.tsx | 35 +++++++++++++++++++++++------------ src/utils/useDate.tsx | 4 ++-- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/App.scss b/src/App.scss index 3a451d9b..b0732385 100644 --- a/src/App.scss +++ b/src/App.scss @@ -15,11 +15,11 @@ $weight-semibold: 600; $weight-bold: 700; $warning: rgb(236, 180, 25%); -$primary: hsl(18, 100%, 52%); +$primary: hsl(18, 90%, 60%); $danger: rgb(214, 0, 0%); -$info: hsl(226, 100%, 47%); -$link: hsl(226, 100%, 39%); -$link-hover: hsl(18, 100%, 52%); +$info: hsl(226, 100%, 40%); +$link: hsl(226, 100%, 25%); +$link-hover: hsl(18, 90%, 60%); $section-padding: 0.5rem 0.5rem; $section-padding-desktop: 0.5rem 3rem; diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 49ff1aae..938222d3 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -5,7 +5,6 @@ import { faClipboardCheck, faClipboardList, faClipboardQuestion, - faClock, faCodeBranch, faCog, faExplosion, @@ -20,6 +19,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import classNames from "classnames"; import { FunctionComponent, useContext, useState } from "react"; +import { faCalendar, faClock } from "@fortawesome/free-regular-svg-icons"; import logo from "assets/logo.svg"; import { useTranslation } from "react-i18next"; import { NavLink, useParams } from "react-router-dom"; @@ -101,9 +101,7 @@ const Navbar: FunctionComponent<{ isActive?: boolean }> = ({ isActive = false })
-
- -
+
@@ -113,15 +111,28 @@ const Navbar: FunctionComponent<{ isActive?: boolean }> = ({ isActive = false }) }; function CurrentTime() { - const { time } = useDate(); + const { time, date } = useDate(); return ( - - - - - {time} - + <> +
+ + + + + {date} + +
+
+ + + + + {time} + +
+ + ) } @@ -145,7 +156,7 @@ function UserNavBar() { if (!userState.isLoggedin) return <>; return ( -
+
diff --git a/src/utils/useDate.tsx b/src/utils/useDate.tsx index 9d0c9492..b70241d0 100644 --- a/src/utils/useDate.tsx +++ b/src/utils/useDate.tsx @@ -6,14 +6,14 @@ export const useDate = () => { useEffect(() => { const timer = setInterval(() => { setNow(new Date()); - }, 10 * 1000); + }, 1 * 1000); return () => { clearInterval(timer); } }, []); const date = dayjs(now).format("LL") - const time = dayjs(now).format("LT") + const time = dayjs(now).format("LTS") return { date,