Skip to content

Commit 81860cc

Browse files
committed
고정 게스트북
1 parent f00f609 commit 81860cc

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

app/guestbook/components/bubble.tsx

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
import type { Tables } from "@/types/database-generated.types";
1+
import type { Guestbook } from "@/data/guestbook/types";
22
import { getTzDay } from "@/util/days";
3+
import { PinIcon } from "lucide-react";
34

45
export default function Bubble({
56
message,
67
color,
78
created_at,
8-
}: Tables<"guestbook">) {
9+
pinned,
10+
}: Guestbook) {
911
return (
1012
<div className="flex flex-row justify-end items-end gap-1">
11-
<span className="text-[10px] text-primary">
12-
{getTzDay(created_at).format("YY.MM")}
13-
</span>
13+
<div className="flex flex-col items-end gap-1">
14+
{pinned && <PinIcon className="h-3 w-3 text-primary stroke-[1.5px]"/>}
15+
<span className="text-[10px] text-primary">
16+
{getTzDay(created_at).format("YY.MM")}
17+
</span>
18+
</div>
1419
<div
15-
className="p-0 break-all leading-6 text-sm max-w-[90%] font-medium px-1 underline decoration-4 underline-offset-0"
16-
style={{ textDecorationColor: color }}
20+
className="p-0 break-all leading-6 text-sm max-w-[90%] font-medium px-2 py-0.5 border-2"
21+
style={{ borderColor: color }}
1722
>
1823
{message}
1924
</div>

app/guestbook/components/message-input.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function MessageInput() {
1111
<Input
1212
{...register("message")}
1313
style={{ borderColor: color }}
14-
className="rounded-none border-t-0 border-l-0 border-r-0 border-b-4"
14+
className="rounded-none border-2"
1515
maxLength={1000}
1616
/>
1717
);

data/guestbook/make.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const baseQuery = (
1919
client()
2020
.from("guestbook")
2121
.select("*", options)
22+
.order("pinned", { ascending: true })
2223
.order("created_at", { ascending: false });
2324

2425
export const makeGetGuestbooks =

0 commit comments

Comments
 (0)