mirror of
https://github.com/documenso/documenso.git
synced 2025-11-25 14:11:43 +10:00
feat: redirect share page to marketing page after 3 seconds
This commit is contained in:
committed by
Mythie
parent
f2da49d0e8
commit
b12f5b62f1
@ -5,6 +5,8 @@ import { notFound } from 'next/navigation';
|
||||
|
||||
import { getSharingId } from '@documenso/lib/server-only/share/get-share-id';
|
||||
|
||||
import Redirect from './redirect';
|
||||
|
||||
type MetadataProps = {
|
||||
params: { shareId: string };
|
||||
};
|
||||
@ -43,6 +45,7 @@ export default async function SharePage({ params: { shareId } }: SharePageProps)
|
||||
<div className="flex h-screen flex-col items-center justify-center">
|
||||
<h1 className="my-2 text-4xl font-semibold">Share Page</h1>
|
||||
<p className="my-2 text-xl">Redirecting...</p>
|
||||
<Redirect />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
14
apps/web/src/app/(share)/share/[shareId]/redirect.tsx
Normal file
14
apps/web/src/app/(share)/share/[shareId]/redirect.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
export default function Redirect() {
|
||||
React.useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
window.location.href = 'https://www.documenso.com';
|
||||
}, 3000);
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
return <div></div>;
|
||||
}
|
||||
Reference in New Issue
Block a user