Skip to content

Commit

Permalink
Setup pages for v2 routes (#68)
Browse files Browse the repository at this point in the history
* Setup pages for v2 routes

* Use redirect fn
  • Loading branch information
JasonMHasperhoven authored Sep 25, 2024
1 parent b0466cf commit 846a42a
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 14 deletions.
13 changes: 13 additions & 0 deletions src/app/v2/explore/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use client';

import { Text } from '@penumbra-zone/ui/Text';

const ExplorePage = () => {
return (
<section>
<Text h2>Hi!</Text>
</section>
);
};

export default ExplorePage;
13 changes: 13 additions & 0 deletions src/app/v2/inspect/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use client';

import { Text } from '@penumbra-zone/ui/Text';

const InspectPage = () => {
return (
<section>
<Text h2>Hi!</Text>
</section>
);
};

export default InspectPage;
15 changes: 4 additions & 11 deletions src/app/v2/page.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<section>
<Text h2>Hi!</Text>
</section>
)
export default function RedirectPage() {
redirect(PagePath.Trade);
}

export default HomePage;
13 changes: 13 additions & 0 deletions src/app/v2/portfolio/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use client';

import { Text } from '@penumbra-zone/ui/Text';

const PortfolioPage = () => {
return (
<section>
<Text h2>Hi!</Text>
</section>
);
};

export default PortfolioPage;
13 changes: 13 additions & 0 deletions src/app/v2/trade/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use client';

import { Text } from '@penumbra-zone/ui/Text';

const TradePage = () => {
return (
<section>
<Text h2>Hi!</Text>
</section>
);
};

export default TradePage;
3 changes: 1 addition & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
3 changes: 2 additions & 1 deletion src/utils/routes/pages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export enum PagePath {
Explore = '/v2',
Home = '/v2',
Explore = '/v2/explore',
Trade = '/v2/trade',
Inspect = '/v2/inspect',
Portfolio = '/v2/portfolio',
Expand Down

0 comments on commit 846a42a

Please sign in to comment.