-
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: invi page preview * feat: add setting * feat: seo * feat: add page not found * feat: save subdomain * feat: navigation > 초대장 보기 * feat: subdomain * feat: block drag image * feat: apply subdomain * feat: seo desc
- Loading branch information
Showing
10 changed files
with
218 additions
and
44 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,56 @@ | ||
import type { Metadata, ResolvingMetadata } from "next"; | ||
import { notFound } from "next/navigation"; | ||
import Recursive from "~/components/editor/elements/recursive"; | ||
import EditorProvider from "~/components/editor/provider"; | ||
import { getInvitationByEventUrl } from "~/lib/db/schema/invitations.query"; | ||
|
||
type Props = { | ||
params: { subdomain: string }; | ||
}; | ||
|
||
export async function generateMetadata( | ||
{ params }: Props, | ||
parent: ResolvingMetadata, | ||
): Promise<Metadata> { | ||
const invitation = await getInvitationByEventUrl(params.subdomain); | ||
|
||
if (!invitation) { | ||
return {}; | ||
} | ||
const previousImages = (await parent).openGraph?.images || []; | ||
|
||
return { | ||
title: { | ||
default: invitation.title, | ||
template: "%s | 인비", | ||
}, | ||
}; | ||
} | ||
|
||
export default async function Page({ params }: Props) { | ||
const invitation = await getInvitationByEventUrl(params.subdomain); | ||
|
||
if (!invitation) { | ||
notFound(); | ||
} | ||
|
||
return ( | ||
<EditorProvider | ||
editorConfig={{ | ||
invitationId: invitation.id, | ||
invitationTitle: invitation.title, | ||
invitationSubdomain: invitation.eventUrl, | ||
invitationThumbnail: invitation.thumbnailUrl ?? undefined, | ||
}} | ||
editorData={invitation.customFields} | ||
editorState={{ isPreviewMode: true }} | ||
> | ||
<main className="mx-auto max-w-md"> | ||
{Array.isArray(invitation.customFields) && | ||
invitation.customFields.map((childElement) => ( | ||
<Recursive key={childElement.id} element={childElement} /> | ||
))} | ||
</main> | ||
</EditorProvider> | ||
); | ||
} |
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
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