компоненты хедер футер + стили для прижатия футера

This commit is contained in:
Tatyana 2025-07-30 11:08:21 +03:00
parent 7aaf3dd288
commit 2d1ef7dbac
5 changed files with 63 additions and 7 deletions

View File

@ -1,4 +1,6 @@
import Header from './components/Header'
import MainContent from './components/MainContent'
import Footer from './components/Footer'
function App() {
@ -6,9 +8,27 @@ function App() {
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

11
src/components/Footer.tsx Normal file
View File

@ -0,0 +1,11 @@
function Header() {
return (
<div>
<p>footer</p>
</div>
);
}
export default Header;

13
src/components/Header.tsx Normal file
View File

@ -0,0 +1,13 @@
function Header() {
return (
<div className=''>
<h1>Вмеда</h1>
</div>
);
}
export default Header;

View File

@ -0,0 +1,12 @@
function Header() {
return (
<div className="h-full">
<p>main content</p>
</div>
);
}
export default Header;

View File

@ -8,6 +8,7 @@ import App from './App.tsx'
// Импортируем IonApp
import { IonApp, IonContent, IonPage } from '@ionic/react'
@ -21,7 +22,6 @@ createRoot(document.getElementById('root')!).render(
<App />
</IonContent>
</IonPage>
</IonApp>
</StrictMode>,
)