Skip to content

Sharks- Chinazo Onwukaike#14

Open
ChinazoOnwukaike wants to merge 10 commits intoAdaGold:mainfrom
ChinazoOnwukaike:main
Open

Sharks- Chinazo Onwukaike#14
ChinazoOnwukaike wants to merge 10 commits intoAdaGold:mainfrom
ChinazoOnwukaike:main

Conversation

@ChinazoOnwukaike
Copy link

No description provided.

Copy link

@spitsfire spitsfire left a comment

Choose a reason for hiding this comment

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

Wow! Very organized and easy to read, Chinazo! Only thing I can think of for you to consider is how can we dry up these functions that are a long list of if statements and re-assigning state variables (like changetempColor on line 24)?

Something we could do is fatten up state with all of these values that correlate to the sky or the temperature. For example:

const state = {
  stats: [
    { upperBound: 49, color: "teal", ground: "🌲🌲⛄️🌲⛄️🍂🌲🍁🌲🌲⛄️🍂🌲"},
    { upperBound: 60, color: "yellow", ground: "🌾🌾_🍃_🪨__🛤_🌾🌾🌾_🍃"}
  ]
}

Now we can iterate through our hard coded values that correlate to the right temp or sky. That's really all I saw that could be dried up! Nicely done!


// Change city name by input box
const changeCity = (e) => {
// const searchCity = document.getElementById('search-box');

Choose a reason for hiding this comment

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

since you aren't using this, let's get rid of it for the final submission!

Suggested change
// const searchCity = document.getElementById('search-box');

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