From c09ab868d42a5c15f36e2ba9f55a9668da46e157 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Tue, 8 Aug 2023 20:43:00 +0100 Subject: Nicifies Lallans issues --- src/components/LallansIssue.astro | 37 ++++++++++++++++++++++++++ src/components/LallansIssueContributions.astro | 29 ++++++++++++++++++++ src/components/LallansIssueContributors.astro | 18 +++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 src/components/LallansIssue.astro create mode 100644 src/components/LallansIssueContributions.astro create mode 100644 src/components/LallansIssueContributors.astro (limited to 'src/components') diff --git a/src/components/LallansIssue.astro b/src/components/LallansIssue.astro new file mode 100644 index 0000000..e57a33c --- /dev/null +++ b/src/components/LallansIssue.astro @@ -0,0 +1,37 @@ +--- +import translate from "../i18n/translate"; +import tSite from '../i18n/translations/site'; +import type LallansIssue from "../types/LallansIssue"; +import type Locale from "../types/Locale"; +import LallansIssueContributions from "./LallansIssueContributions.astro"; +import LallansIssueContributors from "./LallansIssueContributors.astro"; + +interface Props { + issue: LallansIssue; + locale: Locale; +} + +const { issue, locale } = Astro.props; +const t = translate(locale); +--- + +
+
+

{ t(tSite, 'lallans') } { issue.issueNumber }

+

{ issue.description[locale] }

+
+ +
+ + +
+
+ +{ 'contributions' in issue ? ( + + ) : ( + 'contributors' in issue ? ( + + ) : (<>) + ) +} \ No newline at end of file diff --git a/src/components/LallansIssueContributions.astro b/src/components/LallansIssueContributions.astro new file mode 100644 index 0000000..73634a2 --- /dev/null +++ b/src/components/LallansIssueContributions.astro @@ -0,0 +1,29 @@ +--- +import translate from "../i18n/translate"; +import tSite from '../i18n/translations/site'; +import type { Contribution } from '../types/LallansIssue'; +import type Locale from '../types/Locale'; + +interface Props { + contributions: Contribution[]; + locale: Locale; +} + +const { contributions, locale } = Astro.props; +const t = translate(locale); +--- + +
+

Contributions

+
    + { contributions.map(contribution => ( +
  • + { contribution.title } + { 'author' in contribution ? ( + { t(tSite, 'by') } { contribution.author } + ) : (<>) + } +
  • + ))} +
+
\ No newline at end of file diff --git a/src/components/LallansIssueContributors.astro b/src/components/LallansIssueContributors.astro new file mode 100644 index 0000000..4149e11 --- /dev/null +++ b/src/components/LallansIssueContributors.astro @@ -0,0 +1,18 @@ +--- +import type { Contributor } from '../types/LallansIssue'; + +interface Props { + contributors: Contributor[]; +} + +const { contributors } = Astro.props; +--- + +
+

Contributors

+
    + { contributors.map(contributor => ( +
  • { contributor }
  • + ))} +
+
\ No newline at end of file -- cgit v1.2.3