Wipe slate clean
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
import BlogLayout from 'src/layouts/BlogLayout'
|
||||
|
||||
const AboutPage = () => {
|
||||
return (
|
||||
<BlogLayout>
|
||||
<h1>AboutPage</h1>
|
||||
<p>
|
||||
Find me in <tt>./web/src/pages/AboutPage/AboutPage.js</tt>
|
||||
</p>
|
||||
<p>
|
||||
My default route is named <tt>about</tt>, link to me with `
|
||||
<Link to={routes.about()}>About</Link>`
|
||||
</p>
|
||||
</BlogLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default AboutPage
|
||||
@@ -1,7 +0,0 @@
|
||||
import AboutPage from './AboutPage'
|
||||
|
||||
export const generated = () => {
|
||||
return <AboutPage />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/AboutPage' }
|
||||
@@ -1,11 +0,0 @@
|
||||
import { render } from '@redwoodjs/testing'
|
||||
|
||||
import AboutPage from './AboutPage'
|
||||
|
||||
describe('AboutPage', () => {
|
||||
it('renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<AboutPage />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
@@ -1,12 +0,0 @@
|
||||
import BlogLayout from 'src/layouts/BlogLayout'
|
||||
import BlogPostCell from 'src/components/BlogPostCell'
|
||||
|
||||
const BlogPostPage = ({id}) => {
|
||||
return (
|
||||
<BlogLayout>
|
||||
<BlogPostCell id={id}/>
|
||||
</BlogLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default BlogPostPage
|
||||
@@ -1,7 +0,0 @@
|
||||
import BlogPostPage from './BlogPostPage'
|
||||
|
||||
export const generated = () => {
|
||||
return <BlogPostPage />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/BlogPostPage' }
|
||||
@@ -1,11 +0,0 @@
|
||||
import { render } from '@redwoodjs/testing'
|
||||
|
||||
import BlogPostPage from './BlogPostPage'
|
||||
|
||||
describe('BlogPostPage', () => {
|
||||
it('renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<BlogPostPage />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
@@ -1,59 +0,0 @@
|
||||
import { Form, TextField, Submit, TextAreaField, FieldError, FormError } from '@redwoodjs/forms'
|
||||
import { useMutation, Flash, useFlash } from '@redwoodjs/web'
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import { useForm } from 'react-hook-form'
|
||||
|
||||
const CREATE_CONTACT = gql`
|
||||
mutation CreateContactMutation($input: CreateContactInput!) {
|
||||
createContact(input: $input) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const ContactPage = () => {
|
||||
const formMethods = useForm()
|
||||
const { addMessage } = useFlash()
|
||||
const [create, {loading, error}] = useMutation(CREATE_CONTACT, {
|
||||
onCompleted: () => {
|
||||
addMessage('Thank you for your submission!', {
|
||||
style: { backgroundColor: 'green', color: 'white', padding: '1rem' }
|
||||
})
|
||||
formMethods.reset()
|
||||
},
|
||||
})
|
||||
const onSubmit = async (data) => {
|
||||
try {
|
||||
await create({ variables: { input: data } })
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<MainLayout>
|
||||
<Flash timeout={2000} />
|
||||
<Form onSubmit={onSubmit} validation={{ mode: 'onBlur' }} error={error} formMethods={formMethods}>
|
||||
<FormError
|
||||
error={error}
|
||||
wrapperStyle={{ color: 'red', backgroundColor: 'lavenderblush' }}
|
||||
/>
|
||||
<label htmlFor="name">Name</label>
|
||||
<TextField name="name" validation={{required: true}} errorClassName="error" />
|
||||
<FieldError name="name" className="error" />
|
||||
|
||||
<label htmlFor="email">Email</label>
|
||||
<TextField name="email" validation={{required: true}} errorClassName="error" />
|
||||
<FieldError name="email" className="error" />
|
||||
|
||||
<label htmlFor="message">Message</label>
|
||||
<TextAreaField name="message" validation={{required: true}} errorClassName="error" />
|
||||
<FieldError name="message" className="error" />
|
||||
|
||||
<Submit disabled={loading}>Save</Submit>
|
||||
</Form>
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default ContactPage
|
||||
@@ -1,7 +0,0 @@
|
||||
import ContactPage from './ContactPage'
|
||||
|
||||
export const generated = () => {
|
||||
return <ContactPage />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/ContactPage' }
|
||||
@@ -1,11 +0,0 @@
|
||||
import { render } from '@redwoodjs/testing'
|
||||
|
||||
import ContactPage from './ContactPage'
|
||||
|
||||
describe('ContactPage', () => {
|
||||
it('renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<ContactPage />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
@@ -1,12 +0,0 @@
|
||||
import EditPartCell from 'src/components/EditPartCell'
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
|
||||
const EditPartPage = ({ id }) => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<EditPartCell id={id} />
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditPartPage
|
||||
@@ -1,12 +0,0 @@
|
||||
import PostsLayout from 'src/layouts/PostsLayout'
|
||||
import EditPostCell from 'src/components/EditPostCell'
|
||||
|
||||
const EditPostPage = ({ id }) => {
|
||||
return (
|
||||
<PostsLayout>
|
||||
<EditPostCell id={id} />
|
||||
</PostsLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditPostPage
|
||||
@@ -1,12 +0,0 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import EditUserCell from 'src/components/EditUserCell'
|
||||
|
||||
const EditUserPage = ({ id }) => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<EditUserCell id={id} />
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditUserPage
|
||||
@@ -1,7 +0,0 @@
|
||||
import IdePartPage from './IdePartPage'
|
||||
|
||||
export const generated = () => {
|
||||
return <IdePartPage />
|
||||
}
|
||||
|
||||
export default { title: 'Pages/IdePartPage' }
|
||||
@@ -1,12 +0,0 @@
|
||||
import PartsLayout from 'src/layouts/PartsLayout'
|
||||
import NewPart from 'src/components/NewPart'
|
||||
|
||||
const NewPartPage = () => {
|
||||
return (
|
||||
<PartsLayout>
|
||||
<NewPart />
|
||||
</PartsLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default NewPartPage
|
||||
@@ -1,12 +0,0 @@
|
||||
import PostsLayout from 'src/layouts/PostsLayout'
|
||||
import NewPost from 'src/components/NewPost'
|
||||
|
||||
const NewPostPage = () => {
|
||||
return (
|
||||
<PostsLayout>
|
||||
<NewPost />
|
||||
</PostsLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default NewPostPage
|
||||
@@ -1,12 +0,0 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import NewUser from 'src/components/NewUser'
|
||||
|
||||
const NewUserPage = () => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<NewUser />
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default NewUserPage
|
||||
@@ -1,15 +0,0 @@
|
||||
import PartsLayout from 'src/layouts/PartsLayout'
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import PartCell from 'src/components/PartCell'
|
||||
|
||||
const PartPage = ({ id }) => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<PartsLayout>
|
||||
<PartCell id={id} />
|
||||
</PartsLayout>
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default PartPage
|
||||
@@ -1,15 +0,0 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import PartsLayout from 'src/layouts/PartsLayout'
|
||||
import PartsCell from 'src/components/PartsCell'
|
||||
|
||||
const PartsPage = () => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<PartsLayout>
|
||||
<PartsCell />
|
||||
</PartsLayout>
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default PartsPage
|
||||
@@ -1,12 +0,0 @@
|
||||
import PostsLayout from 'src/layouts/PostsLayout'
|
||||
import PostCell from 'src/components/PostCell'
|
||||
|
||||
const PostPage = ({ id }) => {
|
||||
return (
|
||||
<PostsLayout>
|
||||
<PostCell id={id} />
|
||||
</PostsLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default PostPage
|
||||
@@ -1,15 +0,0 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import PostsLayout from 'src/layouts/PostsLayout'
|
||||
import PostsCell from 'src/components/PostsCell'
|
||||
|
||||
const PostsPage = () => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<PostsLayout>
|
||||
<PostsCell />
|
||||
</PostsLayout>
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default PostsPage
|
||||
@@ -1,12 +0,0 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import UserCell from 'src/components/UserCell'
|
||||
|
||||
const UserPage = ({ id }) => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<UserCell id={id} />
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default UserPage
|
||||
@@ -1,12 +0,0 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import UsersCell from 'src/components/UsersCell'
|
||||
|
||||
const UsersPage = () => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<UsersCell />
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default UsersPage
|
||||
Reference in New Issue
Block a user