diff --git a/QandA/.vs/QandA/DesignTimeBuild/.dtbcache.v2 b/QandA/.vs/QandA/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000..b8737e9 Binary files /dev/null and b/QandA/.vs/QandA/DesignTimeBuild/.dtbcache.v2 differ diff --git a/QandA/.vs/QandA/v16/.suo b/QandA/.vs/QandA/v16/.suo index c820f76..5a85a69 100644 Binary files a/QandA/.vs/QandA/v16/.suo and b/QandA/.vs/QandA/v16/.suo differ diff --git a/QandA/frontend/.idea/.gitignore b/QandA/frontend/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/QandA/frontend/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/QandA/frontend/.idea/codeStyles/Project.xml b/QandA/frontend/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7ba3bc0 --- /dev/null +++ b/QandA/frontend/.idea/codeStyles/Project.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/QandA/frontend/.idea/codeStyles/codeStyleConfig.xml b/QandA/frontend/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/QandA/frontend/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/QandA/frontend/.idea/frontend.iml b/QandA/frontend/.idea/frontend.iml new file mode 100644 index 0000000..0c8867d --- /dev/null +++ b/QandA/frontend/.idea/frontend.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/QandA/frontend/.idea/inspectionProfiles/Project_Default.xml b/QandA/frontend/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/QandA/frontend/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/QandA/frontend/.idea/modules.xml b/QandA/frontend/.idea/modules.xml new file mode 100644 index 0000000..f3d93d7 --- /dev/null +++ b/QandA/frontend/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/QandA/frontend/.idea/vcs.xml b/QandA/frontend/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/QandA/frontend/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/QandA/frontend/src/AskPage.tsx b/QandA/frontend/src/AskPage.tsx index 5e954e3..500d8e4 100644 --- a/QandA/frontend/src/AskPage.tsx +++ b/QandA/frontend/src/AskPage.tsx @@ -10,6 +10,7 @@ import { FieldTextArea, FormButtonContainer, PrimaryButton, + FieldError, } from './Styles'; type FormData = { @@ -18,7 +19,9 @@ type FormData = { }; export const AskPage = () => { - const { register } = useForm(); + const { register, errors } = useForm({ + mode: 'onBlur', + }); return (
@@ -26,11 +29,20 @@ export const AskPage = () => { Title + {errors.title && errors.title.type === 'required' && ( + You must enter the question title + )} + {errors.title && errors.title.type === 'minLength' && ( + The title must be at least 10 characters + )} Content