diff --git a/.gitignore b/.gitignore index 45c1abce86..ff34c2007c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /node_modules /.pnp .pnp.js +.yarn/install-state.gz # testing /coverage @@ -34,3 +35,4 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts +node_modules diff --git a/README.md b/README.md index a75ac52488..c4033664f8 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,7 @@ bun dev Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. -You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. - -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. - -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. diff --git a/app/folder/page.tsx b/app/folder/page.tsx new file mode 100644 index 0000000000..266c9740e0 --- /dev/null +++ b/app/folder/page.tsx @@ -0,0 +1,31 @@ +import { Footer } from "@/src/components/Footer"; +import { Header } from "@/src/components/Header"; +import LinkManager from "@/src/components/LinkManager/LinkManager"; +import { END_POINT } from "@/src/constants"; +import getFormattedLinks from "@/src/utils/getFormattedLinks"; + +async function getFetchData(url: string) { + try { + const res = await fetch(url); + const result = await res.json(); + return result; + } catch (error) { + if (error instanceof Error) { + console.error(error.message); + } + } +} + +export default async function FolderPage() { + const linksData = await getFetchData(END_POINT.LINKS); + const links = getFormattedLinks(linksData.data); + const favorites = await getFetchData(END_POINT.FOLDERS); + + return ( + <> +
+ +