Conversation
| "@testing-library/jest-dom": "^5.12.0", | ||
| "@testing-library/react": "^11.2.7", | ||
| "@testing-library/user-event": "^12.8.3", | ||
| "city": "^1.0.4", |
There was a problem hiding this comment.
remove any dependency that you are not using
there something dependencies hell, try to read
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
remove those extra lines
There was a problem hiding this comment.
there an extension called prettier, try to use
| // import Weather from './component/Weather'; | ||
| //import Weatherrr from './component/Weatherrr'; | ||
| // import Wether from './component/Wether'; |
There was a problem hiding this comment.
don't leave commented code in your prod
There was a problem hiding this comment.
here and everywhere in your code
| import React, { useState } from 'react' | ||
| import Time from './Time' | ||
| import Weatherrr from './Weatherrr' | ||
| const weather = require('openweather-apis'); |
There was a problem hiding this comment.
can't you use import here?
| const weather = require('openweather-apis'); | |
| import weather from 'openweather-apis'; |
| const weather = require('openweather-apis'); | ||
|
|
||
| function Inputcity() { | ||
| const [cooord, setcooord] = useState({ lati: '51.5085', long: '-0.1257', cityy: 'London' }) |
There was a problem hiding this comment.
writing it like cooord is so confusing
try to call it something like weatherCoord
| alert('Input a valid City') | ||
| } | ||
| else { | ||
| setcooord({ lati: info.coord.lat, long: info.coord.lon, cityy: info.name }) |
There was a problem hiding this comment.
the city here is hard coded, you should make it variable
it's also bad named, try to use a different name
|
|
||
| function Inputcity() { | ||
| const [cooord, setcooord] = useState({ lati: '51.5085', long: '-0.1257', cityy: 'London' }) | ||
| const [city, setcity] = useState('London') |
There was a problem hiding this comment.
you have a typo here
| const [city, setcity] = useState('London') | |
| const [city, setCity] = useState('London') |
and maybe you can make it like this
| const [city, setcity] = useState('London') | |
| const [cityInput, setCityInput] = useState('London') |
| <input type='text' value={city} onChange={cityhandler} autoFocus /> | ||
| <button onClick={submit}>OK</button> | ||
| <button onClick={loctate}>Loctate My Location</button> |
There was a problem hiding this comment.
you have to activate the submit on enter
| import moment from 'moment' | ||
|
|
||
| function Time() { | ||
| const [time, settime] = useState(moment().format('MMMM Do YYYY, h:mm:ss a')) |
There was a problem hiding this comment.
| const [time, settime] = useState(moment().format('MMMM Do YYYY, h:mm:ss a')) | |
| const [time, setTime] = useState(moment().format('MMMM Do YYYY, h:mm:ss a')) |
| lat: `${props.lat}`, //lat | ||
| lon: `${props.long}`, //lon |
There was a problem hiding this comment.
| lat: `${props.lat}`, //lat | |
| lon: `${props.long}`, //lon | |
| lat: props.lat, //lat | |
| lon: props.long, //lon |
checking on the code