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
|
||||
@ -1,26 +1,14 @@
|
||||
// import { Link, routes } from '@redwoodjs/router'
|
||||
import { Link } from '@redwoodjs/router'
|
||||
import { Metadata } from '@redwoodjs/web'
|
||||
|
||||
import { useAuth } from 'src/auth'
|
||||
import Hero from 'src/components/Hero'
|
||||
|
||||
const HomePage = () => {
|
||||
const user = useAuth()
|
||||
|
||||
return (
|
||||
<>
|
||||
<Metadata title="Home" description="Home page" />
|
||||
|
||||
<h1>HomePage</h1>
|
||||
<p>
|
||||
Find me in <code>./web/src/pages/HomePage/HomePage.tsx</code>
|
||||
</p>
|
||||
{/*
|
||||
My default route is named `home`, link to me with:
|
||||
`<Link to={routes.home()}>Home</Link>`
|
||||
*/}
|
||||
{user && user.isAuthenticated + ' ' + user.hasRole('admin')}
|
||||
<Link to={'/login'}>Login</Link>
|
||||
<Hero />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
Submit,
|
||||
FieldError,
|
||||
} from '@redwoodjs/forms'
|
||||
import { Link, navigate, routes } from '@redwoodjs/router'
|
||||
import { navigate, routes } from '@redwoodjs/router'
|
||||
import { Metadata } from '@redwoodjs/web'
|
||||
import { toast, Toaster } from '@redwoodjs/web/toast'
|
||||
|
||||
@ -101,12 +101,12 @@ const LoginPage = () => {
|
||||
/>
|
||||
|
||||
<div className="rw-forgot-link">
|
||||
<Link
|
||||
{/* <Link
|
||||
to={routes.forgotPassword()}
|
||||
className="rw-forgot-link"
|
||||
>
|
||||
Forgot Password?
|
||||
</Link>
|
||||
</Link> */}
|
||||
</div>
|
||||
|
||||
<FieldError name="password" className="rw-field-error" />
|
||||
@ -120,9 +120,9 @@ const LoginPage = () => {
|
||||
</div>
|
||||
<div className="rw-login-link">
|
||||
<span>Don't have an account?</span>{' '}
|
||||
<Link to={routes.signup()} className="rw-link">
|
||||
{/* <Link to={routes.signup()} className="rw-link">
|
||||
Sign up!
|
||||
</Link>
|
||||
</Link> */}
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
import EditNachhilfeangebotCell from 'src/components/Nachhilfeangebot/EditNachhilfeangebotCell'
|
||||
|
||||
type NachhilfeangebotPageProps = {
|
||||
id: number
|
||||
}
|
||||
|
||||
const EditNachhilfeangebotPage = ({ id }: NachhilfeangebotPageProps) => {
|
||||
return <EditNachhilfeangebotCell id={id} />
|
||||
}
|
||||
|
||||
export default EditNachhilfeangebotPage
|
||||
@ -0,0 +1,11 @@
|
||||
import NachhilfeangebotCell from 'src/components/Nachhilfeangebot/NachhilfeangebotCell'
|
||||
|
||||
type NachhilfeangebotPageProps = {
|
||||
id: number
|
||||
}
|
||||
|
||||
const NachhilfeangebotPage = ({ id }: NachhilfeangebotPageProps) => {
|
||||
return <NachhilfeangebotCell id={id} />
|
||||
}
|
||||
|
||||
export default NachhilfeangebotPage
|
||||
@ -0,0 +1,7 @@
|
||||
import NachhilfeangebotsCell from 'src/components/Nachhilfeangebot/NachhilfeangebotsCell'
|
||||
|
||||
const NachhilfeangebotsPage = () => {
|
||||
return <NachhilfeangebotsCell />
|
||||
}
|
||||
|
||||
export default NachhilfeangebotsPage
|
||||
@ -0,0 +1,7 @@
|
||||
import NewNachhilfeangebot from 'src/components/Nachhilfeangebot/NewNachhilfeangebot'
|
||||
|
||||
const NewNachhilfeangebotPage = () => {
|
||||
return <NewNachhilfeangebot />
|
||||
}
|
||||
|
||||
export default NewNachhilfeangebotPage
|
||||
Reference in New Issue
Block a user