https://github.com/santoshy1101/todo-app
https://github.com/santoshy1101/todo-app
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/santoshy1101/todo-app
- Owner: santoshy1101
- Created: 2022-12-08T06:35:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-02T11:28:09.000Z (almost 2 years ago)
- Last Synced: 2025-02-04T13:20:21.584Z (4 months ago)
- Language: JavaScript
- Homepage: https://todo-app-santoshy1101.vercel.app
- Size: 180 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
{cloud_pct , feels_like , humidity , max_temp , min_temp , sunrise , sunset , temp , wind_degrees , wind_speed}
{
data ? data.map(({cloud_pct , feels_like , humidity , max_temp , min_temp , sunrise , sunset ,temp , wind_degrees , wind_speed},id)=>(
Cloud_Pact : {cloud_pct}
Feels_Like : {feels_like}
Humidity : {humidity}
Max_Temp : {max_temp}
Min_Temp : {min_temp}
Sunrise : {sunrise}
Sunset : {sunset}
Temp : {temp} °C
Wind_Degrees : {wind_degrees}
Wind_Speed : {wind_speed}
)) :null
}{ data?
Cloud_Pact : {data[0].cloud_pct}
Humidity : {data[0].humidity } %
Temp : {data[0].temp} °C
:null}
wheather
import React from 'react'
import { useState } from 'react';
import { useEffect } from 'react';
const Wheather = () => {
const [data,setData] =useState([])
const [query ,setQuery] =useState("delhi")// data ===undefined?console.log("satrt :" ,data) : console.log("empty :", data)
const getData = async(query="delhi")=>{
// console.log(query)
const options = {
method: 'GET',
headers: {
'X-RapidAPI-Key': '235bbe7c40mshc100adf39dcd554p17cd37jsn4c6a0cf66021',
'X-RapidAPI-Host': 'weather-by-api-ninjas.p.rapidapi.com'
}
};
const res= await fetch(`https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=${query}`, options)
const d = await res.json()
// console.log(data)
return d
// .then(response => response.json())
// .then(response => console.log(response))
// .catch(err => console.error(err));}
useEffect(()=>{
// getData(query).then((result)=>setData([{...result}]))
// setData(result)
},[query])const handleChange = (e)=>{
setTimeout(()=>{
setQuery(e.target.value)
// console.log("working")
},5000)
}
return (
wheather
Search
)
}export default Wheather