From bfb967f5be305c4f424683614ab5f186af97086f Mon Sep 17 00:00:00 2001 From: Celso Date: Wed, 28 Aug 2024 16:34:40 -0400 Subject: [PATCH 1/2] Implements redesign of SideMenu --- frontend/assets/svg/ChatBubbleV2.svg | 6 +++ frontend/assets/svg/HomeIconOutline.svg | 3 ++ frontend/assets/svg/KAIAvatar.svg | 19 ++++++++ .../layouts/MainAppLayout/ MainAppLayout.jsx | 4 +- .../layouts/MainAppLayout/NavMenu/NavMenu.jsx | 20 ++++++--- .../layouts/MainAppLayout/NavMenu/styles.js | 40 ++++++++--------- .../MainAppLayout/SideMenu/SideMenu.jsx | 36 ++++++++++++--- .../layouts/MainAppLayout/SideMenu/styles.js | 44 ++++++++++--------- frontend/layouts/MainAppLayout/styles.js | 22 +++++++++- 9 files changed, 137 insertions(+), 57 deletions(-) create mode 100644 frontend/assets/svg/ChatBubbleV2.svg create mode 100644 frontend/assets/svg/HomeIconOutline.svg create mode 100644 frontend/assets/svg/KAIAvatar.svg diff --git a/frontend/assets/svg/ChatBubbleV2.svg b/frontend/assets/svg/ChatBubbleV2.svg new file mode 100644 index 000000000..2a0bda336 --- /dev/null +++ b/frontend/assets/svg/ChatBubbleV2.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/frontend/assets/svg/HomeIconOutline.svg b/frontend/assets/svg/HomeIconOutline.svg new file mode 100644 index 000000000..3fa83e49d --- /dev/null +++ b/frontend/assets/svg/HomeIconOutline.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/assets/svg/KAIAvatar.svg b/frontend/assets/svg/KAIAvatar.svg new file mode 100644 index 000000000..8ad7f17f8 --- /dev/null +++ b/frontend/assets/svg/KAIAvatar.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/frontend/layouts/MainAppLayout/ MainAppLayout.jsx b/frontend/layouts/MainAppLayout/ MainAppLayout.jsx index a2690b2ba..af9204ee4 100644 --- a/frontend/layouts/MainAppLayout/ MainAppLayout.jsx +++ b/frontend/layouts/MainAppLayout/ MainAppLayout.jsx @@ -52,7 +52,9 @@ const MainAppLayout = (props) => { const renderApp = () => { return ( <> - + + + {children} diff --git a/frontend/layouts/MainAppLayout/NavMenu/NavMenu.jsx b/frontend/layouts/MainAppLayout/NavMenu/NavMenu.jsx index db5f4cb3f..28a19d68d 100644 --- a/frontend/layouts/MainAppLayout/NavMenu/NavMenu.jsx +++ b/frontend/layouts/MainAppLayout/NavMenu/NavMenu.jsx @@ -1,8 +1,10 @@ import { Grid, MenuItem } from '@mui/material'; import { useRouter } from 'next/router'; -import Briefcase from '@/assets/svg/Briefcase.svg'; -import ChatBubble from '@/assets/svg/ChatBubble.svg'; +import DiscoveryIcon from '@/assets/svg/add-block.svg'; + +import ChatBubble from '@/assets/svg/ChatBubbleV2.svg'; +import HomeIcon from '@/assets/svg/HomeIconOutline.svg'; import ROUTES from '@/constants/routes'; @@ -12,17 +14,23 @@ import { chatRegex, homeRegex } from '@/regex/routes'; const PAGES = [ { - name: 'Kai Tools', + name: 'Home', link: ROUTES.HOME, - icon: , + icon: , id: 'page_1', }, { - name: 'Kai Chat', + name: 'Discovery', link: ROUTES.CHAT, - icon: , + icon: , id: 'page_2', }, + { + name: 'Chat', + link: ROUTES.CHAT, + icon: , + id: 'page_3', + }, ]; /** diff --git a/frontend/layouts/MainAppLayout/NavMenu/styles.js b/frontend/layouts/MainAppLayout/NavMenu/styles.js index 70b6d0a1d..679fcf878 100644 --- a/frontend/layouts/MainAppLayout/NavMenu/styles.js +++ b/frontend/layouts/MainAppLayout/NavMenu/styles.js @@ -3,49 +3,47 @@ const styles = { container: true, item: true, mobileSmall: true, - rowGap: { laptop: 2, desktop: 4 }, + display: 'flex', + flexDirection: 'row', + justifyContent: 'center', px: { laptop: 1, desktop: 1.5, desktopMedium: 2 }, - flexDirection: 'column', - justifyContent: 'flex-start', - alignItems: 'flex-start', }, menuItemProps: (isActive) => ({ sx: { py: 0, px: { laptop: 1, desktop: 1.5, desktopMedium: 2 }, - width: '100%', - borderRadius: '24px', + maxWidth: '160px', + maxHeight: '40px', + borderRadius: '8px', + background: '#24272F', + m: 1, + border: isActive ? '1px solid #9D74FF' : '1px solid transparent', color: (theme) => - isActive - ? `${theme.palette.Background.purple}95` - : theme.palette.Common.White['100p'], + isActive ? `${theme.palette.Background.purple}95` : '#9E94A5', path: { - fill: (theme) => - isActive - ? `${theme.palette.Background.purple}95` - : theme.palette.Common.White['100p'], stroke: (theme) => - isActive - ? `${theme.palette.Background.purple}95` - : theme.palette.Common.White['100p'], + isActive ? `${theme.palette.Background.purple}95` : '#9E94A5', }, transition: (theme) => theme.transitions.create('all'), ':hover': { - color: (theme) => theme.palette.Common.White['100p'], + color: '#9E94A5', background: (theme) => `${theme.palette.Background.purple}30`, path: { - fill: (theme) => theme.palette.Common.White['100p'], - stroke: (theme) => theme.palette.Common.White['100p'], + stroke: '#9E94A5', }, }, }, }), innerMenuGridProps: { container: true, + item: true, mobileSmall: 12, - columnGap: 4, + columnGap: 1, + display: 'flex', + flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', + bgColor: '#24272F', }, menuIconGridProps: { container: true, @@ -62,7 +60,7 @@ const styles = { menuTitleGridProps: { container: true, item: true, - justifyContent: 'flex-startĖ', + justifyContent: 'flex-start', alignItems: 'center', mobileSmall: true, fontSize: { mobileSmall: '16px', desktop: '18px' }, diff --git a/frontend/layouts/MainAppLayout/SideMenu/SideMenu.jsx b/frontend/layouts/MainAppLayout/SideMenu/SideMenu.jsx index 9e0e57253..4a4c7c903 100644 --- a/frontend/layouts/MainAppLayout/SideMenu/SideMenu.jsx +++ b/frontend/layouts/MainAppLayout/SideMenu/SideMenu.jsx @@ -4,7 +4,7 @@ import { Button, Grid, Typography } from '@mui/material'; import { signOut } from 'firebase/auth'; import { useRouter } from 'next/router'; -import LargeLogo from '@/assets/svg/MenuLogo.svg'; +import KAIAvatar from '@/assets/svg/KAIAvatar.svg'; import ROUTES from '@/constants/routes'; @@ -30,10 +30,9 @@ const SideMenu = () => { return ( router.push(ROUTES.HOME)} {...styles.logoGridProps}> - + - KAI.AI AI Teaching Assistant @@ -42,16 +41,38 @@ const SideMenu = () => { ); }; + const renderProfileImage = () => { + return ( + + + + + + + Alysa Myers + + + + ); + }; + const renderLogout = () => { return ( + /> ); }; @@ -60,6 +81,7 @@ const SideMenu = () => { {renderLogo()} + {renderProfileImage()} {renderLogout()} ); diff --git a/frontend/layouts/MainAppLayout/SideMenu/styles.js b/frontend/layouts/MainAppLayout/SideMenu/styles.js index 8fe3cd99b..6735c1ec0 100644 --- a/frontend/layouts/MainAppLayout/SideMenu/styles.js +++ b/frontend/layouts/MainAppLayout/SideMenu/styles.js @@ -2,21 +2,17 @@ const styles = { mainGridProps: { container: true, item: true, - width: '360px', - flexDirection: 'column', - justifyContent: 'center', + height: '100%', + width: '100%', + flexDirection: 'row', alignItems: 'center', - py: { laptop: 4, desktop: 5, desktopMedium: 6 }, - bgcolor: (theme) => theme.palette.Dark_Colors.Dark[6], + bgcolor: (theme) => theme.palette.Dark_Colors.Dark[6], // proper color #181A205E; change it later in development }, logoGridProps: { container: true, item: true, - columnGap: 1, width: 'auto', justifyContent: 'center', - alignItems: 'center', - mb: 8, sx: { cursor: 'pointer', }, @@ -25,7 +21,7 @@ const styles = { logoutGridProps: { container: true, item: true, - width: '100%', + width: 'auto', px: { laptop: 1, desktop: 1.5, desktopMedium: 2 }, }, logoutButtonProps: { @@ -38,20 +34,17 @@ const styles = { px: { laptop: 1, desktop: 1.5, desktopMedium: 2 }, borderColor: 'transparent', transition: (theme) => theme.transitions.create('all'), - span: { - mr: 4, - }, - color: (theme) => theme.palette.Common.White['100p'], + color: '#9E94A5', path: { - fill: (theme) => theme.palette.Common.White['100p'], - stroke: (theme) => theme.palette.Common.White['100p'], + fill: '#9E94A5', + stroke: '#9E94A5', }, ':hover': { - color: (theme) => theme.palette.Common.White['100p'], + color: '#9E94A5', background: (theme) => `${theme.palette.Background.purple}30`, path: { - fill: (theme) => theme.palette.Common.White['100p'], - stroke: (theme) => theme.palette.Common.White['100p'], + fill: '#9E94A5', + stroke: '#9E94A5', }, }, }, @@ -62,12 +55,21 @@ const styles = { mobileSmall: 'auto', height: 'auto', }, + profileImageGridProps: { + container: true, + item: true, + width: 'auto', + justifyContent: 'center', + sx: { + cursor: 'pointer', + }, + px: { laptop: 2, desktop: 3, desktopMedium: 4 }, + }, titleGridProps: { container: true, item: true, mobileSmall: true, - flexDirection: 'column', - justifyContent: 'flex-start', + justifyContent: 'flex-end', alignItems: 'center', }, titleProps: { @@ -78,7 +80,7 @@ const styles = { subtitleProps: { fontFamily: 'Satoshi Bold', fontSize: '16px', - color: '#AD83FF', + color: 'white', textAlign: 'left', }, }; diff --git a/frontend/layouts/MainAppLayout/styles.js b/frontend/layouts/MainAppLayout/styles.js index e25049d43..f8133fc86 100644 --- a/frontend/layouts/MainAppLayout/styles.js +++ b/frontend/layouts/MainAppLayout/styles.js @@ -1,10 +1,30 @@ const styles = { mainGridProps: { - position: 'relative', container: true, mobileSmall: 12, height: '100vh', maxHeight: '100vh', + width: '100vw', + maxWidth: '100vw', + justifyContent: 'center', + padding: 0, + }, + navBarContainer: { + position: 'fixed', + display: 'flex', + justifyContent: 'center', + width: '1380px', + maxWidth: '100%', + height: '62xp', + maxHeight: '100%', + py: 2, + zIndex: 1, + sx: (theme) => ({ + inset: '0 auto auto auto', + [theme.breakpoints.down('laptop')]: { + display: 'none', + }, + }), }, contentGridProps: (extraContentProps, isToolPage) => ({ container: true, From d60d63a489100fd27efbd6ace99a4d7644754bab Mon Sep 17 00:00:00 2001 From: Celso Date: Tue, 3 Sep 2024 11:55:17 -0400 Subject: [PATCH 2/2] Implements ui revamp of the SideMenu to a Navbar. --- frontend/assets/svg/KAIAvatar.svg | 2 +- .../layouts/MainAppLayout/ MainAppLayout.jsx | 10 +++++-- .../layouts/MainAppLayout/NavMenu/NavMenu.jsx | 2 +- .../layouts/MainAppLayout/NavMenu/styles.js | 1 + .../MainAppLayout/SideMenu/SideMenu.jsx | 17 ++--------- .../layouts/MainAppLayout/SideMenu/styles.js | 28 ++++++++++++++++--- frontend/layouts/MainAppLayout/styles.js | 28 +++++++++++++------ 7 files changed, 58 insertions(+), 30 deletions(-) diff --git a/frontend/assets/svg/KAIAvatar.svg b/frontend/assets/svg/KAIAvatar.svg index 8ad7f17f8..81ad1cb86 100644 --- a/frontend/assets/svg/KAIAvatar.svg +++ b/frontend/assets/svg/KAIAvatar.svg @@ -1,4 +1,4 @@ - + diff --git a/frontend/layouts/MainAppLayout/ MainAppLayout.jsx b/frontend/layouts/MainAppLayout/ MainAppLayout.jsx index b4f8b88d7..aed4eabcf 100644 --- a/frontend/layouts/MainAppLayout/ MainAppLayout.jsx +++ b/frontend/layouts/MainAppLayout/ MainAppLayout.jsx @@ -11,6 +11,7 @@ import Loader from '@/components/Loader'; import ImageURLs from '@/assets/urls'; +import SideMenu from './SideMenu'; import styles from './styles'; import { setLoading } from '@/redux/slices/authSlice'; @@ -53,11 +54,16 @@ const MainAppLayout = (props) => { const renderApp = () => { return ( - + - {children} + + + + + {children} + ); }; diff --git a/frontend/layouts/MainAppLayout/NavMenu/NavMenu.jsx b/frontend/layouts/MainAppLayout/NavMenu/NavMenu.jsx index 28a19d68d..b87a56180 100644 --- a/frontend/layouts/MainAppLayout/NavMenu/NavMenu.jsx +++ b/frontend/layouts/MainAppLayout/NavMenu/NavMenu.jsx @@ -21,7 +21,7 @@ const PAGES = [ }, { name: 'Discovery', - link: ROUTES.CHAT, + link: ROUTES.CHAT, // TODO change the link to the new discovery page icon: , id: 'page_2', }, diff --git a/frontend/layouts/MainAppLayout/NavMenu/styles.js b/frontend/layouts/MainAppLayout/NavMenu/styles.js index 679fcf878..435476833 100644 --- a/frontend/layouts/MainAppLayout/NavMenu/styles.js +++ b/frontend/layouts/MainAppLayout/NavMenu/styles.js @@ -6,6 +6,7 @@ const styles = { display: 'flex', flexDirection: 'row', justifyContent: 'center', + height: '100%', px: { laptop: 1, desktop: 1.5, desktopMedium: 2 }, }, menuItemProps: (isActive) => ({ diff --git a/frontend/layouts/MainAppLayout/SideMenu/SideMenu.jsx b/frontend/layouts/MainAppLayout/SideMenu/SideMenu.jsx index 4a4c7c903..66c275565 100644 --- a/frontend/layouts/MainAppLayout/SideMenu/SideMenu.jsx +++ b/frontend/layouts/MainAppLayout/SideMenu/SideMenu.jsx @@ -19,7 +19,7 @@ import { auth } from '@/redux/store'; * * @return {ReactNode} The rendered Side Menu. */ -const SideMenu = () => { +const SideMenu = ({ user }) => { const router = useRouter(); const handleSignOutUser = () => { @@ -48,9 +48,7 @@ const SideMenu = () => { - - Alysa Myers - + {user?.fullName} ); @@ -61,16 +59,7 @@ const SideMenu = () => {