Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit ad55ba3

Browse files
committed
Refactor form to use Text atom
1 parent 015a457 commit ad55ba3

File tree

1 file changed

+5
-33
lines changed

1 file changed

+5
-33
lines changed

pages/blog/[[...slug]].js

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import postComment from '@/api/frontend/wp/comments/postComment'
77
import getPagePropTypes from '@/functions/getPagePropTypes'
88
import Blocks from '@/components/molecules/Blocks'
99
import Form from '@/components/molecules/Form'
10-
import {Field, ErrorMessage} from 'formik'
10+
import Text from '@/components/atoms/Inputs/Text'
1111
import * as Yup from 'yup'
1212

1313
// Define route post type.
@@ -94,38 +94,10 @@ export default function BlogPost({post, archive, posts, pagination}) {
9494
setSubmitting(false)
9595
}}
9696
>
97-
<label htmlFor="author">Author</label>
98-
<Field
99-
id="author"
100-
name="author"
101-
placeholder="Test Testerson"
102-
type="text"
103-
/>
104-
<ErrorMessage name="author" />
105-
<label htmlFor="authorEmail">Email</label>
106-
<Field
107-
id="authorEmail"
108-
name="authorEmail"
109-
placeholder="[email protected]"
110-
type="email"
111-
/>
112-
<ErrorMessage name="authorEmail" />
113-
<label htmlFor="authorUrl">Website</label>
114-
<Field
115-
id="authorUrl"
116-
name="authorUrl"
117-
placeholder="https://nextjswp.local"
118-
type="url"
119-
/>
120-
<ErrorMessage name="authorUrl" />
121-
<label htmlFor="content">Comment</label>
122-
<Field
123-
id="content"
124-
name="content"
125-
placeholder="This is a test comment"
126-
type="textarea"
127-
/>
128-
<ErrorMessage name="content" />
97+
<Text id="author" label="Author" isRequired type="text" />
98+
<Text id="authorEmail" label="Email" isRequired type="email" />
99+
<Text id="authorUrl" label="Website" type="url" />
100+
<Text id="content" label="Comment" isRequired type="text" />
129101
</Form>
130102
</article>
131103
</Layout>

0 commit comments

Comments
 (0)