created react structure
This commit is contained in:
@@ -1,11 +1,14 @@
|
|||||||
import './App.css'
|
import "./App.css";
|
||||||
|
import Layout from "./layout/Layout";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Layout>
|
||||||
|
<h1>Hello World</h1>
|
||||||
|
</Layout>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App
|
export default App;
|
||||||
|
11
frontend/src/components/Header.tsx
Normal file
11
frontend/src/components/Header.tsx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
const Header: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<header>
|
||||||
|
<h1>Header</h1>
|
||||||
|
</header>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Header;
|
18
frontend/src/layout/Layout.tsx
Normal file
18
frontend/src/layout/Layout.tsx
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import React from "react";
|
||||||
|
import Header from "../components/Header";
|
||||||
|
|
||||||
|
type LayoutProps = {
|
||||||
|
children: React.ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
const Layout: React.FC<LayoutProps> = ({ children }) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Header />
|
||||||
|
<main>{children}</main>
|
||||||
|
<footer></footer>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Layout;
|
Reference in New Issue
Block a user