From 846a42a3abd90b8d07f42ec0b7a9fb2442667a99 Mon Sep 17 00:00:00 2001 From: "Jason M. Hasperhoven" Date: Wed, 25 Sep 2024 23:09:45 +0400 Subject: [PATCH] Setup pages for v2 routes (#68) * Setup pages for v2 routes * Use redirect fn --- src/app/v2/explore/page.tsx | 13 +++++++++++++ src/app/v2/inspect/page.tsx | 13 +++++++++++++ src/app/v2/page.tsx | 15 ++++----------- src/app/v2/portfolio/page.tsx | 13 +++++++++++++ src/app/v2/trade/page.tsx | 13 +++++++++++++ src/pages/index.tsx | 3 +-- src/utils/routes/pages.ts | 3 ++- 7 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 src/app/v2/explore/page.tsx create mode 100644 src/app/v2/inspect/page.tsx create mode 100644 src/app/v2/portfolio/page.tsx create mode 100644 src/app/v2/trade/page.tsx diff --git a/src/app/v2/explore/page.tsx b/src/app/v2/explore/page.tsx new file mode 100644 index 00000000..4d42c22c --- /dev/null +++ b/src/app/v2/explore/page.tsx @@ -0,0 +1,13 @@ +'use client'; + +import { Text } from '@penumbra-zone/ui/Text'; + +const ExplorePage = () => { + return ( +
+ Hi! +
+ ); +}; + +export default ExplorePage; diff --git a/src/app/v2/inspect/page.tsx b/src/app/v2/inspect/page.tsx new file mode 100644 index 00000000..ff1d910b --- /dev/null +++ b/src/app/v2/inspect/page.tsx @@ -0,0 +1,13 @@ +'use client'; + +import { Text } from '@penumbra-zone/ui/Text'; + +const InspectPage = () => { + return ( +
+ Hi! +
+ ); +}; + +export default InspectPage; diff --git a/src/app/v2/page.tsx b/src/app/v2/page.tsx index 49b9ce00..e661dc22 100644 --- a/src/app/v2/page.tsx +++ b/src/app/v2/page.tsx @@ -1,13 +1,6 @@ -'use client'; +import { redirect } from 'next/navigation'; +import { PagePath } from '@/utils/routes/pages.ts'; -import { Text } from '@penumbra-zone/ui/Text'; - -const HomePage = () => { - return ( -
- Hi! -
- ) +export default function RedirectPage() { + redirect(PagePath.Trade); } - -export default HomePage; diff --git a/src/app/v2/portfolio/page.tsx b/src/app/v2/portfolio/page.tsx new file mode 100644 index 00000000..69378796 --- /dev/null +++ b/src/app/v2/portfolio/page.tsx @@ -0,0 +1,13 @@ +'use client'; + +import { Text } from '@penumbra-zone/ui/Text'; + +const PortfolioPage = () => { + return ( +
+ Hi! +
+ ); +}; + +export default PortfolioPage; diff --git a/src/app/v2/trade/page.tsx b/src/app/v2/trade/page.tsx new file mode 100644 index 00000000..15a3c84e --- /dev/null +++ b/src/app/v2/trade/page.tsx @@ -0,0 +1,13 @@ +'use client'; + +import { Text } from '@penumbra-zone/ui/Text'; + +const TradePage = () => { + return ( +
+ Hi! +
+ ); +}; + +export default TradePage; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index f4e83465..71cc7a28 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,9 +1,8 @@ -/* eslint-disable -- disabling this file as this was created before our strict rules */ export default function Home() { return null; } -export async function getServerSideProps() { +export function getServerSideProps() { return { redirect: { destination: '/trade', diff --git a/src/utils/routes/pages.ts b/src/utils/routes/pages.ts index 882ffad3..c83e8213 100644 --- a/src/utils/routes/pages.ts +++ b/src/utils/routes/pages.ts @@ -1,5 +1,6 @@ export enum PagePath { - Explore = '/v2', + Home = '/v2', + Explore = '/v2/explore', Trade = '/v2/trade', Inspect = '/v2/inspect', Portfolio = '/v2/portfolio',