From d48cfe12f2eb0bd53318cecfa0053e82990c4040 Mon Sep 17 00:00:00 2001 From: Ahmed Al-Taiar Date: Fri, 25 Oct 2024 18:35:23 -0400 Subject: [PATCH] [#1] Cleaner homepage --- web/src/Routes.tsx | 2 +- .../ContactCard/ContactCard/ContactCard.tsx | 30 ++++++++----------- .../Social/SocialLinks/SocialLinks.tsx | 6 ++-- web/src/components/Title/Titles/Titles.tsx | 6 ++-- web/src/layouts/NavbarLayout/NavbarLayout.tsx | 23 +++++++++----- web/src/pages/HomePage/HomePage.tsx | 21 ++++++++----- .../AdminResumePage/AdminResumePage.tsx | 2 +- 7 files changed, 50 insertions(+), 40 deletions(-) diff --git a/web/src/Routes.tsx b/web/src/Routes.tsx index 2725059..8e540d6 100644 --- a/web/src/Routes.tsx +++ b/web/src/Routes.tsx @@ -31,7 +31,7 @@ const Routes = () => { - + diff --git a/web/src/components/ContactCard/ContactCard/ContactCard.tsx b/web/src/components/ContactCard/ContactCard/ContactCard.tsx index 5cec9ea..459a7ae 100644 --- a/web/src/components/ContactCard/ContactCard/ContactCard.tsx +++ b/web/src/components/ContactCard/ContactCard/ContactCard.tsx @@ -10,8 +10,8 @@ interface ContactCardProps { } const ContactCard = ({ portraitUrl, socials }: ContactCardProps) => { - const [width, setWidth] = useState() - const [height, setHeight] = useState() + const [width, setWidth] = useState(0) + const [height, setHeight] = useState(0) const observedDiv = useRef(null) @@ -53,24 +53,18 @@ const ContactCard = ({ portraitUrl, socials }: ContactCardProps) => { }} /> -
-
-
- {`${process.env.FIRST_NAME} -
-
-

+
+
+ {`${process.env.FIRST_NAME} +
+

Contact Me

-

-
+
diff --git a/web/src/components/Social/SocialLinks/SocialLinks.tsx b/web/src/components/Social/SocialLinks/SocialLinks.tsx index 58d9488..52519f4 100644 --- a/web/src/components/Social/SocialLinks/SocialLinks.tsx +++ b/web/src/components/Social/SocialLinks/SocialLinks.tsx @@ -3,11 +3,13 @@ import { ContactCardPortrait } from 'types/graphql' import { baseUrls, getLogoComponent, sortOrder } from 'src/lib/handle' const SocialLinks = ({ socials }: ContactCardPortrait) => ( -
+
{[...socials] .sort((a, b) => sortOrder.indexOf(a.type) - sortOrder.indexOf(b.type)) .map((social, i) => ( -
+
{ <> {titlesFiltered.length >= 3 && (
- + {titlesFiltered[0]}
- + {titlesFiltered[1]}
- + {titlesFiltered[2]}
diff --git a/web/src/layouts/NavbarLayout/NavbarLayout.tsx b/web/src/layouts/NavbarLayout/NavbarLayout.tsx index 5301911..88adcb8 100644 --- a/web/src/layouts/NavbarLayout/NavbarLayout.tsx +++ b/web/src/layouts/NavbarLayout/NavbarLayout.tsx @@ -1,7 +1,7 @@ import { mdiMenu, mdiLogout, mdiCog } from '@mdi/js' import Icon from '@mdi/react' -import { Link, routes } from '@redwoodjs/router' +import { Link, routes, useRoutePath, useRoutePaths } from '@redwoodjs/router' import { useAuth } from 'src/auth' import ThemeToggle from 'src/components/ThemeToggle/ThemeToggle' @@ -17,6 +17,9 @@ type NavbarLayoutProps = { } const NavbarLayout = ({ children }: NavbarLayoutProps) => { + const routePaths = useRoutePaths() + const routePath = useRoutePath() + const { isAuthenticated, logOut } = useAuth() const navbarRoutes: NavbarRoute[] = [ @@ -25,7 +28,7 @@ const NavbarLayout = ({ children }: NavbarLayoutProps) => { path: routes.projects(), }, { - name: 'Resume', + name: 'Résumé', path: routes.resume(), }, { @@ -56,7 +59,7 @@ const NavbarLayout = ({ children }: NavbarLayoutProps) => { path: routes.titles(), }, { - name: 'Resume', + name: 'Résumé', path: routes.adminResume(), }, ] @@ -80,12 +83,14 @@ const NavbarLayout = ({ children }: NavbarLayoutProps) => {
-
+
@@ -94,12 +99,12 @@ const NavbarLayout = ({ children }: NavbarLayoutProps) => { tabIndex={0} className="menu dropdown-content -ml-2 mt-4 w-36 gap-2 rounded-box bg-base-200 shadow-xl" > - {isAuthenticated && ( + {isAuthenticated && routePath !== routePaths.home && (

Public

)} - {navbarButtons()} + {routePath !== routePaths.home && navbarButtons()} {isAuthenticated && ( <>

@@ -129,7 +134,9 @@ const NavbarLayout = ({ children }: NavbarLayoutProps) => {

-
{navbarButtons()}
+
+ {routePath !== routePaths.home && navbarButtons()} +
{isAuthenticated && ( diff --git a/web/src/pages/HomePage/HomePage.tsx b/web/src/pages/HomePage/HomePage.tsx index 016b2c7..5140edf 100644 --- a/web/src/pages/HomePage/HomePage.tsx +++ b/web/src/pages/HomePage/HomePage.tsx @@ -1,4 +1,4 @@ -import { mdiCompass, mdiContacts } from '@mdi/js' +import { mdiCodeBraces, mdiContacts, mdiFileDocument } from '@mdi/js' import Icon from '@mdi/react' import type { TCountryCode } from 'countries-list' import { getCountryData } from 'countries-list' @@ -24,7 +24,7 @@ const HomePage = () => (
-

+

Hey 👋, I'm {`${process.env.FIRST_NAME}`}

@@ -39,17 +39,24 @@ const HomePage = () => ( .join(', ')}

-
+
- - Explore + + Projects + + + + Résumé Contact diff --git a/web/src/pages/Resume/AdminResumePage/AdminResumePage.tsx b/web/src/pages/Resume/AdminResumePage/AdminResumePage.tsx index 36c289b..a82ae30 100644 --- a/web/src/pages/Resume/AdminResumePage/AdminResumePage.tsx +++ b/web/src/pages/Resume/AdminResumePage/AdminResumePage.tsx @@ -5,7 +5,7 @@ import AdminResumeCell from 'src/components/Resume/AdminResumeCell/AdminResumeCe const ResumePage = () => { return ( <> - + )