1
Fork 0

Add the release date to releases.

This commit is contained in:
Bauke 2022-02-11 11:48:16 +01:00
parent 7129322105
commit cb2e5e9f17
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
3 changed files with 13 additions and 0 deletions

View File

@ -63,3 +63,7 @@
margin-right: 1rem;
}
}
.release-date {
font-size: 80%;
}

View File

@ -66,6 +66,11 @@ export default class ReleasePage extends Component<Props, State> {
if (loading === 'finished' && release !== undefined) {
document.title = release.display();
const date =
release.date === undefined
? undefined
: html`<span class="release-date">${release.date}</span>`;
const image =
release.image === undefined
? undefined
@ -117,6 +122,7 @@ export default class ReleasePage extends Component<Props, State> {
<header class="release-header">
${image}
<h1>${release.artist}<br />${release.title}</h1>
${date}
</header>
<main class="release-main">

View File

@ -9,6 +9,7 @@ type ApiReleaseData = {
'cover-art-archive': {
front: boolean;
};
date: string | undefined;
id: string;
relations: Array<{
ended: boolean;
@ -23,6 +24,7 @@ type ApiReleaseData = {
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IRelease {
artist: string;
date: string | undefined;
image: string | undefined;
links: RelationLink[];
title: string;
@ -77,6 +79,7 @@ export default class Release {
return new Release({
artist,
date: data.date,
image,
links,
title: data.title,