mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
This commit is contained in:
parent
f4aec30b8f
commit
af3cede125
6 changed files with 25 additions and 16 deletions
9
src/components/ReleaseDate.astro
Normal file
9
src/components/ReleaseDate.astro
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
interface Props {
|
||||||
|
date: Date
|
||||||
|
}
|
||||||
|
const { props, currentLocale: locale } = Astro
|
||||||
|
const { date } = props
|
||||||
|
---
|
||||||
|
|
||||||
|
{new Intl.DateTimeFormat(locale, { dateStyle: 'medium' }).format(date)}
|
||||||
|
|
@ -9,13 +9,13 @@ import BaseLayout from 'layouts/base.astro'
|
||||||
import TrackList from 'components/albumPage/TrackList'
|
import TrackList from 'components/albumPage/TrackList'
|
||||||
import DownloadBtn from 'components/albumPage/DownloadBtn.astro'
|
import DownloadBtn from 'components/albumPage/DownloadBtn.astro'
|
||||||
import AlbumBox from 'components/AlbumBox.astro'
|
import AlbumBox from 'components/AlbumBox.astro'
|
||||||
import releaseDate from 'utils/releaseDate'
|
|
||||||
|
|
||||||
import kofi from 'img/socials/ko-fi-donate-button.png'
|
import kofi from 'img/socials/ko-fi-donate-button.png'
|
||||||
import discord from 'img/socials/discord.png'
|
import discord from 'img/socials/discord.png'
|
||||||
import vgmdbLogo from 'img/assets/vgmdb-logo.png'
|
import vgmdbLogo from 'img/assets/vgmdb-logo.png'
|
||||||
import flyIcon from 'img/assets/fly-icon.png'
|
import flyIcon from 'img/assets/fly-icon.png'
|
||||||
import ouoIcon from 'img/assets/ouo-icon.png'
|
import ouoIcon from 'img/assets/ouo-icon.png'
|
||||||
|
import ReleaseDate from 'components/ReleaseDate.astro'
|
||||||
|
|
||||||
const { id } = Astro.params
|
const { id } = Astro.params
|
||||||
const { permissions } = Astro.locals
|
const { permissions } = Astro.locals
|
||||||
|
|
@ -131,7 +131,7 @@ const coverImage = await getImage({
|
||||||
<tr>
|
<tr>
|
||||||
<th class='width-row'>{m.releaseDate()}</th>
|
<th class='width-row'>{m.releaseDate()}</th>
|
||||||
<td>
|
<td>
|
||||||
{releaseDate(album?.releaseDate)}
|
<ReleaseDate date={album?.releaseDate} />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
) : null
|
) : null
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { Image } from 'astro:assets'
|
||||||
|
|
||||||
import BaseLayout from 'layouts/base.astro'
|
import BaseLayout from 'layouts/base.astro'
|
||||||
import AlbumBox from 'components/AlbumBox.astro'
|
import AlbumBox from 'components/AlbumBox.astro'
|
||||||
import releaseDate from 'utils/releaseDate'
|
import ReleaseDate from 'components/ReleaseDate.astro'
|
||||||
|
|
||||||
const { id } = Astro.params
|
const { id } = Astro.params
|
||||||
|
|
||||||
|
|
@ -87,7 +87,9 @@ const { currentLocale } = Astro
|
||||||
anim.releaseDate ? (
|
anim.releaseDate ? (
|
||||||
<div class='table-row'>
|
<div class='table-row'>
|
||||||
<div class='table-cell text-md font-medium'>{m.releaseDate()}</div>
|
<div class='table-cell text-md font-medium'>{m.releaseDate()}</div>
|
||||||
<div class='table-cell text-md'>{releaseDate(anim.releaseDate)}</div>
|
<div class='table-cell text-md'>
|
||||||
|
<ReleaseDate date={anim.releaseDate} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { SEO } from 'astro-seo'
|
||||||
import BaseLayout from 'layouts/base.astro'
|
import BaseLayout from 'layouts/base.astro'
|
||||||
|
|
||||||
import AlbumBox from 'components/AlbumBox.astro'
|
import AlbumBox from 'components/AlbumBox.astro'
|
||||||
import releaseDate from 'utils/releaseDate'
|
import ReleaseDate from 'components/ReleaseDate.astro'
|
||||||
|
|
||||||
const { slug } = Astro.params
|
const { slug } = Astro.params
|
||||||
if (!slug) return Astro.redirect('/404')
|
if (!slug) return Astro.redirect('/404')
|
||||||
|
|
@ -84,7 +84,9 @@ const coverImage = await getImage({
|
||||||
game.releaseDate ? (
|
game.releaseDate ? (
|
||||||
<tr>
|
<tr>
|
||||||
<th class='width-row'>{m.releaseDate()}:</th>
|
<th class='width-row'>{m.releaseDate()}:</th>
|
||||||
<td>{releaseDate(game.releaseDate)}</td>
|
<td>
|
||||||
|
<ReleaseDate date={game.releaseDate} />
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,8 @@ import { getImage, Image } from 'astro:assets'
|
||||||
import { SEO } from 'astro-seo'
|
import { SEO } from 'astro-seo'
|
||||||
|
|
||||||
import BaseLayout from 'layouts/base.astro'
|
import BaseLayout from 'layouts/base.astro'
|
||||||
|
|
||||||
import AlbumBox from 'components/AlbumBox.astro'
|
import AlbumBox from 'components/AlbumBox.astro'
|
||||||
import releaseDate from 'utils/releaseDate'
|
import ReleaseDate from 'components/ReleaseDate.astro'
|
||||||
|
|
||||||
const { slug } = Astro.params
|
const { slug } = Astro.params
|
||||||
if (!slug) return Astro.redirect('/404')
|
if (!slug) return Astro.redirect('/404')
|
||||||
|
|
@ -132,7 +131,8 @@ const coverImage = await getImage({
|
||||||
<tr>
|
<tr>
|
||||||
<th class='width-row'>{m.firstRelease()}:</th>
|
<th class='width-row'>{m.firstRelease()}:</th>
|
||||||
<td>
|
<td>
|
||||||
{releaseDate(firstGame.releaseDate)} - <a href={`/game/${firstGame.slug}`}>{firstGame.name}</a>
|
<ReleaseDate date={firstGame.releaseDate} /> -{' '}
|
||||||
|
<a href={`/game/${firstGame.slug}`}>{firstGame.name}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
) : null
|
) : null
|
||||||
|
|
@ -142,7 +142,9 @@ const coverImage = await getImage({
|
||||||
<tr>
|
<tr>
|
||||||
<th class='width-row'>{m.newestRelease()}:</th>
|
<th class='width-row'>{m.newestRelease()}:</th>
|
||||||
<td>
|
<td>
|
||||||
{releaseDate(lastGame.releaseDate)} - <a href={`/game/${lastGame.slug}`}>{lastGame.name}</a>
|
<ReleaseDate date={lastGame.releaseDate} />
|
||||||
|
<span> - </span>
|
||||||
|
<a href={`/game/${lastGame.slug}`}>{lastGame.name}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
) : null
|
) : null
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
const locale =
|
|
||||||
navigator && navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language
|
|
||||||
|
|
||||||
const releaseDate = (date: Date) => new Intl.DateTimeFormat(locale, { dateStyle: 'medium' }).format(date)
|
|
||||||
|
|
||||||
export default releaseDate
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue