commit
4047a7ec23
378 changed files with 29334 additions and 0 deletions
24
pages/share/[...id].js
Normal file
24
pages/share/[...id].js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import React from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import WebsiteDetails from 'components/pages/WebsiteDetails';
|
||||
import useShareToken from 'hooks/useShareToken';
|
||||
|
||||
export default function SharePage() {
|
||||
const router = useRouter();
|
||||
const { id } = router.query;
|
||||
const shareId = id?.[0];
|
||||
const shareToken = useShareToken(shareId);
|
||||
|
||||
if (!shareToken) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { websiteId } = shareToken;
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<WebsiteDetails websiteId={websiteId} />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue