Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 초대장 SEO 설명 연동 #90

Merged
merged 5 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/(main)/i/[subdomain]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export async function generateMetadata(
default: invitation.title,
template: "%s | 인비",
},
description: invitation.description ?? "",
openGraph: {
images,
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "./globals.css";

export const metadata: Metadata = {
title: "초대장 플랫폼, 인비",
description: "따뜻한 마음을 담아 당신의 환대를 전해보세요.",
description: "따뜻한 마음이 담긴 당신의 환대",
openGraph: {
images:
"http://t1.daumcdn.net/brunch/service/user/d4v5/image/Axc3mTi7LoZC2GpsBWosDpRrNPU.png",
Expand Down
22 changes: 19 additions & 3 deletions src/components/editor/sidebar/sidebar-settings-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ function SEOSection() {
mutationFn: async () => {
await updateInvitation({
id: editor.config.invitationId,
description: editor.config.invitationDesc,
thumbnailUrl: editor.config.invitationThumbnail,
});
},
Expand All @@ -198,7 +199,7 @@ function SEOSection() {
링크 공유시 보여지는 정보를 설정해보세요.
</p>
</div>
<div className="col-span-9">
<div className="col-span-9 space-y-1">
<ImageDropzone
disabled={isPending}
onLoadImage={async ({ url, file }) => {
Expand All @@ -217,7 +218,6 @@ function SEOSection() {
id="invitationThumbnail"
disabled={isPending}
componentPrefix={"이미지 링크"}
className="mt-1"
defaultValue={editor.config.invitationThumbnail}
onDebounceChange={(e) => {
dispatch({
Expand All @@ -228,6 +228,20 @@ function SEOSection() {
});
}}
/>
<EditorInput
id="invitationDesc"
disabled={isPending}
componentPrefix={"설명"}
defaultValue={editor.config.invitationDesc}
onDebounceChange={(e) => {
dispatch({
type: "UPDATE_CONFIG",
payload: {
invitationDesc: e.target.value,
},
});
}}
/>
</div>
<div className="col-span-9">
<div className="select-none bg-[#BACEE0] p-4">
Expand All @@ -247,7 +261,9 @@ function SEOSection() {
<div className="text-xs text-neutral-400">
{editor.config.invitationDesc}
</div>
<div className="text-xs text-neutral-300">invi.my</div>
<div className="text-xs text-neutral-300">
{editor.config.invitationSubdomain}.invi.my
</div>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/lib/db/migrations/0004_tranquil_pandemic.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "invitation" ADD COLUMN "description" text;
Loading
Loading