Skip to content

survey#450

Open
IrupePozoGraviz wants to merge 17 commits intoTechnigo:masterfrom
IrupePozoGraviz:master
Open

survey#450
IrupePozoGraviz wants to merge 17 commits intoTechnigo:masterfrom
IrupePozoGraviz:master

Conversation

@IrupePozoGraviz
Copy link

This was a hard week and I overcomplicated things! , needs some work if you press enter after writing your name the game restarts and its not responsive

Copy link

@camcron camcron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job this week Irro! I know it was an exhausting one. Love the cute theme and way you managed to get all of your conditionals to work in the result.
Would suggest to just look over the naming of components and classes to make it more clear for an outsider to follow along in the code.

Awesome job this week! Keep it up, you're a star!

Comment on lines +65 to +69
{(counter === 1 && !name)
|| (counter === 2 && !prefers)
|| (counter === 3 && !color)
|| (counter === 4 && !things) ? (
<p className="answer">Please answer the current question before proceeding.</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there could be either just a comment here or it could be turned into a function that explains it's purpose

@@ -0,0 +1,49 @@
import React from 'react';

export const Thing = ({ things, setThing, counterFromApp, setCounter }) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a bit difficult to understand the purpose and functionality of this component because ot it's name. Maybe it could be named something like Location, PickLocation, or FavouriteLocation.

Comment on lines +19 to +38
.StartPage{
display: grid;
grid-template-columns: 1fr;
justify-items: center;
justify-content: center;
background-color: white;
margin: 40px;
padding: 20px;
}

.start-container{
margin: 40px;
}
.start-container h1{
font-size: 40px;
padding-bottom: 20px;


}
.startBtn{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at how classes are named. It seems like they are both kebab-case, camelCase and PascalCase.


.StartPage{
display: grid;
grid-template-columns: 1fr;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this Grid needed, since it's takes up the whole page(1 fraction)?


}

.black{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a more descriptive name for the class that is being styled

Comment on lines +17 to +19
<option value="books" className="books">Books & plants 🪴📚</option>
<option value="surf" className="surf">Surf &palmtrees 🏄🏿‍♀️ 🏝️</option>
<option value="people" className="people">People, fika & walks 👨🏻‍🦽🚶🏾‍♀️</option>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cute addition with the emojis

Comment on lines +1 to +28
import React from 'react';
import dogsurfer from './images/dogiesurf.png'
import shark from './images/shark.png'
import jelly from './images/jelly.png'
import crab from './images/krabba.png'
import goat from './images/goat.png'
import nakedcat from './images/nakedcat.png'
import nakeddog from './images/nakenhund.png'
import dogshark from './images/sharkdoggie.png'
import dove from './images/Duva.png'

export const QuizResult = ({ prefer, color, thing, name, setResults, results }) => {
const quiz = () => {
if (prefer === 'surf') {
if (color === 'black') {
if (thing === 'ocean') {
return (
<div className="Results">
Dum dum dum dum Shark <img src={shark} alt="Shark" />
</div>
);
} else if (thing === 'city') {
return (
<div className="Results">
Its a dog surfing <img src={dogsurfer} alt="Dog surfing" />
</div>
);
} else if (thing === 'mountain') {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely understand that it was difficult having to figure out how to handle so many conditionals, so awesome job getting that to work!! I would just look into how to use ternary operators to able shorten the code and if there would be another way to organise it.

} else if (thing === 'ocean') {
return (
<div className="Results">
Holy moly its a dog... no a shark no a dog shark <img src={dogshark} alt="Dog dressed as a shark" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love all the funny comments!!

|| (counter === 2 && !prefers)
|| (counter === 3 && !color)
|| (counter === 4 && !things) ? (
<p className="answer">Please answer the current question before proceeding.</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job having a reminder here to answer the question before even showing the next-button. Really impressed!


<p> Hey {name}, your favorite animal is: {results}</p>
<button onClick={handleResults} type="button" className="calculate"> <span>Whats my animal?</span></button>
<button className="playAgain" type="button" onClick={() => window.location.reload(false)}>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good job putting a reload here to able to start the quiz over again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants