Skip to content
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
wants to merge 26 commits into
base: master
Choose a base branch
from
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 Mar 14, 2023
3c81e11
fixing some ESlint-objections
SandraMadeleine Mar 14, 2023
3ac8e59
minor changes
SandraMadeleine Mar 14, 2023
20964d0
working on the survey in different components
SandraMadeleine Mar 15, 2023
ea81975
buildning the page
SandraMadeleine Mar 15, 2023
00a249c
working on the survey build
SandraMadeleine Mar 15, 2023
65733d5
adding to app.js
SandraMadeleine Mar 16, 2023
ecc1217
fixing components
SandraMadeleine Mar 16, 2023
b05160f
fixes
SandraMadeleine Mar 16, 2023
8e1c190
fixed imports
SandraMadeleine Mar 17, 2023
1d9c1e6
final fixes on survey steps
SandraMadeleine Mar 17, 2023
7b38d31
working on styling
SandraMadeleine Mar 17, 2023
dd16219
continued styling
SandraMadeleine Mar 17, 2023
3618a1f
continued styling
SandraMadeleine Mar 19, 2023
5527881
css and emojis
SandraMadeleine Mar 19, 2023
166c27b
media queries
SandraMadeleine Mar 19, 2023
142247f
finalizing layout
SandraMadeleine Mar 19, 2023
d870236
last touches
SandraMadeleine Mar 19, 2023
589c5c8
readme updated
SandraMadeleine Mar 19, 2023
f3c9ad3
switched places of imports in app.js
SandraMadeleine Mar 19, 2023
9b5e7a6
fixed typo
SandraMadeleine Mar 19, 2023
a893e34
disable eslint in app.js in hope of being able to deploy
SandraMadeleine Mar 21, 2023
2b14d3d
deleted App.js
SandraMadeleine Mar 21, 2023
3627cd4
Added App.js back again
SandraMadeleine Mar 21, 2023
c7021d5
trying to fix case sensitivity
SandraMadeleine Mar 21, 2023
dcada88
add netlify link
SandraMadeleine Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
working on the survey in different components
SandraMadeleine committed Mar 15, 2023
commit 20964d0a348ce82aaa70d98805452ce411f74c53
10 changes: 7 additions & 3 deletions code/src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React, { useState } from 'react';
import Start from './Components/start'
import Purchase from './Components/purchase'

export const App = () => {
const [step, setStep] = useState(1);
const [step, setStep] = useState(1)

const [purchase, setPurchase] = useState('')
return (
<div className="outer-wrapper">
<div className="inner-wrapper">
<div className="outer-part">
<div className="inner-part">
Find me in src/app.js!
</div>
</div>
28 changes: 28 additions & 0 deletions code/src/Components/FreeText.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react'

const FreeText = ({ headline, input, setInput, inputLabel, id, placeholder, htmlFor }) => {
const handleInputChange = (event) => {
setInput(event.target.value)
}

return (
<>
<h2>{headline}</h2>
<form>
<label htmlFor={htmlFor}>
<p>{inputLabel}</p>
</label>
<textarea
type="text"
id={id}
className="text-input"
placeholder={placeholder}
aria-live="polite"
onChange={handleInputChange}
value={input} />
</form>
</>
)
}

export default FreeText
1 change: 1 addition & 0 deletions code/src/Components/Missing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import React from 'react'
31 changes: 31 additions & 0 deletions code/src/Components/Subscription.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-disable jsx-a11y/label-has-associated-control */
import React from 'react'

const Subscription = ({ subscription, setSubscription }) => {
const handleSubscriptionChange = (event) => {
setSubscription(event.target.value)
}

return (
<div>
<form>
<label htmlFor="active-subscription">
<h2>Do you have an active subscription at any cafe?</h2>
</label>
<select
onChange={handleSubscriptionChange}
value={subscription}
className="select-subscription"
aria-live="polite">

<option style={{ display: "none" }}>Select your answer here</option>
<option lang="en" label="Yes" value="Yes">Yes</option>
<option lang="en" label="No" value="No">No</option>
<option lang="en" label="Soon" value="Soon">I will have one soon</option>
</select>
</form>
</div>
);
}

export default Subscription
5 changes: 3 additions & 2 deletions code/src/Components/purchase.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable jsx-a11y/label-has-associated-control */
import React from 'react'

const Purchases = ['1-2', '3-5', '6-10', '10+']
@@ -10,10 +11,10 @@ const PurchaseQuestion = ({ purchase, setPurchase }) => {

return (
<>
<h2>How often per week do you purchase something to drink in a cafei?</h2>
<h2>How often per week do you purchase something to drink in a cafe?</h2>
<form className="radio-buttons" id="radio-buttons">
{Purchases.map(group => (
<label key ={group}>
<label key={group}>
<input
type="radio"
className="radio-button"