mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-13 00:02:37 +10:00
fix: store style & library game page
This commit is contained in:
@ -79,19 +79,19 @@ import {
|
|||||||
import { type Game, type GameVersion, type Collection } from "@prisma/client";
|
import { type Game, type GameVersion, type Collection } from "@prisma/client";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const headers = useRequestHeaders(["cookie"]);
|
|
||||||
const { data: gamesData } = await useFetch<
|
|
||||||
(Game & { versions: GameVersion[] })[]
|
|
||||||
>("/api/v1/store/recent", { headers });
|
|
||||||
|
|
||||||
const collections = await useCollections();
|
const collections = await useCollections();
|
||||||
const game = collections.value
|
const library = await useLibrary();
|
||||||
|
const game = [...collections.value, library.value]
|
||||||
.map((e) => e.entries.map((e) => e.game))
|
.map((e) => e.entries.map((e) => e.game))
|
||||||
.flat()
|
.flat()
|
||||||
.find((e) => e.id == route.params.id);
|
.find((e) => e.id == route.params.id);
|
||||||
|
|
||||||
if (game === undefined)
|
if (game === undefined)
|
||||||
throw createError({ statusCode: 404, statusMessage: "Game not found" });
|
throw createError({
|
||||||
|
statusCode: 404,
|
||||||
|
statusMessage: JSON.stringify(collections.value),
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -30,16 +30,18 @@
|
|||||||
>
|
>
|
||||||
{{ game.mName }}
|
{{ game.mName }}
|
||||||
</h2>
|
</h2>
|
||||||
<p class="mt-3 text-lg text-zinc-300 line-clamp-2">
|
<p class="mt-3 text-lg text-zinc-300 line-clamp-2 max-w-xl">
|
||||||
{{ game.mShortDescription }}
|
{{ game.mShortDescription }}
|
||||||
</p>
|
</p>
|
||||||
<div class="mt-8 grid grid-cols-1 lg:grid-cols-2 gap-4">
|
<div>
|
||||||
<NuxtLink
|
<div class="mt-8 grid grid-cols-1 lg:grid-cols-2 gap-4 w-fit mx-auto">
|
||||||
:href="`/store/${game.id}`"
|
<NuxtLink
|
||||||
class="block w-full rounded-md border border-transparent bg-white px-8 py-3 text-base font-medium text-gray-900 hover:bg-gray-100 sm:w-auto"
|
:href="`/store/${game.id}`"
|
||||||
>Check it out</NuxtLink
|
class="block w-full rounded-md border border-transparent bg-white px-8 py-3 text-base font-medium text-gray-900 hover:bg-gray-100 sm:w-auto"
|
||||||
>
|
>Check it out</NuxtLink
|
||||||
<AddLibraryButton :gameId="game.id" />
|
>
|
||||||
|
<AddLibraryButton :gameId="game.id" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user