diff --git a/client/src/App.tsx b/client/src/App.tsx index 762befb8..843e2282 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -4,6 +4,7 @@ import { AppUnProtectedRoutes } from './app/routes'; import { AppProtectedRoutes } from './app/routes/auth-routes'; import useScrollbar from './shared/components/atoms/scrollbar'; import { useAuth } from './shared/hooks/use-auth'; +import Footer from './components/Footer'; const App = memo(() => { const { GlobalScrollbar } = useScrollbar(); @@ -19,6 +20,7 @@ const App = memo(() => { <> + > ); } @@ -27,6 +29,7 @@ const App = memo(() => { <> + > ); }); diff --git a/client/src/components/Footer.css b/client/src/components/Footer.css new file mode 100644 index 00000000..aa85b47d --- /dev/null +++ b/client/src/components/Footer.css @@ -0,0 +1,88 @@ +.footer { + width: 100%; + margin-top: 72px; + background-color: #e5e7eb; /* darker neutral grey */ + border-top: 1px solid #d1d5db; + color: #374151; + font-size: 14px; +} + +.footer-container { + max-width: 1200px; + margin: 0 auto; + padding: 36px 28px 28px; + display: grid; + grid-template-columns: 1fr auto 1fr; + align-items: center; + row-gap: 24px; +} + +/* Left */ +.footer-copy { + font-weight: 600; + color: #111827; +} + +/* Center links */ +.footer-links { + list-style: none; + display: flex; + gap: 22px; + padding: 0; + margin: 0; + justify-content: center; +} + +.footer-links a { + color: #374151; + text-decoration: none; + font-weight: 500; +} + +.footer-links a:hover { + color: #000000; + text-decoration: underline; +} + +/* Right socials */ +.footer-socials { + display: flex; + gap: 18px; + justify-content: flex-end; +} + +.footer-socials a { + color: #4b5563; + text-decoration: none; + font-weight: 500; +} + +.footer-socials a:hover { + color: #000000; +} + +/* Bottom credit */ +.footer-credit { + grid-column: 1 / -1; + text-align: center; + margin-top: 8px; + font-size: 13px; + color: #6b7280; +} + +/* Responsive */ +@media (max-width: 768px) { + .footer-container { + grid-template-columns: 1fr; + text-align: center; + } + + .footer-links { + flex-wrap: wrap; + gap: 14px; + } + + .footer-socials { + justify-content: center; + } +} diff --git a/client/src/components/Footer.tsx b/client/src/components/Footer.tsx new file mode 100644 index 00000000..2a725563 --- /dev/null +++ b/client/src/components/Footer.tsx @@ -0,0 +1,56 @@ +import "./Footer.css"; + +export default function Footer() { + return ( + + ); +} diff --git a/client/src/shared/components/organisms/sidebar/hooks/index.ts b/client/src/shared/components/organisms/sidebar/hooks/index.ts index c4ffe0d4..a2ebe2bc 100644 --- a/client/src/shared/components/organisms/sidebar/hooks/index.ts +++ b/client/src/shared/components/organisms/sidebar/hooks/index.ts @@ -12,7 +12,6 @@ import { } from '../../../../../app/routes/constants/routes'; import { useAuth } from '../../../../hooks/use-auth'; - const logoutStyle = { marginTop: 'auto', marginBottom: 0, @@ -22,6 +21,15 @@ const useSidebar = () => { const [showExpandedView, setShowExpandedView] = useState(false); const { logout } = useAuth(); + const handleLogout = useCallback(() => { + const confirmed = window.confirm( + 'Are you sure you want to logout?' + ); + + if (confirmed) { + logout(); + } + }, [logout]); const handleMouseHoverIn = useCallback(() => { setShowExpandedView(true); @@ -31,7 +39,6 @@ const useSidebar = () => { setShowExpandedView(false); }, []); - const sidebarItems = useMemo(() => { const items: SideBarItemsType[] = [ { @@ -68,21 +75,21 @@ const useSidebar = () => { screenName: ROUTES_PAGE_V1.SETTINGS, }, ]; - + const secondaryItems: SideBarItemsType[] = [ { icon: PowerSettingsNewIcon, - onClick: logout, + onClick: handleLogout, title: 'Logout', style: logoutStyle, }, ]; + return { items: items.filter(({ disable }) => !disable), secondaryItems: secondaryItems.filter(({ disable }) => !disable), }; - }, [logout]); - + }, [handleLogout]); return { showExpandedView, @@ -91,4 +98,5 @@ const useSidebar = () => { sidebarItems, }; }; + export default useSidebar;