Allow for new parts to be created

This commit is contained in:
Kurt Hutten
2020-11-08 18:39:56 +11:00
parent 8107c7dcea
commit 8fa017beed
10 changed files with 78 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
import { useAuth } from '@redwoodjs/auth'
import MainLayout from 'src/layouts/MainLayout'
import Part2Cell from 'src/components/Part2Cell'
const NewPart2Page = ({userName}) => {
const { currentUser } = useAuth()
return (
<MainLayout>
<Part2Cell
userName={userName}
currentUserId={currentUser?.sub}
isEditable
/>
</MainLayout>
)
}
export default NewPart2Page

View File

@@ -0,0 +1,7 @@
import NewPart2Page from './NewPart2Page'
export const generated = () => {
return <NewPart2Page />
}
export default { title: 'Pages/NewPart2Page' }

View File

@@ -0,0 +1,11 @@
import { render } from '@redwoodjs/testing'
import NewPart2Page from './NewPart2Page'
describe('NewPart2Page', () => {
it('renders successfully', () => {
expect(() => {
render(<NewPart2Page />)
}).not.toThrow()
})
})