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

View File

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