update ui

This commit is contained in:
madarsbiss 2021-07-20 20:29:23 +03:00
parent 79547da7d3
commit c8245d56ec
2 changed files with 3 additions and 11 deletions

View File

@ -4,8 +4,6 @@ import Image from "next/image";
export default function Home() { export default function Home() {
const [input, setInput] = useState(); const [input, setInput] = useState();
const [defaultValue, setDefaultValue] = useState("Search a city...");
const [isCurrentActive, setIsCurrentActive] = useState(true);
const [weatherData, setWeatherData] = useState(); const [weatherData, setWeatherData] = useState();
const clickHandler = async () => { const clickHandler = async () => {
@ -17,9 +15,7 @@ export default function Home() {
const data = await res.json(); const data = await res.json();
console.log(data); console.log(data);
setWeatherData({ ...data }); setWeatherData({ ...data });
setInput(""); setInput("");
// setDefaultValue("sss");
}; };
const something = (event) => { const something = (event) => {
@ -85,9 +81,7 @@ export default function Home() {
<input <input
type="text" type="text"
className={styles.searchInput} className={styles.searchInput}
defaultValue={defaultValue} defaultValue="Search a city..."
// placeholder="🔍 Search a city ..."
value={input}
onFocus={(e) => (e.target.value = "")} onFocus={(e) => (e.target.value = "")}
onChange={(e) => setInput(e.target.value)} onChange={(e) => setInput(e.target.value)}
onKeyDown={(e) => something(e)} onKeyDown={(e) => something(e)}

View File

@ -60,14 +60,12 @@
.searchInput { .searchInput {
margin-bottom: 20px; margin-bottom: 20px;
height: 40px; height: 40px;
width: 300px; width: 200px;
border: none; border: 2px solid rgb(218, 218, 218);
padding: 0 10px; padding: 0 10px;
color: #c5c5c5; color: #c5c5c5;
/* background-color: none; */
font-size: 20px; font-size: 20px;
text-align: right; text-align: right;
/* background-color: rgb(247, 247, 247); */
border-radius: 20px; border-radius: 20px;
font-family: "Varela Round", sans-serif; font-family: "Varela Round", sans-serif;
font-size: 18px; font-size: 18px;