added Layout and weather card
This commit is contained in:
19
frontend/src/components/Header.tsx
Normal file
19
frontend/src/components/Header.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from "react";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
const Header: React.FC = () => {
|
||||
const setApiKey = () => {
|
||||
const apiKey = prompt("Enter your API key:");
|
||||
if (apiKey) {
|
||||
Cookies.set("apiKey", apiKey);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<header>
|
||||
<h1>Weather App</h1>
|
||||
<button onClick={() => setApiKey()}>Set API Key</button>
|
||||
</header>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
Reference in New Issue
Block a user