New: Hero Page und Navigation
This commit is contained in:
13
web/src/pages/DashboardPage/DashboardPage.stories.tsx
Normal file
13
web/src/pages/DashboardPage/DashboardPage.stories.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react'
|
||||
|
||||
import DashboardPage from './DashboardPage'
|
||||
|
||||
const meta: Meta<typeof DashboardPage> = {
|
||||
component: DashboardPage,
|
||||
}
|
||||
|
||||
export default meta
|
||||
|
||||
type Story = StoryObj<typeof DashboardPage>
|
||||
|
||||
export const Primary: Story = {}
|
||||
14
web/src/pages/DashboardPage/DashboardPage.test.tsx
Normal file
14
web/src/pages/DashboardPage/DashboardPage.test.tsx
Normal file
@ -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(<DashboardPage />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
21
web/src/pages/DashboardPage/DashboardPage.tsx
Normal file
21
web/src/pages/DashboardPage/DashboardPage.tsx
Normal file
@ -0,0 +1,21 @@
|
||||
// import { Link, routes } from '@redwoodjs/router'
|
||||
import { Metadata } from '@redwoodjs/web'
|
||||
|
||||
import { useAuth } from 'src/auth'
|
||||
|
||||
const DashboardPage = () => {
|
||||
const { currentUser } = useAuth()
|
||||
return (
|
||||
<>
|
||||
<Metadata title="Dashboard" description="Dashboard page" />
|
||||
|
||||
<div className="mx-8 my-8">
|
||||
<h1 className="text-2xl">
|
||||
Hello {currentUser.firstName} {currentUser.lastName}
|
||||
</h1>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default DashboardPage
|
||||
Reference in New Issue
Block a user