diff --git a/src/components/Education.tsx b/src/components/Education.tsx index 0965c58..a392c4a 100644 --- a/src/components/Education.tsx +++ b/src/components/Education.tsx @@ -1,10 +1,26 @@ +import Link from 'next/link'; + +import { EducationTile } from '@/components/Tiles/EducationTile'; import BlurFade, { BLUR_FADE_DELAY } from '@/components/ui/BlurFade'; -import LinkWithArrow from '@/components/ui/LinkWithArrow'; -import { useMediaQuery } from '@/hooks/useMediaQuery'; import { cn } from '@/lib/utils'; export function Education() { - const isDesktop = useMediaQuery('(min-width: 768px)'); + const educationDetails = ( +

+ + Computational Mathematics + {' '} + is a interdisplinary major that combines Mathematics, Statistics, Optimization and Computer + Science, offered by the Faculty of Mathematics. + {/* TODO: Insert all courses using a recursive React component */} +

+ ); + return (
@@ -18,62 +34,15 @@ export function Education() { -
-
-
- {/* // center the bullet : `top-1/2 transform -translate-y-1/2` */} - {'University -
-
-
-
- -

- University of Waterloo -

-
-

- Bachelor of Mathematics, Computational Mathematics Major -

- {!isDesktop && ( -

- Sept 2022 - Present -

- )} -
- {isDesktop && ( -

- Sept 2022 - Present -

- )} -
-
-
-
-

- - Computational Mathematics - {' '} - is a interdisplinary major that combines Mathematics, Statistics, Optimization and - Computer Science, offered by the Faculty of Mathematics. - {/* TODO: Insert all courses using a recursive React component */} -

+
); diff --git a/src/components/Header.tsx b/src/components/Header.tsx index d8e674a..d200736 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -32,7 +32,7 @@ const Header = ({ email, resumeFile, }: HeaderProps) => { - const isDesktop = useMediaQuery('(min-width: 768px)'); + const isTablet = useMediaQuery('(min-width: 768px)'); const [copied, setCopiedId] = useState(); useEffect(() => { setTimeout(() => { @@ -44,7 +44,7 @@ const Header = ({
- {!isDesktop && ( + {!isTablet && (
- {isDesktop && ( + {isTablet && (
+ ); +} diff --git a/src/components/Tiles/ExperienceTile.tsx b/src/components/Tiles/ExperienceTile.tsx index e5314c0..167034f 100644 --- a/src/components/Tiles/ExperienceTile.tsx +++ b/src/components/Tiles/ExperienceTile.tsx @@ -1,6 +1,6 @@ -import LinkWithArrow from '@/components/ui/LinkWithArrow'; -import { useMediaQuery } from '@/hooks/useMediaQuery'; -// import Image from 'next/image'; +import { Icon } from '@iconify/react'; + +import { RecordTile } from '@/components/Tiles/RecordTile'; export type ExperienceTileProps = { companyLogo: string; @@ -19,57 +19,30 @@ export function ExperienceTile({ period, responsibilities, }: ExperienceTileProps) { - const isDesktop = useMediaQuery('(min-width: 768px)'); - return ( -
0) && !isDesktop ? '-mb-6' : 'mb-6') + - ' ' + - 'flex items-center' - } - > -
-
- {/* // center the bullet : `top-1/2 transform -translate-y-1/2` */} - {`${companyName} -
-
-
-
-

{position}

- -

{companyName}

-
- {!isDesktop && ( -

{period}

- )} -
- {isDesktop && ( -

{period}

- )} -
- {responsibilities && responsibilities.length > 0 && ( -
-
    - {responsibilities.map((responsibility, index) => ( -
  • - {responsibility}
  • - ))} -
-
- )} -
-
+ const responsibilitiesAsHTML = responsibilities && responsibilities.length > 0 && ( +
+
    + {responsibilities.map((responsibility, index) => ( +
  • + + {} + + {responsibility} +
  • + ))} +
); + + return ( + + ); } diff --git a/src/components/Tiles/ProjectTile.tsx b/src/components/Tiles/ProjectTile.tsx index d3e85dc..395b187 100644 --- a/src/components/Tiles/ProjectTile.tsx +++ b/src/components/Tiles/ProjectTile.tsx @@ -29,7 +29,7 @@ export function ProjectTile({ liveUrl, techStack, }: ProjectTileProps) { - // const isDesktop = useMediaQuery('(min-width: 768px)') + // const isTablet = useMediaQuery('(min-width: 768px)') return (
diff --git a/src/components/Tiles/RecordTile.tsx b/src/components/Tiles/RecordTile.tsx new file mode 100644 index 0000000..4591468 --- /dev/null +++ b/src/components/Tiles/RecordTile.tsx @@ -0,0 +1,126 @@ +import React from 'react'; + +import LinkWithArrow from '@/components/ui/LinkWithArrow'; +import { useMediaQuery } from '@/hooks/useMediaQuery'; +// import Image from 'next/image'; + +export type RecordTileProps = { + organizationLogo: string; + organizationName: string; + organizationLink: string; + role: string; + duration: string; + body?: React.ReactNode; + organizationBeforeRole?: boolean; +}; + +function jobDescriptorSection( + organization: string, + link: string, + role: string, + duration: string, + isOrganizationBeforeRole: boolean = false, + isWidth768pxOrMore: boolean, +) { + // styling for: + // h2 - text-xl font-bold + // h3 - text-lg font-semibold + + const organizationNameHeadingTag = isOrganizationBeforeRole ? 'h2' : 'h3'; + const organizationNameHeading = React.createElement( + LinkWithArrow, + { + href: link, + target: '_blank', + rel: 'noopener noreferrer', + 'aria-label': `Link to ${organization}`, + }, + React.createElement( + organizationNameHeadingTag, + { className: isOrganizationBeforeRole ? 'text-xl font-bold' : 'text-lg font-semibold' }, + organization, + ), + ); + const roleHeadingTag = !isOrganizationBeforeRole ? 'h2' : 'h3'; + const roleHeading = React.createElement( + roleHeadingTag, + { className: !isOrganizationBeforeRole ? 'text-xl font-bold' : 'text-lg font-semibold' }, + role, + ); + + return ( +
+
+ <> + {isOrganizationBeforeRole && ( + <> + {organizationNameHeading} + {roleHeading} + + )} + {!isOrganizationBeforeRole && ( + <> + {roleHeading} + {organizationNameHeading} + + )} + + {!isWidth768pxOrMore && ( +

{duration}

+ )} +
+ {isWidth768pxOrMore && ( +

{duration}

+ )} +
+ ); +} + +export function RecordTile({ + organizationLogo, + organizationName, + organizationLink, + role, + duration, + body, + organizationBeforeRole = false, +}: RecordTileProps) { + const isTablet = useMediaQuery('(min-width: 768px)'); + const isDesktop = useMediaQuery('(min-width: 1280px)'); + + // const topRow = ( + //

{!organizationBeforeRole ? role : organizationName}

+ // ); + // const bottomRow = ""; + return ( +
+
+ {isTablet && ( +
+
+ {/* // center the bullet : `top-1/2 transform -translate-y-1/2` */} + {`${organizationName} +
+
+ )} +
+ {jobDescriptorSection( + organizationName, + organizationLink, + role, + duration, + organizationBeforeRole, + isTablet, + )} + {body} +
+
+
+ ); +}