feat: add artwork caption

This commit is contained in:
Khairul Hidayat 2024-01-11 05:52:47 +00:00
parent 66e763eb1c
commit 77003926da
3 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,31 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("eo6iaxf4pkeqynf")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ovwal2or",
"name": "caption",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("eo6iaxf4pkeqynf")
// remove
collection.schema.removeField("ovwal2or")
return dao.saveCollection(collection)
})

View File

@ -11,7 +11,6 @@ import PageMetadata from "@/components/containers/PageMetadata";
import { useMemo } from "react"; import { useMemo } from "react";
import Button from "@/components/ui/Button"; import Button from "@/components/ui/Button";
import { useBottomScrollListener } from "react-bottom-scroll-listener"; import { useBottomScrollListener } from "react-bottom-scroll-listener";
import loadingIllust from "@/assets/images/l9fsdoa2j7vb1.gif";
import { Skeleton } from "@/components/ui/Skeleton"; import { Skeleton } from "@/components/ui/Skeleton";
const openingChestSfx = new Howl({ const openingChestSfx = new Howl({

View File

@ -52,6 +52,14 @@ const ViewSheet = ({ modal }: Props) => {
<ChevronLeft /> Back <ChevronLeft /> Back
</Button> </Button>
{data.caption?.length > 0 ? (
<div className="my-4 border-b pb-4">
{data.caption.split("\n").map((text: string, idx: number) => (
<p key={idx}>{text}</p>
))}
</div>
) : null}
<Badge>Artist Name</Badge> <Badge>Artist Name</Badge>
<p className="mt-1 truncate">{data.artistName}</p> <p className="mt-1 truncate">{data.artistName}</p>