summaryrefslogtreecommitdiff
path: root/src/components/CommitteeList
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-10-13 22:01:58 +0100
committerGitHub <noreply@github.com>2023-10-13 22:01:58 +0100
commit9ddedf444811bac0dd2d8ce6e21b64c8dee9de76 (patch)
tree37a73f2fa3be191ff3b493246dc9b1fc6b7c5f5c /src/components/CommitteeList
parent6a0bd0ab3a0960cd1436190285ebe24bf8ef1f28 (diff)
parent429aef251345cf54af2feed3f8ecb608db7fd7e7 (diff)
Merge pull request #13 from Sycamost/dev
Dev
Diffstat (limited to 'src/components/CommitteeList')
-rw-r--r--src/components/CommitteeList/CommitteeList.astro8
-rw-r--r--src/components/CommitteeList/CommitteeListItem.astro55
2 files changed, 63 insertions, 0 deletions
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';
+---
+
+<ul>
+ {committee.map((committeeMember) => <CommitteeListItem committeeMember={committeeMember} />)}
+</ul>
diff --git a/src/components/CommitteeList/CommitteeListItem.astro b/src/components/CommitteeList/CommitteeListItem.astro
new file mode 100644
index 0000000..9a5a55b
--- /dev/null
+++ b/src/components/CommitteeList/CommitteeListItem.astro
@@ -0,0 +1,55 @@
+---
+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);
+---
+
+<li class="committee__member">
+ {
+ committeeMember.img && (
+ <img
+ class="committee__member__img"
+ srcset={`
+ ${committeeMember.img.width106.src} 106w,
+ ${committeeMember.img.width146.src} 146w,
+ ${committeeMember.img.width192.src} 192w,
+ ${committeeMember.img.width222.src} 222w
+ `}
+ sizes="
+ (min-width: 120rem) 222px,
+ (min-width: 96rem) 146px,
+ (min-width: 64rem) 192px,
+ (min-width: 48rem) 222px,
+ 106px
+ "
+ alt=""
+ />
+ )
+ }
+ <div class="committee__member__text">
+ <h4>
+ {committeeMember.name}
+ {
+ committeeMember.roles.length > 0 && (
+ <span class="font-weight-lighter">
+ |{' '}
+ {committeeMember.roles.map((role) => t(tRole, { key: CommitteeRole[role] })).join(', ')}
+ </span>
+ )
+ }
+ </h4>
+ {committeeMember.bio && <p set:html={committeeMember.bio[locale]} />}
+ </div>
+</li>