mirror of
https://github.com/documenso/documenso.git
synced 2025-11-26 06:32:08 +10:00
feat: create sharing id for each recipient
This commit is contained in:
committed by
Mythie
parent
1bce169228
commit
ebcd7c78e4
@ -1,51 +0,0 @@
|
||||
import { ImageResponse } from 'next/server';
|
||||
|
||||
export const config = {
|
||||
runtime: 'edge',
|
||||
};
|
||||
|
||||
export async function GET() {
|
||||
const [imageData, fontData] = await Promise.all([
|
||||
fetch(new URL('../../../../assets/background-pattern.png', import.meta.url)).then((res) =>
|
||||
res.arrayBuffer(),
|
||||
),
|
||||
fetch(new URL('../../../assets/Caveat-Regular.ttf', import.meta.url)).then((res) =>
|
||||
res.arrayBuffer(),
|
||||
),
|
||||
]);
|
||||
|
||||
return new ImageResponse(
|
||||
(
|
||||
<div
|
||||
style={{
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
background: `url('data:image/png;base64,${Buffer.from(
|
||||
imageData as unknown as string,
|
||||
).toString('base64')}')`,
|
||||
backgroundSize: '1200px 850px',
|
||||
backgroundPositionY: '0%',
|
||||
}}
|
||||
>
|
||||
<div tw="p-16 border-solid border-2 border-sky-500">
|
||||
<div tw=" text-[#64748B99]">Duncan</div>
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
{
|
||||
width: 1200,
|
||||
height: 630,
|
||||
fonts: [
|
||||
{
|
||||
name: 'Caveat',
|
||||
data: fontData,
|
||||
style: 'italic',
|
||||
},
|
||||
],
|
||||
},
|
||||
);
|
||||
}
|
||||
17
apps/web/src/app/(share)/share/[shortId]/page.tsx
Normal file
17
apps/web/src/app/(share)/share/[shortId]/page.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
|
||||
export type SharePageProps = {
|
||||
params: {
|
||||
shortId?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export default async function SharePage({ params: { shortId } }: SharePageProps) {
|
||||
console.log(shortId);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Share Page</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
export default async function SharePage() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Share Page</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user