Open
Conversation
complete wave 01, design and html
Completes wave 02. Changes pics and temp color dynamically
complete wave 03
complete wave 04. add F/C toggle
completes wave 05
spitsfire
reviewed
Jul 23, 2022
spitsfire
left a comment
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
since you aren't using this, let's get rid of it for the final submission!
Suggested change
| // const searchCity = document.getElementById('search-box'); |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.