-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
project survey week 6 #441
Open
SandraMadeleine
wants to merge
26
commits into
Technigo:master
Choose a base branch
from
SandraMadeleine:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
87e2ac8
started with components
SandraMadeleine 3c81e11
fixing some ESlint-objections
SandraMadeleine 3ac8e59
minor changes
SandraMadeleine 20964d0
working on the survey in different components
SandraMadeleine ea81975
buildning the page
SandraMadeleine 00a249c
working on the survey build
SandraMadeleine 65733d5
adding to app.js
SandraMadeleine ecc1217
fixing components
SandraMadeleine b05160f
fixes
SandraMadeleine 8e1c190
fixed imports
SandraMadeleine 1d9c1e6
final fixes on survey steps
SandraMadeleine 7b38d31
working on styling
SandraMadeleine dd16219
continued styling
SandraMadeleine 3618a1f
continued styling
SandraMadeleine 5527881
css and emojis
SandraMadeleine 166c27b
media queries
SandraMadeleine 142247f
finalizing layout
SandraMadeleine d870236
last touches
SandraMadeleine 589c5c8
readme updated
SandraMadeleine f3c9ad3
switched places of imports in app.js
SandraMadeleine 9b5e7a6
fixed typo
SandraMadeleine a893e34
disable eslint in app.js in hope of being able to deploy
SandraMadeleine 2b14d3d
deleted App.js
SandraMadeleine 3627cd4
Added App.js back again
SandraMadeleine c7021d5
trying to fix case sensitivity
SandraMadeleine dcada88
add netlify link
SandraMadeleine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added App.js back again
- Loading branch information
commit 3627cd4720c0821bf670c362d4120c56ad84508c
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
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 ( | ||
<> | ||
<div className="outer-part"> | ||
<div className="inner-part"> | ||
{step === 1 && ( | ||
<div> | ||
<Start /> | ||
<button className="start-btn" type="button" onClick={handleStepIncrease}>Start here</button> | ||
</div> | ||
)} | ||
|
||
{step === 2 && ( | ||
<Subscription subscriptionQ={subscriptionQ} setSubscriptionQ={setSubscriptionQ} /> | ||
)} | ||
|
||
{step === 3 && ( | ||
<Purchase purchase={purchase} setPurchase={setPurchase} /> | ||
)} | ||
|
||
{step === 4 && ( | ||
<div> | ||
<FreeText | ||
headline="Favorite purchases" | ||
input={often} | ||
setInput={setOften} | ||
inputLabel="Which drink do you purchase most often when at a cafe? 💸" | ||
id="favorite-purchase" | ||
placeholder="My favorite purchase is..." | ||
htmlFor="favorite-purchase" /> | ||
</div> | ||
)} | ||
|
||
{step === 5 && ( | ||
<div> | ||
<FreeText | ||
headline="Something missing?" | ||
input={missing} | ||
setInput={setMissing} | ||
inputLabel="Is there a drink you feel is missing at most cafes? 🤔" | ||
id="missing-drink" | ||
placeholder="I would love if all cafes offered..." | ||
htmlFor="missing-drink" /> | ||
</div> | ||
)} | ||
|
||
{step === 6 && ( | ||
<div> | ||
<Conclusion | ||
subscriptionQ={subscriptionQ} | ||
purchase={purchase} | ||
often={often} | ||
missing={missing} /> | ||
</div> | ||
)} | ||
|
||
{step > 1 && step < 6 && ( | ||
<div> | ||
<button className="next-btn" type="button" onClick={handleStepIncrease}>Submit and go to next</button> | ||
</div> | ||
)} | ||
|
||
{step > 2 && step < 6 && ( | ||
<div> | ||
<button className="prev-btn" type="button" onClick={handleStepDecrease}>Previous question</button> | ||
</div> | ||
)} | ||
|
||
{step > 1 && step <= 6 && ( | ||
<div> | ||
<button className="restart-btn" type="button" onClick={handleStepRestart}>Restart the survey</button> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
<Footer /> | ||
</> | ||
); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the design of the FreeText-component, good reusability