From 97a97c516694d44c1ddeaccc9264bac95f730aee Mon Sep 17 00:00:00 2001 From: Shrey Pandya Date: Sun, 15 Sep 2024 04:15:40 -0400 Subject: [PATCH] test link previews --- package.json | 2 +- pages/[...slug].tsx | 51 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 362e41e..d309d38 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "axios": "^0.21.1", "formik": "^2.2.9", "https": "^1.0.0", - "next": "latest", + "next": "^12.0.0", "postcss": "^8.4.7", "prop-types": "^15.7.2", "react": "^16.13.1", diff --git a/pages/[...slug].tsx b/pages/[...slug].tsx index 5a5eee2..b67e30c 100644 --- a/pages/[...slug].tsx +++ b/pages/[...slug].tsx @@ -1,6 +1,7 @@ import { NextPage } from "next"; import { useEffect, useState } from "react"; import { useRouter } from "next/router"; +import Head from "next/head"; import Redirect from "../components/Redirect"; import supabase from "../utils/supabaseClient"; @@ -15,9 +16,6 @@ const DynamicLink: NextPage = () => { const slug = router.query.slug as string[]; const [route, setRoute] = useState(""); - // * Todo: Need to consider if slug is an array of multiple directories - // * ie -> v1michigan.com//, currently we only support v1michigan.com/ - useEffect(() => { const fetchData = async () => { // NextJS routes to an empty slug before going to slug. @@ -44,7 +42,52 @@ const DynamicLink: NextPage = () => { fetchData(); }, [slug]); - return route ? : null; + return route ? ( +
+ + V1’s Recruiting Playbook | Notion + + + + + + + + + + + + + + + + +
+ ) : null; }; export default DynamicLink;