Build this t-shirt order form: https://t-shirt-order-form.surge.sh.
Requirements
- When the form is submitted, hide the form and display a confirmation message with all of the data that was submitted. Feel free to format the submitted data however you'd like.
- If the terms and conditions checkbox is checked, you'll see a message in green. If it isn't checked, you'll see a message in red.
- A Reset button. This should reset the entire form to the default state. Don't use
<button type="reset">
or<input type="reset">
for this. Instead, add anonClick
handler to a button that changes all of the state properties back to the initial values. - For accessibility, every form control must have a
<label>
. Clicking on a label should put focus on the corresponding form control. - All form controls must be controlled components.
- Implement at least two of the following reusable components for form controls
<Select
label="Size"
value={size}
options={[
{ value: "", label: "--Select Size--" },
{ value: "small", label: "Small" },
{ value: "medium", label: "Medium" },
{ value: "large", label: "Large" },
]}
onChange={(updatedSize) => {
setSize(updatedSize);
}}
/>
<RadioButtons
name="sleeve-length"
options={[
{ value: "long", label: "Long" },
{ value: "short", label: "Short" },
{ value: "sleeveless", label: "Sleeveless" },
]}
value={sleeveLength}
onChange={(updatedSleeveLength) => {
setSleeveLength(updatedSleeveLength);
}}
/>
<Checkbox
id="terms"
label="I accept terms & conditions"
checked={isTermsChecked}
onChange={(updatedIsTermsChecked) => {
setIsTermsChecked(updatedIsTermsChecked);
}}
/>
<Textarea
label="Comments"
id="comments"
rows="3"
value={comment}
onChange={(updatedComment) => {
setComment(updatedComment);
}}
/>
Other Requirements
- You are not allowed to use any libraries. Your implementation should only use React and optionally Bootstrap.
- Your implementation must only use the techniques, patterns, and concepts that we covered in class.
- Your implementation should not have any direct DOM manipulation or have any references to
document
orwindow
. All rendering should be done by React via state changes. - There shouldn't be any console warnings or errors when running locally or when deployed to Surge.
Submission
Create a video with audio using Zoom where you demo your assignment and explain where you fulfilled or did not fulfill each requirement. Put a link to this recording in the README.md
file at the root of your project. Verify that the link to the recording works.
Also, deploy your project using Surge and include this link on your README.md
. Verify that the link works.
Submit your code: https://classroom.github.com/a/kZhg4KNi
If you're having problems uploading to GitHub, please zip up your project and email it to the instructor and TA. Be sure to exclude the node_modules
folder from your zip file. Please include the Zoom recording URL in the email. You can also zip up your project, put it in Google Drive or Dropbox, make the link sharable, and email that link to us.
Points will be deducted for the following:
- Surge link is missing or doesn't work
- Zoom link is missing or doesn't work
- You push up
node_modules
to GitHub or includenode_modules
in your zip file if you submit it via email
You will get a 0 on the assignment if:
- Code isn't pushed up to GitHub
- Code is submitted after the deadline