@@ -1,7 +0,0 @@
|
||||
import EditPart2Page from './EditPart2Page'
|
||||
|
||||
export const generated = () => {
|
||||
return <EditPart2Page />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/EditPart2Page' }
|
||||
@@ -1,16 +1,16 @@
|
||||
import { useAuth } from '@redwoodjs/auth'
|
||||
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import Part2Cell from 'src/components/Part2Cell'
|
||||
import PartCell from 'src/components/PartCell'
|
||||
import Seo from 'src/components/Seo/Seo'
|
||||
|
||||
const EditPart2Page = ({ userName, partTitle }) => {
|
||||
const EditPartPage = ({ userName, partTitle }) => {
|
||||
const { currentUser } = useAuth()
|
||||
return (
|
||||
<MainLayout>
|
||||
<Seo title={partTitle} description="Edit part page" lang="en-US" />
|
||||
|
||||
<Part2Cell
|
||||
<PartCell
|
||||
userName={userName}
|
||||
partTitle={partTitle}
|
||||
currentUserId={currentUser?.sub}
|
||||
@@ -20,4 +20,4 @@ const EditPart2Page = ({ userName, partTitle }) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default EditPart2Page
|
||||
export default EditPartPage
|
||||
7
web/src/pages/EditPartPage/EditPartPage.stories.js
Normal file
7
web/src/pages/EditPartPage/EditPartPage.stories.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import EditPartPage from './EditPartPage'
|
||||
|
||||
export const generated = () => {
|
||||
return <EditPartPage />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/EditPartPage' }
|
||||
@@ -1,11 +1,11 @@
|
||||
import { render } from '@redwoodjs/testing'
|
||||
|
||||
import NewPart2Page from './NewPart2Page'
|
||||
import EditPartPage from './EditPartPage'
|
||||
|
||||
describe('NewPart2Page', () => {
|
||||
describe('EditPartPage', () => {
|
||||
it('renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<NewPart2Page />)
|
||||
render(<EditPartPage />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import EditUser2Cell from 'src/components/EditUser2Cell'
|
||||
import EditUserCell from 'src/components/EditUserCell'
|
||||
import Seo from 'src/components/Seo/Seo'
|
||||
|
||||
const UserPage = ({ userName }) => {
|
||||
@@ -7,7 +7,7 @@ const UserPage = ({ userName }) => {
|
||||
<MainLayout>
|
||||
<Seo title={userName} description="Add new part page" lang="en-US" />
|
||||
|
||||
<EditUser2Cell userName={userName} />
|
||||
<EditUserCell userName={userName} />
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import NewPart2Page from './NewPart2Page'
|
||||
|
||||
export const generated = () => {
|
||||
return <NewPart2Page />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/NewPart2Page' }
|
||||
@@ -3,10 +3,10 @@ import { useAuth } from '@redwoodjs/auth'
|
||||
import { navigate, routes } from '@redwoodjs/router'
|
||||
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import Part2Cell from 'src/components/Part2Cell'
|
||||
import PartCell from 'src/components/PartCell'
|
||||
import Seo from 'src/components/Seo/Seo'
|
||||
|
||||
const NewPart2Page = ({ userName }) => {
|
||||
const NewPartPage = ({ userName }) => {
|
||||
const { isAuthenticated, currentUser } = useAuth()
|
||||
useEffect(() => {
|
||||
!isAuthenticated && navigate(routes.home())
|
||||
@@ -15,7 +15,7 @@ const NewPart2Page = ({ userName }) => {
|
||||
<MainLayout>
|
||||
<Seo title="New part" description="Add new part page" lang="en-US" />
|
||||
|
||||
<Part2Cell
|
||||
<PartCell
|
||||
userName={userName}
|
||||
currentUserId={currentUser?.sub}
|
||||
isEditable
|
||||
@@ -24,4 +24,4 @@ const NewPart2Page = ({ userName }) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default NewPart2Page
|
||||
export default NewPartPage
|
||||
7
web/src/pages/NewPartPage/NewPartPage.stories.js
Normal file
7
web/src/pages/NewPartPage/NewPartPage.stories.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import NewPartPage from './NewPartPage'
|
||||
|
||||
export const generated = () => {
|
||||
return <NewPartPage />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/NewPartPage' }
|
||||
@@ -1,11 +1,11 @@
|
||||
import { render } from '@redwoodjs/testing'
|
||||
|
||||
import EditPart2Page from './EditPart2Page'
|
||||
import NewPartPage from './NewPartPage'
|
||||
|
||||
describe('EditPart2Page', () => {
|
||||
describe('NewPartPage', () => {
|
||||
it('renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<EditPart2Page />)
|
||||
render(<NewPartPage />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
@@ -1,7 +0,0 @@
|
||||
import Part2Page from './Part2Page'
|
||||
|
||||
export const generated = () => {
|
||||
return <Part2Page />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/Part2Page' }
|
||||
@@ -1,16 +1,16 @@
|
||||
import { useAuth } from '@redwoodjs/auth'
|
||||
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import Part2Cell from 'src/components/Part2Cell'
|
||||
import PartCell from 'src/components/PartCell'
|
||||
import Seo from 'src/components/Seo/Seo'
|
||||
|
||||
const Part2Page = ({ userName, partTitle }) => {
|
||||
const PartPage = ({ userName, partTitle }) => {
|
||||
const { currentUser } = useAuth()
|
||||
return (
|
||||
<MainLayout>
|
||||
<Seo title={partTitle} description={partTitle} lang="en-US" />
|
||||
|
||||
<Part2Cell
|
||||
<PartCell
|
||||
userName={userName}
|
||||
partTitle={partTitle}
|
||||
currentUserId={currentUser?.sub}
|
||||
@@ -19,4 +19,4 @@ const Part2Page = ({ userName, partTitle }) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default Part2Page
|
||||
export default PartPage
|
||||
7
web/src/pages/PartPage/PartPage.stories.js
Normal file
7
web/src/pages/PartPage/PartPage.stories.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import PartPage from './PartPage'
|
||||
|
||||
export const generated = () => {
|
||||
return <PartPage />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/PartPage' }
|
||||
@@ -1,11 +1,11 @@
|
||||
import { render } from '@redwoodjs/testing'
|
||||
|
||||
import Part2Page from './Part2Page'
|
||||
import PartPage from './PartPage'
|
||||
|
||||
describe('Part2Page', () => {
|
||||
describe('PartPage', () => {
|
||||
it('renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<Part2Page />)
|
||||
render(<PartPage />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import User2Cell from 'src/components/User2Cell'
|
||||
import UserCell from 'src/components/UserCell'
|
||||
import Seo from 'src/components/Seo/Seo'
|
||||
|
||||
const UserPage = ({ userName }) => {
|
||||
@@ -7,7 +7,7 @@ const UserPage = ({ userName }) => {
|
||||
<MainLayout>
|
||||
<Seo title={userName} description="User page" lang="en-US" />
|
||||
|
||||
<User2Cell userName={userName} />
|
||||
<UserCell userName={userName} />
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user