diff options
| author | Joe Carstairs <jcarstairs@scottlogic.com> | 2023-08-08 20:43:00 +0100 |
|---|---|---|
| committer | Joe Carstairs <jcarstairs@scottlogic.com> | 2023-08-08 20:43:09 +0100 |
| commit | c09ab868d42a5c15f36e2ba9f55a9668da46e157 (patch) | |
| tree | 5816ce5138a30a6c887ea947a3f572e5a150139f /src/components | |
| parent | a2d76427279e15fa0bd46faa64f3e417f33aaa4a (diff) | |
Nicifies Lallans issues
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/LallansIssue.astro | 37 | ||||
| -rw-r--r-- | src/components/LallansIssueContributions.astro | 29 | ||||
| -rw-r--r-- | src/components/LallansIssueContributors.astro | 18 |
3 files changed, 84 insertions, 0 deletions
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); +--- + +<div class="lallans-issue__header-block"> + <header> + <h1>{ t(tSite, 'lallans') } { issue.issueNumber }</h1> + <p class="italic">{ issue.description[locale] }</p> + </header> + + <div class="lallans-issue__header-block-end"> + <img alt="" src={`/images/lallans/issue${issue.issueNumber}.jpg`} /> + <!-- TODO: payment buttons --> + </div> +</div> + +{ 'contributions' in issue ? ( + <LallansIssueContributions contributions={issue.contributions} locale={locale} /> + ) : ( + 'contributors' in issue ? ( + <LallansIssueContributors contributors={issue.contributors} /> + ) : (<></>) + ) +}
\ 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); +--- + +<section> + <h2>Contributions</h2> + <ul class="lallans-issue__contributions"> + { contributions.map(contribution => ( + <li> + <span class="italic">{ contribution.title }</span> + { 'author' in contribution ? ( + <span> { t(tSite, 'by') } { contribution.author }</span> + ) : (<></>) + } + </li> + ))} + </ul> +</section>
\ 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; +--- + +<section class="lallans-contributors"> + <h2>Contributors</h2> + <ul> + { contributors.map(contributor => ( + <li>{ contributor }</li> + ))} + </ul> +</section>
\ No newline at end of file |
