diff --git a/README.md b/README.md index 50e5933d0..e0d5c4cd9 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,21 @@ -# Survey form with React +# Project Survey -Replace this readme with your own information about your project. +## View it live +https://zombie-survey.netlify.app/ -Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. +## Project Brief +Practice React state and controlled forms by making a Typeform-like product. Your completed project should consist of at least 3 questions that need to be answered by users. When the user presses submit, they should see a summary of their answers. -## The problem +## Project requirements -Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next? +- [x] Ideate, design and code your app. +- [x] Connect HTML form inputs to state. +- [x] Use form fields and `useState` hook in React +- [x] Use state to show different components based on where you are in the survey +- [x] There should be a submit button. When pressed your app should hide the input form and show a summary of the user's submissions. +- [x] Your site should follow accessibility guidelines -## View it live +## Installation -Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about. + npm install + npm start diff --git a/code/package-lock.json b/code/package-lock.json index e34d9bb1c..3a317936e 100644 --- a/code/package-lock.json +++ b/code/package-lock.json @@ -9,7 +9,6 @@ "version": "1.0.0", "dependencies": { "@babel/eslint-parser": "^7.18.9", - "babel-eslint": "^10.1.0", "eslint": "^8.21.0", "eslint-config-airbnb": "^19.0.4", "eslint-plugin-import": "^2.26.0", @@ -4637,34 +4636,6 @@ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==" }, - "node_modules/babel-eslint": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", - "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", - "deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0", - "eslint-visitor-keys": "^1.0.0", - "resolve": "^1.12.0" - }, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "eslint": ">= 4.12.1" - } - }, - "node_modules/babel-eslint/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "engines": { - "node": ">=4" - } - }, "node_modules/babel-jest": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.5.1.tgz", @@ -20687,26 +20658,6 @@ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==" }, - "babel-eslint": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", - "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0", - "eslint-visitor-keys": "^1.0.0", - "resolve": "^1.12.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - } - } - }, "babel-jest": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.5.1.tgz", diff --git a/code/public/Assets/githublogo.png b/code/public/Assets/githublogo.png new file mode 100644 index 000000000..9490ffc6d Binary files /dev/null and b/code/public/Assets/githublogo.png differ diff --git a/code/public/Assets/linkedinlogo.png b/code/public/Assets/linkedinlogo.png new file mode 100644 index 000000000..50aeee7c3 Binary files /dev/null and b/code/public/Assets/linkedinlogo.png differ diff --git a/code/public/Assets/sarabattilotti.jpeg b/code/public/Assets/sarabattilotti.jpeg new file mode 100644 index 000000000..ee4c5d29a Binary files /dev/null and b/code/public/Assets/sarabattilotti.jpeg differ diff --git a/code/src/App.js b/code/src/App.js index f2007d229..f5b080225 100644 --- a/code/src/App.js +++ b/code/src/App.js @@ -1,9 +1,90 @@ -import React from 'react'; +/* eslint-disable max-len */ +import React, { useState } from 'react'; +import { Greeting } from 'components/Greeting'; +import { Human } from 'components/Human'; +import { Name } from 'components/Name'; +import { Continent } from 'components/Continent'; +import { BadNews } from 'components/BadNews'; +import { Fitness } from 'components/Fitness'; +import { Combat } from 'components/Combat'; +import { Body } from 'components/Body'; +import { Summary } from 'components/Summary'; +import { Footer } from 'components/footer/Footer'; +import { Weapon } from 'components/Weapon'; +import zombie from 'components/zombie.png'; export const App = () => { - return ( -
- Find me in src/app.js! -
- ); -} + const stepsTotalCount = 9; + const [step, setStep] = useState(0); + const [human, setHuman] = useState(false); + const [name, setName] = useState(''); + const [continent, setContinent] = useState(''); + const [fitness, setFitness] = useState(0); + const [combat, setCombat] = useState(''); + const [body, setBody] = useState(''); + const [weapon, setWeapon] = useState(''); + const handleStepIncrease = () => { + setStep(step + 1); + }; + if (step < 4) { + return ( + <> +
+
+ {step === 0 && ()} + {step === 1 && ()} + {step === 2 && ()} + {step === 3 && ()} +
+ {step === 0 && ()} + {step >= 1 && step <= 8 && ()} +
+
+ {step >= 1 && step < 9 && ( +

+ + {step} of {stepsTotalCount} + + +
+ {step} / {stepsTotalCount} +
+

+ )} +
+