-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement library, slug and fixes
- Loading branch information
1 parent
059d73d
commit 42e573a
Showing
39 changed files
with
975 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script setup lang="ts"> | ||
import { joinURL } from "ufo"; | ||
import type { BaseAPIFields } from "@/types/api"; | ||
import type { CollectionsRecord } from "@/types/pb"; | ||
const props = defineProps<{ | ||
collection: CollectionsRecord & BaseAPIFields; | ||
}>(); | ||
const ui = { body: { base: "relative", padding: "p-0 sm:p-0" } }; | ||
const description = props.collection.description | ||
?.replace(/<[^>]*>/g, "") | ||
.substring(0, 200); | ||
</script> | ||
|
||
<template> | ||
<ULink :to="joinURL('/library', collection.id)" class="group block"> | ||
<UCard :ui="ui"> | ||
<div class="space-y-4 p-4"> | ||
<div class="prose prose-invert"> | ||
<h4 | ||
class="decoration-primary-400 decoration-[.2rem] underline-offset-[.2rem] group-hover:underline" | ||
> | ||
{{ collection.name }} | ||
</h4> | ||
<p v-if="description"> | ||
{{ description }} | ||
</p> | ||
</div> | ||
</div> | ||
</UCard> | ||
</ULink> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<script setup lang="ts"> | ||
import { joinURL } from "ufo"; | ||
import type { | ||
ReleasesResponse, | ||
ReviewsResponse, | ||
TitlesResponse, | ||
UsersResponse, | ||
} from "@/types/pb"; | ||
defineProps<{ | ||
review: ReviewsResponse; | ||
user?: UsersResponse; | ||
release?: ReleasesResponse<{ | ||
title: TitlesResponse; | ||
}>; | ||
}>(); | ||
const ui = { body: { base: "relative", padding: "p-0 sm:p-0" } }; | ||
</script> | ||
|
||
<template> | ||
<ULink :to="joinURL('/review', review.id)" class="group"> | ||
<UCard :ui="ui"> | ||
<div class="relative flex"> | ||
<div v-if="release?.expand?.title" class="w-32 flex-shrink-0"> | ||
<img | ||
:src=" | ||
$pb.files.getUrl(release.expand.title, release.expand.title.cover) | ||
" | ||
class="h-full w-full object-cover transition-all group-hover:brightness-75" | ||
/> | ||
</div> | ||
<div class="space-y-4 p-4"> | ||
<div class="prose prose-invert"> | ||
<h3 v-if="release" class="font-condensed"> | ||
{{ release.expand?.title.name }} - {{ release.name }} | ||
</h3> | ||
<h4 | ||
class="decoration-primary-400 decoration-[.2rem] underline-offset-[.2rem] group-hover:underline" | ||
> | ||
{{ review.header }} | ||
</h4> | ||
<p> | ||
{{ review.content }} | ||
</p> | ||
</div> | ||
|
||
<div | ||
v-if="user" | ||
class="flex items-center justify-between gap-2 overflow-hidden" | ||
> | ||
<div class="flex items-center gap-2"> | ||
<img | ||
:src=" | ||
$pb.files.getUrl(user, user.avatar, { | ||
thumb: '32x32', | ||
}) | ||
" | ||
class="rounded-full" | ||
/> | ||
<span class="overflow-hidden text-ellipsis whitespace-nowrap"> | ||
{{ user.displayName || user.username }} | ||
</span> | ||
</div> | ||
<UBadge v-if="review.score >= 7" variant="subtle"> | ||
{{ $t("review.recommend") }} | ||
</UBadge> | ||
</div> | ||
</div> | ||
</div> | ||
</UCard> | ||
</ULink> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.