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

Sharks- Chinazo Onwukaike #14

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

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