From 816d73bd57b3c47eb438d83e1707ab4ed446477e Mon Sep 17 00:00:00 2001 From: r-freeman Date: Wed, 1 Feb 2023 20:53:47 +0000 Subject: [PATCH] Extracted icons and moved components --- components/Resume.tsx | 91 +++++++++++++++++ components/icons/ArrowDownIcon.tsx | 14 +++ components/icons/BriefcaseIcon.tsx | 24 +++++ components/{ => icons}/ForkIcon.tsx | 0 components/{ => icons}/LinkIcon.tsx | 0 components/{ => icons}/SocialIcons.tsx | 0 components/{ => icons}/StarIcon.tsx | 0 pages/about.tsx | 2 +- pages/index.tsx | 130 +------------------------ pages/projects.tsx | 4 +- 10 files changed, 134 insertions(+), 131 deletions(-) create mode 100644 components/Resume.tsx create mode 100644 components/icons/ArrowDownIcon.tsx create mode 100644 components/icons/BriefcaseIcon.tsx rename components/{ => icons}/ForkIcon.tsx (100%) rename components/{ => icons}/LinkIcon.tsx (100%) rename components/{ => icons}/SocialIcons.tsx (100%) rename components/{ => icons}/StarIcon.tsx (100%) diff --git a/components/Resume.tsx b/components/Resume.tsx new file mode 100644 index 0000000..cbe87f8 --- /dev/null +++ b/components/Resume.tsx @@ -0,0 +1,91 @@ +import {BriefcaseIcon} from '@/components/icons/BriefcaseIcon' +import {ArrowDownIcon} from '@/components/icons/ArrowDownIcon' +import {Button} from '@/components/Button' + +type Work = { + company: string + title: string + start: { + label: string + dateTime: string + } + end: { + label: string + dateTime: string + } +} + +export function Resume() { + const work: Work[] = [ + { + company: 'Aer Lingus', + title: 'Software engineer', + start: { + label: '2022', + dateTime: '2022' + }, + end: { + label: 'present', + dateTime: new Date().getFullYear().toString(), + } + }, + { + company: 'Apple', + title: 'At home advisor', + start: { + label: '2014', + dateTime: '2014' + }, + end: { + label: '2018', + dateTime: '2018' + }, + } + ] + + return ( +
+

+ + Work +

+
    + {work.map((role, roleIndex) => ( +
  1. + +
    +
    Company
    +
    + {role.company} +
    +
    Role
    +
    + {role.title} +
    +
    Date
    +
    + + + +
    +
    +
  2. + ))} +
+ +
+ ) +} \ No newline at end of file diff --git a/components/icons/ArrowDownIcon.tsx b/components/icons/ArrowDownIcon.tsx new file mode 100644 index 0000000..af70bd4 --- /dev/null +++ b/components/icons/ArrowDownIcon.tsx @@ -0,0 +1,14 @@ +import {Props} from '@/types' + +export function ArrowDownIcon(props: Props) { + return ( + + ) +} diff --git a/components/icons/BriefcaseIcon.tsx b/components/icons/BriefcaseIcon.tsx new file mode 100644 index 0000000..75781a5 --- /dev/null +++ b/components/icons/BriefcaseIcon.tsx @@ -0,0 +1,24 @@ +import {Props} from '@/types' + +export function BriefcaseIcon(props: Props) { + return ( + + ) +} \ No newline at end of file diff --git a/components/ForkIcon.tsx b/components/icons/ForkIcon.tsx similarity index 100% rename from components/ForkIcon.tsx rename to components/icons/ForkIcon.tsx diff --git a/components/LinkIcon.tsx b/components/icons/LinkIcon.tsx similarity index 100% rename from components/LinkIcon.tsx rename to components/icons/LinkIcon.tsx diff --git a/components/SocialIcons.tsx b/components/icons/SocialIcons.tsx similarity index 100% rename from components/SocialIcons.tsx rename to components/icons/SocialIcons.tsx diff --git a/components/StarIcon.tsx b/components/icons/StarIcon.tsx similarity index 100% rename from components/StarIcon.tsx rename to components/icons/StarIcon.tsx diff --git a/pages/about.tsx b/pages/about.tsx index cbb5031..213485e 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -9,7 +9,7 @@ import { GitHubIcon, LinkedInIcon, TwitterIcon -} from '@/components/SocialIcons' +} from '@/components/icons/SocialIcons' import {Props} from 'types' import photoOfMe from '@/public/static/images/photo-of-me.jpg' import awsCCPBadge from '@/public/static/images/aws-certified-cloud-practitioner-badge.png' diff --git a/pages/index.tsx b/pages/index.tsx index 514f077..987fdf4 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,14 +1,13 @@ import Head from 'next/head' import {GetStaticProps} from 'next' - import {Card} from '@/components/Card' -import {Button} from '@/components/Button' +import {Resume} from '@/components/Resume' import {Container} from '@/components/Container' import { GitHubIcon, LinkedInIcon, TwitterIcon -} from '@/components/SocialIcons' +} from '@/components/icons/SocialIcons' import {SocialLink} from '@/components/SocialLink' import {Views} from '@/components/Views' import {formatDate} from '@/lib/formatDate' @@ -17,55 +16,6 @@ import {generateSitemap} from '@/lib/generateSitemap' import {getAllArticles} from '@/lib/getAllArticles' import {Article} from 'types' -type Work = { - company: string - title: string - start: { - label: string - dateTime: string - } - end: { - label: string - dateTime: string - } -} - -function BriefcaseIcon(props: { className: string }) { - return ( - - ) -} - -function ArrowDownIcon(props: { className: string }) { - return ( - - ) -} - function Article(article: Article) { return ( @@ -84,82 +34,6 @@ function Article(article: Article) { ) } - -function Resume() { - const work: Work[] = [ - { - company: 'Aer Lingus', - title: 'Software engineer', - start: { - label: '2022', - dateTime: '2022' - }, - end: { - label: 'present', - dateTime: new Date().getFullYear().toString(), - } - }, - { - company: 'Apple', - title: 'At home advisor', - start: { - label: '2014', - dateTime: '2014' - }, - end: { - label: '2018', - dateTime: '2018' - }, - } - ] - - return ( -
-

- - Work -

-
    - {work.map((role, roleIndex) => ( -
  1. - -
    -
    Company
    -
    - {role.company} -
    -
    Role
    -
    - {role.title} -
    -
    Date
    -
    - - - -
    -
    -
  2. - ))} -
- -
- ) -} - export default function Home({articles}: { articles: Article[] }) { return ( <> diff --git a/pages/projects.tsx b/pages/projects.tsx index 18edb16..2f72e2a 100644 --- a/pages/projects.tsx +++ b/pages/projects.tsx @@ -3,8 +3,8 @@ import Head from 'next/head' import {Card} from '@/components/Card' import {SimpleLayout} from '@/components/SimpleLayout' import {SocialLink} from '@/components/SocialLink' -import {StarIcon} from '@/components/StarIcon' -import {ForkIcon} from '@/components/ForkIcon' +import {StarIcon} from '@/components/icons/StarIcon' +import {ForkIcon} from '@/components/icons/ForkIcon' import {getPinnedRepos} from '@/lib/github' import {numberFormat} from '@/lib/numberFormat' import type {Repo} from '@/types'