issue-148 Clean up files with "2" in them

resolves #148
This commit is contained in:
Kurt Hutten
2020-12-12 15:13:31 +11:00
parent ba0c80d91a
commit 278add82a6
31 changed files with 235 additions and 261 deletions

View File

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

View File

@@ -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

View File

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

View File

@@ -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()
})
})

View File

@@ -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>
)
}

View File

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

View File

@@ -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

View File

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

View File

@@ -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()
})
})

View File

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

View File

@@ -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

View File

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

View File

@@ -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()
})
})

View File

@@ -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>
)
}