From d8f965a4efdfff400b5de55f8bc0f06b2649b319 Mon Sep 17 00:00:00 2001 From: Chee Kian Teoh Date: Mon, 25 Mar 2024 22:26:02 -0400 Subject: [PATCH] refactor the team section --- src/components/index.tsx | 2 +- src/components/sections/Team/Team.section.tsx | 91 ++++++++++++++++ .../{Team.section.tsx => Team/data.ts} | 102 +----------------- 3 files changed, 93 insertions(+), 102 deletions(-) create mode 100644 src/components/sections/Team/Team.section.tsx rename src/components/sections/{Team.section.tsx => Team/data.ts} (54%) diff --git a/src/components/index.tsx b/src/components/index.tsx index 23aea7bc..a9eb6131 100644 --- a/src/components/index.tsx +++ b/src/components/index.tsx @@ -14,7 +14,7 @@ export { Menu } from './Navbar/Menu'; * */ export { HeroStatSection } from './sections/HeroStats.section'; -export { TeamSection } from './sections/Team.section'; +export { TeamSection } from './sections/Team/Team.section'; export { ContactSection } from './sections/Contact.section'; export { FooterSection } from './sections/Footer.section'; export { SponsorFAQSection } from './sections/SponsorFAQ.section'; \ No newline at end of file diff --git a/src/components/sections/Team/Team.section.tsx b/src/components/sections/Team/Team.section.tsx new file mode 100644 index 00000000..b3dfd713 --- /dev/null +++ b/src/components/sections/Team/Team.section.tsx @@ -0,0 +1,91 @@ +import { departments } from './data'; + +interface Member { + name: string; + title: string; + profile: string; +} + +interface DepartmentProps { + title: string; + members: Member[]; +} + +const Department: React.FC = ({ title, members }) => { + return ( +
+

+ {title} +

+
    + {members.map((member, index) => ( +
  • + {title} + +
    +

    + {member.name} +

    +

    + {member.title} +

    +
    +
  • + ))} +
+
+ ); +}; + +const TeamSection = () => { + return ( +
+ {/* top images */} +
+ + + +
+ + {/* right building image */} + + {/* left building image */} + + +
+ {departments.map((department) => ( + + ))} +
+
+ ); +}; + +export { TeamSection }; diff --git a/src/components/sections/Team.section.tsx b/src/components/sections/Team/data.ts similarity index 54% rename from src/components/sections/Team.section.tsx rename to src/components/sections/Team/data.ts index 4d367442..f3e89713 100644 --- a/src/components/sections/Team.section.tsx +++ b/src/components/sections/Team/data.ts @@ -1,16 +1,3 @@ -interface Member { - name: string; - title: string; - profile: string; -} - -interface MemberProps extends Member {} - -interface DepartmentProps { - title: string; - members: Member[]; -} - const departments = [ { title: 'design', @@ -144,91 +131,4 @@ const departments = [ }, ]; -const Member: React.FC = ({ name, title, profile }) => { - return ( - // ?width can be fixed (84 when small, 128 when big or large viewport) (done) -
  • - {title} - -
    -

    {name}

    -

    {title}

    -
    -
  • - ); -}; - -const Department: React.FC = ({ title, members }) => { - return ( -
    -

    - {title} -

    -
      - {members.map((member, index) => ( - - ))} -
    -
    - ); -}; - -const TeamSection = () => { - return ( - // should have decide the consistent padding - // or right now, i can focus on the section and increase the padding -
    - {/* image at the top */} -
    - {/* keep the banner only in mobile view */} - {/* keep the balloon after mobile view */} - - - -
    - - {/* right building image */} - - {/* left building image */} - - -
    - {departments.map((department) => ( - - ))} -
    -
    - ); -}; - -export { TeamSection }; +export { departments };