Add the release date to releases.
This commit is contained in:
parent
7129322105
commit
cb2e5e9f17
|
@ -63,3 +63,7 @@
|
|||
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) {
|
||||
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">
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue