-
Notifications
You must be signed in to change notification settings - Fork 134
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
Our project with my teamate : Heleneabrahamsson & Sherrydev11 #87
Open
smily342
wants to merge
11
commits into
Technigo:main
Choose a base branch
from
smily342:main
base: main
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 all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2a0a6cd
Commit before merging other branches
smily342 812beba
Co-authored-by: Sherry <[email protected]>
smily342 c275214
Add QuestionTwo component
smily342 602f9a2
merged push
smily342 6862640
mispelling
smily342 f18a835
test
smily342 f6debe7
stepback
smily342 eb2876b
Temporarily renamed summary.jsx
smily342 66b84cf
Renamed summary.jsx to Summary.jsx
smily342 8eeb15c
netlify link
smily342 1f9cfc0
requested changes
smily342 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
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
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
## Netlify link | ||
|
||
Add your Netlify link here. | ||
PS. Don't forget to add it in your readme as well. | ||
https://courageous-dieffenbachia-5268df.netlify.app/ | ||
|
||
## Collaborators | ||
|
||
Add any collaborators here, as well as in the title of the PR. | ||
https://github.com/Heleneabrahamsson | ||
https://github.com/Sherrydev11 |
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 |
---|---|---|
@@ -1,3 +1,43 @@ | ||
import { useState } from 'react'; | ||
import { QuestionOne } from "./components/QuestionOne.jsx"; | ||
import { QuestionTwo } from "./components/QuestionTwo.jsx"; | ||
import { QuestionThree } from "./components/QuestionThree.jsx"; | ||
import Summary from './components/Summary.jsx'; | ||
|
||
export const App = () => { | ||
return <div>Find me in src/app.jsx!</div>; | ||
|
||
const [weatherPreference, setWeatherPreference] = useState(""); | ||
const [travelActivity, setTravelActivity] = useState(""); | ||
const [questionThree, setQuestionThree] = useState(""); | ||
const [showSummary, setShowSummary] = useState(false); | ||
|
||
const handleSubmit = (event) => { | ||
event.preventDefault(); | ||
setShowSummary(true); | ||
}; | ||
|
||
return ( | ||
<div className="header-container"> | ||
<header> | ||
<h1>Travel Preferences Survey</h1> | ||
</header> | ||
|
||
{showSummary ? ( | ||
<Summary | ||
weatherPreference={weatherPreference} | ||
travelActivity={travelActivity} | ||
questionThree={questionThree} | ||
/> | ||
) : ( | ||
<form onSubmit={handleSubmit}> | ||
<QuestionOne setWeatherPreference={setWeatherPreference} /> | ||
<QuestionTwo travelActivity={travelActivity} setTravelActivity={setTravelActivity} /> | ||
<QuestionThree travelCompanion={questionThree} setTravelCompanion={setQuestionThree} /> {/* Corrected */} | ||
<button type="submit">Submit Survey!</button> | ||
</form> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default App; |
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,33 @@ | ||
import React from "react"; | ||
|
||
export const QuestionOne = ({ setWeatherPreference }) => { | ||
const handleChange = (event) => { | ||
setWeatherPreference(event.target.value); | ||
}; | ||
|
||
return ( | ||
<div className="QuestionOne"> | ||
<h2>Do you enjoy warm or cold weather when you are on vacation?</h2> | ||
<label> | ||
<input | ||
className="radio-button1" | ||
type="radio" | ||
value="warm" | ||
onChange={handleChange} | ||
/> | ||
warm | ||
</label> | ||
|
||
<label> | ||
<input | ||
className="radio-button2" | ||
type="radio" | ||
value="cold" | ||
onChange={handleChange} | ||
/> | ||
cold | ||
</label> | ||
</div> | ||
); | ||
}; | ||
|
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,60 @@ | ||
import { useState } from 'react'; | ||
|
||
export const QuestionThree = ({ travelCompanion, setTravelCompanion }) => { | ||
const handleInputChange = (event) => { | ||
setTravelCompanion(event.target.value); | ||
}; | ||
|
||
return ( | ||
<div className="QuestionThree"> | ||
<h2>Who do you usually prefer to travel with?</h2> | ||
<label> | ||
<input | ||
type="radio" | ||
name="travelCompanion" | ||
value="Family" | ||
checked={travelCompanion === "Family"} | ||
onChange={handleInputChange} | ||
/> | ||
Family – I love family trips with kids or relatives. | ||
</label> | ||
<br /> | ||
<br /> | ||
<label> | ||
<input | ||
type="radio" | ||
name="travelCompanion" | ||
value="Friends" | ||
checked={travelCompanion === "Friends"} | ||
onChange={handleInputChange} | ||
/> | ||
Friends – Adventures are more fun with friends. | ||
</label> | ||
<br /> | ||
<br /> | ||
<label className="OptionThree"> | ||
<input | ||
type="radio" | ||
name="travelCompanion" | ||
value="Solo" | ||
checked={travelCompanion === "Solo"} | ||
onChange={handleInputChange} | ||
/> | ||
Solo – I enjoy discovering new places on my own. | ||
</label> | ||
<br /> | ||
<br /> | ||
<label className="OptionFour"> | ||
<input | ||
type="radio" | ||
name="travelCompanion" | ||
value="Partner" | ||
checked={travelCompanion === "Partner"} | ||
onChange={handleInputChange} | ||
/> | ||
Partner – A romantic getaway is always ideal. | ||
</label> | ||
</div> | ||
); | ||
}; | ||
|
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,21 @@ | ||
import React from "react"; | ||
|
||
export const QuestionTwo = ({ travelActivity, setTravelActivity }) => { | ||
return ( | ||
<div className="QuestionTwo"> | ||
<label> | ||
<h2>What kind of activities excite you the most while traveling?</h2> | ||
<select | ||
value={travelActivity || ""} | ||
onChange={event => setTravelActivity(event.target.value)} | ||
> | ||
<option value="" disabled>Select an activity</option> | ||
<option value="Relaxing by the beach or pool">Relaxing by the beach or pool</option> | ||
<option value="Hiking through mountains or forests">Hiking through mountains or forests</option> | ||
<option value="Exploring historic cities and museums">Exploring historic cities and museums</option> | ||
<option value="Trying adventure sports like surfing or ziplining">Trying adventure sports like surfing or ziplining</option> | ||
</select> | ||
</label> | ||
</div> | ||
) | ||
}; |
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,12 @@ | ||
const Summary = ({ weatherPreference, travelActivity, questionThree }) => { | ||
return ( | ||
<div className="summary-section"> | ||
<h2>Survey Summary</h2> | ||
<p><strong>Weather Preference:</strong> {weatherPreference}</p> | ||
<p><strong>Favorite Travel Activity:</strong> {travelActivity}</p> | ||
<p><strong>Preferred Travel Companion:</strong> {questionThree}</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Summary; |
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
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
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.
⭐