Skip to content

Commit

Permalink
Implement page component
Browse files Browse the repository at this point in the history
Added new route, updated route paths
  • Loading branch information
kpyszkowski committed Apr 18, 2024
1 parent 5256712 commit fb180ef
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dapp/src/pages/ActivityPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Flex, Link as ChakraLink, Icon } from "@chakra-ui/react"

import { Link as ReactRouterLink } from "react-router-dom"
import { useSidebar } from "#/hooks"
import { routerPath } from "#/router/path"
import { ArrowLeft } from "#/assets/icons"
import ActivityDetails from "./ActivityDetails"
import { ActivityBar } from "./ActivityBar"
Expand All @@ -17,7 +18,7 @@ export default function ActivityPage() {

return (
<Flex direction="column" gap={4} p={6}>
<ChakraLink as={ReactRouterLink} to="/">
<ChakraLink as={ReactRouterLink} to={routerPath.overview}>
<Icon
as={ArrowLeft}
boxSize={8}
Expand Down
10 changes: 10 additions & 0 deletions dapp/src/pages/LandingPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react"
import { Flex } from "@chakra-ui/react"

export default function LandingPage() {
return (
<Flex w="full" flexFlow="column" px={10}>
Content
</Flex>
)
}
5 changes: 5 additions & 0 deletions dapp/src/router/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import React from "react"
import { createBrowserRouter } from "react-router-dom"
import LandingPage from "#/pages/LandingPage"
import OverviewPage from "#/pages/OverviewPage"
import ActivityPage from "#/pages/ActivityPage"
import { routerPath } from "./path"

export const router = createBrowserRouter([
{
path: routerPath.home,
element: <LandingPage />,
},
{
path: routerPath.overview,
element: <OverviewPage />,
},
{
Expand Down
1 change: 1 addition & 0 deletions dapp/src/router/path.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const routerPath = {
home: "/",
overview: "/overview",
activity: "/activity-details",
}

0 comments on commit fb180ef

Please sign in to comment.