From fc7b885f28cd2105ead1cb74598a95121d32fdcc Mon Sep 17 00:00:00 2001 From: Aditya Sridhar Date: Thu, 30 Nov 2023 10:53:20 -0500 Subject: [PATCH] feat: adds a dashboard page --- web/src/Routes.tsx | 1 + .../DashboardPage/DashboardPage.stories.tsx | 13 ++++++++++++ .../DashboardPage/DashboardPage.test.tsx | 14 +++++++++++++ web/src/pages/DashboardPage/DashboardPage.tsx | 21 +++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 web/src/pages/DashboardPage/DashboardPage.stories.tsx create mode 100644 web/src/pages/DashboardPage/DashboardPage.test.tsx create mode 100644 web/src/pages/DashboardPage/DashboardPage.tsx diff --git a/web/src/Routes.tsx b/web/src/Routes.tsx index 2c8f02ab..3a20281c 100644 --- a/web/src/Routes.tsx +++ b/web/src/Routes.tsx @@ -12,6 +12,7 @@ import { Router, Route } from '@redwoodjs/router' const Routes = () => { return ( + ) diff --git a/web/src/pages/DashboardPage/DashboardPage.stories.tsx b/web/src/pages/DashboardPage/DashboardPage.stories.tsx new file mode 100644 index 00000000..af6a7a4d --- /dev/null +++ b/web/src/pages/DashboardPage/DashboardPage.stories.tsx @@ -0,0 +1,13 @@ +import type { Meta, StoryObj } from '@storybook/react' + +import DashboardPage from './DashboardPage' + +const meta: Meta = { + component: DashboardPage, +} + +export default meta + +type Story = StoryObj + +export const Primary: Story = {} diff --git a/web/src/pages/DashboardPage/DashboardPage.test.tsx b/web/src/pages/DashboardPage/DashboardPage.test.tsx new file mode 100644 index 00000000..b6d9d375 --- /dev/null +++ b/web/src/pages/DashboardPage/DashboardPage.test.tsx @@ -0,0 +1,14 @@ +import { render } from '@redwoodjs/testing/web' + +import DashboardPage from './DashboardPage' + +// Improve this test with help from the Redwood Testing Doc: +// https://redwoodjs.com/docs/testing#testing-pages-layouts + +describe('DashboardPage', () => { + it('renders successfully', () => { + expect(() => { + render() + }).not.toThrow() + }) +}) diff --git a/web/src/pages/DashboardPage/DashboardPage.tsx b/web/src/pages/DashboardPage/DashboardPage.tsx new file mode 100644 index 00000000..85899016 --- /dev/null +++ b/web/src/pages/DashboardPage/DashboardPage.tsx @@ -0,0 +1,21 @@ +import { Link, routes } from '@redwoodjs/router' +import { MetaTags } from '@redwoodjs/web' + +const DashboardPage = () => { + return ( + <> + + +

DashboardPage

+

+ Find me in ./web/src/pages/DashboardPage/DashboardPage.tsx +

+

+ My default route is named dashboard, link to me with ` + Dashboard` +

+ + ) +} + +export default DashboardPage