Header to it's own component.

This commit is contained in:
codevictory
2021-10-21 00:47:12 +03:00
parent 50df638bf9
commit 9e66d5a5dd
4 changed files with 22 additions and 15 deletions

View File

@@ -1,14 +1,3 @@
.App { .App {
text-align: center; text-align: center;
} }
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

View File

@@ -1,12 +1,10 @@
import './App.css'; import './App.css';
import { Header } from "./components/header"
function App() { function App() {
return ( return (
<div className="App"> <div className="App">
<header className="App-header"> <Header />
<h1>Lintu ja Maslo</h1>
<p><i>Elokuussa 2022</i></p>
</header>
</div> </div>
); );
} }

10
src/components/header.tsx Normal file
View File

@@ -0,0 +1,10 @@
import "./../styles/header.css"
export const Header = () => {
return (
<header className="App-header">
<h1>Lintu ja Maslo</h1>
<p><i>Elokuussa 2022</i></p>
</header>
)
}

10
src/styles/header.css Normal file
View File

@@ -0,0 +1,10 @@
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}