компоненты хедер футер + стили для прижатия футера
This commit is contained in:
parent
7aaf3dd288
commit
2d1ef7dbac
26
src/App.tsx
26
src/App.tsx
@ -1,4 +1,6 @@
|
|||||||
|
import Header from './components/Header'
|
||||||
|
import MainContent from './components/MainContent'
|
||||||
|
import Footer from './components/Footer'
|
||||||
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
@ -6,9 +8,27 @@ function App() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h2 className='text-2xl text-blue-500'>Test</h2>
|
<div className="flex flex-col min-h-screen container mx-auto px-4 bg-fuchsia-200">
|
||||||
|
|
||||||
|
<header className="fixed top-0 left-0 w-full z-50 bg-fuchsia-400 shadow h-12 px-4">
|
||||||
|
<Header />
|
||||||
|
</header>
|
||||||
|
|
||||||
|
|
||||||
|
<main className="flex-1 mt-12 bg-green-200">
|
||||||
|
<MainContent />
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<footer className="mt-auto bg-fuchsia-400">
|
||||||
|
<Footer />
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App
|
export default App
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
11
src/components/Footer.tsx
Normal file
11
src/components/Footer.tsx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
function Header() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<p>footer</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Header;
|
||||||
|
|
13
src/components/Header.tsx
Normal file
13
src/components/Header.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
function Header() {
|
||||||
|
return (
|
||||||
|
<div className=''>
|
||||||
|
<h1>Вмеда</h1>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Header;
|
||||||
|
|
12
src/components/MainContent.tsx
Normal file
12
src/components/MainContent.tsx
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
function Header() {
|
||||||
|
return (
|
||||||
|
<div className="h-full">
|
||||||
|
<p>main content</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Header;
|
||||||
|
|
@ -8,6 +8,7 @@ import App from './App.tsx'
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Импортируем IonApp
|
// Импортируем IonApp
|
||||||
import { IonApp, IonContent, IonPage } from '@ionic/react'
|
import { IonApp, IonContent, IonPage } from '@ionic/react'
|
||||||
|
|
||||||
@ -21,7 +22,6 @@ createRoot(document.getElementById('root')!).render(
|
|||||||
<App />
|
<App />
|
||||||
</IonContent>
|
</IonContent>
|
||||||
</IonPage>
|
</IonPage>
|
||||||
|
|
||||||
</IonApp>
|
</IonApp>
|
||||||
</StrictMode>,
|
</StrictMode>,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user