From 6d044d34d54418fb7f28416a09748d5049f378b6 Mon Sep 17 00:00:00 2001 From: Kaushik Narayan R Date: Sun, 29 Dec 2024 20:13:03 -0700 Subject: [PATCH] styling --- src/App.js | 11 +++++++ src/components/AnimatedSVG/index.jsx | 3 +- src/components/Navbar/Navbar.module.css | 2 ++ src/components/Navbar/index.jsx | 9 +++--- .../StyledNavLink/StyledNavLink.module.css | 16 +++++++--- src/components/StyledNavLink/index.jsx | 15 +++++---- src/index.css | 31 ++++--------------- src/pages/Graph/Graph.module.css | 1 + src/pages/Graph/index.jsx | 6 ++++ src/pages/Landing/Landing.module.css | 2 +- src/pages/Landing/index.jsx | 1 - src/pages/Login/Login.module.css | 2 +- src/pages/Logout/Logout.module.css | 2 +- src/routes/AllRoutes.jsx | 12 +++---- src/routes/UnAuthOnlyRoutes.jsx | 2 +- 15 files changed, 60 insertions(+), 55 deletions(-) diff --git a/src/App.js b/src/App.js index 5c5db5d..982d74e 100644 --- a/src/App.js +++ b/src/App.js @@ -60,7 +60,18 @@ function App() { setAuth(true); return true; } + if (refreshResp.status >= 500) { + setAuth(false); + showErrorToastNotification(refreshResp.data.message); + return false; + } + if (refreshResp.status === 401) { + // not authed + setAuth(false); + return false; + } setAuth(false); + showWarnToastNotification(refreshResp.data.message); return false; } setAuth(false); diff --git a/src/components/AnimatedSVG/index.jsx b/src/components/AnimatedSVG/index.jsx index 3e0683c..fa1b717 100644 --- a/src/components/AnimatedSVG/index.jsx +++ b/src/components/AnimatedSVG/index.jsx @@ -7,7 +7,8 @@ const AnimatedSVG = ({ stroke = "#ffffff" }) => { {/* width, height and viewBox are necessary */} diff --git a/src/components/Navbar/Navbar.module.css b/src/components/Navbar/Navbar.module.css index 802edee..66c82b2 100644 --- a/src/components/Navbar/Navbar.module.css +++ b/src/components/Navbar/Navbar.module.css @@ -1,5 +1,6 @@ .navbar_wrapper { display: flex; + background-color: var(--bgNav); flex-direction: column; align-items: center; justify-content: space-around; @@ -8,4 +9,5 @@ left: 0; height: 100vh; width: 10vw; + padding: var(--mb-3); } diff --git a/src/components/Navbar/index.jsx b/src/components/Navbar/index.jsx index 60603e0..9f7bec3 100644 --- a/src/components/Navbar/index.jsx +++ b/src/components/Navbar/index.jsx @@ -10,13 +10,12 @@ const Navbar = () => { return ( ) diff --git a/src/components/StyledNavLink/StyledNavLink.module.css b/src/components/StyledNavLink/StyledNavLink.module.css index 81ec8c1..2456bb1 100644 --- a/src/components/StyledNavLink/StyledNavLink.module.css +++ b/src/components/StyledNavLink/StyledNavLink.module.css @@ -1,12 +1,18 @@ -.link_wrapper { - padding: 2em; - border-radius: 20%; +a { + padding: var(--mb-3); + border-radius: 2%; + width: 100%; + cursor: pointer; + text-decoration: none; + color: var(--text); } .active_link { - + background-color: var(--bgLinkActive); + box-shadow: 2px 2px black; } .inactive_link { - + background-color: var(--bgLinkInactive); + box-shadow: 2px 2px var(--bg); } diff --git a/src/components/StyledNavLink/index.jsx b/src/components/StyledNavLink/index.jsx index f47dc57..a980a91 100644 --- a/src/components/StyledNavLink/index.jsx +++ b/src/components/StyledNavLink/index.jsx @@ -18,15 +18,14 @@ const StyledNavLink = ({ activeClass = styles.active_link, inactiveClass = styles.inactive_link }) => { + return ( -
- isActive ? activeClass : inactiveClass} - > - {text} - -
+ isActive ? activeClass : inactiveClass} + > + {text} + ) } diff --git a/src/index.css b/src/index.css index d2adae1..4c1a1e0 100644 --- a/src/index.css +++ b/src/index.css @@ -3,33 +3,14 @@ /* Font Size */ :root { --normalFontSize: 16px; + --headingFontSize: 24px; --headingFont: AileronFont; --primaryFont: AileronFont; --text: whitesmoke; - --bgBlue: #040a53; - --darkBlue: #061320; - --vscBlue: #1b81a8; - --dYellow: #5b3c15; - --lYellow: #fcbe72; - - --primary: #04005e; - --secondry: #440bd4; - --tertiary: #ff2079; - --accent: #e92efb; - --bg: #262626; - --blue1: #405de6; - --blue2: #5851d8; - --purple1: #833ab4; - --pink1: #c13584; - --pink2: #e1306c; - --red1: #fd1d1d; - --orange1: #f56040; - --orange2: #f77737; - --orange3: #fcaf45; - --orange4: #ffdc80; - - --fun_b: #b00b69; - --fun_d: #1d1cc5; + --bg: #443c9c; + --bgNav: #6360b1; + --bgLinkActive: #362e7b; + --bgLinkInactive: #242c44; } /* Colors */ @@ -97,7 +78,7 @@ body { "Helvetica Neue", sans-serif; font-size: var(--normalFontSize); color: var(--text); - background-color: var(--bgBlue); + background-color: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; diff --git a/src/pages/Graph/Graph.module.css b/src/pages/Graph/Graph.module.css index 2ad9080..2a8ffcd 100644 --- a/src/pages/Graph/Graph.module.css +++ b/src/pages/Graph/Graph.module.css @@ -2,4 +2,5 @@ display: flex; width: 100%; height: 100vh; + color: black; } diff --git a/src/pages/Graph/index.jsx b/src/pages/Graph/index.jsx index 9657e5a..2af2c94 100644 --- a/src/pages/Graph/index.jsx +++ b/src/pages/Graph/index.jsx @@ -15,11 +15,15 @@ import styles from './Graph.module.css'; const initialNodes = [ { id: '1', position: { x: 0, y: 0 }, data: { label: '1' } }, { id: '2', position: { x: 0, y: 100 }, data: { label: '2' } }, + { id: '3', position: { x: 50, y: 50 }, data: { label: '3' } }, ]; // const initialEdges = []; const initialEdges = [ { id: 'e1-2', source: '1', target: '2' } ]; + +const proOptions = { hideAttribution: true }; + const Graph = () => { const [playlistNodes, setNodes, onNodesChange] = useNodesState(initialNodes); const [linkEdges, setEdges, onEdgesChange] = useEdgesState(initialEdges); @@ -33,6 +37,8 @@ const Graph = () => { { {/* Routes that require user to be logged in */} }> - } /> - } /> - {/* } /> */} + } /> + } /> + {/* } /> */} {/* Routes that require user to be logged *out* */} }> - } /> + } /> {/* Common routes */} - } /> + } /> {/* 404 */} - } /> + } /> } /> ); diff --git a/src/routes/UnAuthOnlyRoutes.jsx b/src/routes/UnAuthOnlyRoutes.jsx index 969c608..80e366f 100644 --- a/src/routes/UnAuthOnlyRoutes.jsx +++ b/src/routes/UnAuthOnlyRoutes.jsx @@ -13,7 +13,7 @@ function UnAuthOnlyRoutes() { return ; } else { showWarnToastNotification(

Already logged in!

); - return ; + return ; } };