From 796fdeed465f8a4f9d4aaaaf9ddf448f91e901e6 Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Fri, 13 Oct 2023 21:26:13 +0100 Subject: Pulls out CommitteeList component --- src/components/CommitteeList/CommitteeList.astro | 8 +++++ .../CommitteeList/CommitteeListItem.astro | 39 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/components/CommitteeList/CommitteeList.astro create mode 100644 src/components/CommitteeList/CommitteeListItem.astro (limited to 'src/components/CommitteeList') diff --git a/src/components/CommitteeList/CommitteeList.astro b/src/components/CommitteeList/CommitteeList.astro new file mode 100644 index 0000000..f576c9a --- /dev/null +++ b/src/components/CommitteeList/CommitteeList.astro @@ -0,0 +1,8 @@ +--- +import committee from '$data/committee'; +import CommitteeListItem from './CommitteeListItem.astro'; +--- + + diff --git a/src/components/CommitteeList/CommitteeListItem.astro b/src/components/CommitteeList/CommitteeListItem.astro new file mode 100644 index 0000000..d026047 --- /dev/null +++ b/src/components/CommitteeList/CommitteeListItem.astro @@ -0,0 +1,39 @@ +--- +import CommitteeRole from '$enums/CommitteeRole'; +import tRole from '$i18n/translations/enums/committeeRole'; +import translate from '$i18n/translate'; +import type { CommitteeMember } from '$types/CommitteeMember'; +import type Locale from '$types/Locale'; + +interface Props { + committeeMember: CommitteeMember; +} + +const { committeeMember } = Astro.props; + +const locale = Astro.params.locale as Locale; + +const t = translate(locale); +--- + +
  • + { + committeeMember.img && ( + + ) + } +
    +

    + {committeeMember.name} + { + committeeMember.roles.length > 0 && ( + + |{' '} + {committeeMember.roles.map((role) => t(tRole, { key: CommitteeRole[role] })).join(', ')} + + ) + } +

    + {committeeMember.bio &&

    } +

    +
  • -- cgit v1.2.3 From 76b737c5978732363317e029aeec6d3ce9c8234d Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Fri, 13 Oct 2023 21:37:39 +0100 Subject: Optimises Committee images --- src/components/CommitteeList/CommitteeListItem.astro | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/components/CommitteeList') diff --git a/src/components/CommitteeList/CommitteeListItem.astro b/src/components/CommitteeList/CommitteeListItem.astro index d026047..9a5a55b 100644 --- a/src/components/CommitteeList/CommitteeListItem.astro +++ b/src/components/CommitteeList/CommitteeListItem.astro @@ -19,7 +19,23 @@ const t = translate(locale);
  • { committeeMember.img && ( - + ) }
    -- cgit v1.2.3