created a route for public collections

This commit is contained in:
Daniel
2023-05-29 23:10:23 +03:30
parent 271231120c
commit 7f9b0d8977
7 changed files with 117 additions and 6 deletions
+26 -2
View File
@@ -1,5 +1,29 @@
import React from "react";
import getPublicCollectionData from "@/lib/client/getPublicCollectionData";
import { PublicCollectionIncludingLinks } from "@/types/global";
import { useRouter } from "next/router";
import React, { useEffect, useState } from "react";
export default function PublicCollections() {
return <div>Hello</div>;
const router = useRouter();
const [data, setData] = useState<PublicCollectionIncludingLinks>();
useEffect(() => {
const init = async () => {
if (router.query.id) {
const data = await getPublicCollectionData(router.query.id as string);
setData(data);
}
};
init();
}, []);
return (
<div>
<p>Hello</p>
{JSON.stringify(data)}
</div>
);
}