diff --git a/README.md b/README.md index 50e5933d0..cc958e4bb 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # Survey form with React -Replace this readme with your own information about your project. - -Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. +A survey made in React, using different types of forms and summarizing the answers in the final step. ## The problem -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? +The major hurdle while constructing this survey was to place everything correctly on the page. If I had more time I would place the buttons better and would also add some sort of counter, so that the respondent can see how many steps they have completed and how many steps are left. ## View it live -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. +https://at-the-cafe-survey.netlify.app/ diff --git a/bash.exe.stackdump b/bash.exe.stackdump new file mode 100644 index 000000000..653aaf64e --- /dev/null +++ b/bash.exe.stackdump @@ -0,0 +1,16 @@ +Stack trace: +Frame Function Args +000FFFFCD30 00210062B0E (0021028A770, 00210275E51, 00000000001, 000FFFFB710) +000FFFFCD30 0021004846A (00210000000, 00200000000, 00000000000, 00000000001) +000FFFFCD30 002100484A2 (000006D0000, 000006D0101, 00000000001, CC19CA85FF21) +000FFFFCD30 0021006E496 (00210045323, 00210358BC0, 00000000000, 0000000000D) +000FFFFCD30 0021006E4A9 (00210045170, 0021023D7E0, 002100448F2, 000FFFFC910) +000FFFFCD30 00210070DE4 (00000000013, 00000000001, 000FFFFC910, 00210278640) +000FFFFCD30 0021005AB65 (000FFFFCA60, 00000000000, 000FFFFCA68, 000FFFFFFFF) +000FFFFCD30 0021005B335 (00210358550, 00000000000, 000FFFFCD30, 00000100201) +000FFFFCD30 0021005B847 (002100DF73E, 00000000000, 00000000000, 00000000000) +000FFFFCD30 0021005BB86 (00000000000, 000FFFFCD30, FFFFFFFFFFFFFFC6, 00000000000) +000FFFFCD30 00210048C0C (00000000000, 00000000000, 00000000000, 00000000000) +000FFFFFFF0 00210047716 (00000000000, 00000000000, 00000000000, 00000000000) +000FFFFFFF0 002100477C4 (00000000000, 00000000000, 00000000000, 00000000000) +End of stack trace 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/icon-notepad.png b/code/public/icon-notepad.png new file mode 100644 index 000000000..d42df71e5 Binary files /dev/null and b/code/public/icon-notepad.png differ diff --git a/code/public/index.html b/code/public/index.html index e6730aa66..efb1b1f4a 100644 --- a/code/public/index.html +++ b/code/public/index.html @@ -13,7 +13,11 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - Technigo React App + Survey project + + + + diff --git a/code/src/App.js b/code/src/App.js index f2007d229..d0b1f9c1f 100644 --- a/code/src/App.js +++ b/code/src/App.js @@ -1,9 +1,106 @@ -import React from 'react'; +import React, { useState } from 'react'; +import Start from './components/Start'; +import Subscription from './components/Subscription'; +import Purchase from './components/Purchase'; +import FreeText from './components/FreeText'; +import Conclusion from './components/Conclusion'; +import Footer from './components/Footer'; +import './index.css' export const App = () => { + const [step, setStep] = useState(1) + const [purchase, setPurchase] = useState('') + const [subscriptionQ, setSubscriptionQ] = useState('') + const [often, setOften] = useState('') + const [missing, setMissing] = useState('') + + const handleStepIncrease = () => { + setStep(step + 1) + } + + const handleStepDecrease = () => { + setStep(step - 1) + } + + const handleStepRestart = () => { + setStep(1) + } + return ( -
- Find me in src/app.js! -
+ <> +
+
+ {step === 1 && ( +
+ + +
+ )} + + {step === 2 && ( + + )} + + {step === 3 && ( + + )} + + {step === 4 && ( +
+ +
+ )} + + {step === 5 && ( +
+ +
+ )} + + {step === 6 && ( +
+ +
+ )} + + {step > 1 && step < 6 && ( +
+ +
+ )} + + {step > 2 && step < 6 && ( +
+ +
+ )} + + {step > 1 && step <= 6 && ( +
+ +
+ )} +
+
+