Add the release date to releases.
This commit is contained in:
parent
7129322105
commit
cb2e5e9f17
|
@ -63,3 +63,7 @@
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.release-date {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue