доработка хедера футера

This commit is contained in:
Tatyana 2025-07-31 10:58:50 +03:00
parent b414c0e8ab
commit 848e4111c0
8 changed files with 30 additions and 48 deletions

View File

@ -14,23 +14,19 @@ const App: React.FC = () => (
<IonApp>
<IonReactRouter>
{/* Постоянный Header */}
<div className='flex flex-col h-screen bg-green-300'>
<Header />
{/* Основной контейнер для контента */}
<div className='flex flex-col min-h-screen container mx-auto px-4 bg-fuchsia-200'>
<div className='container mt-20 flex-1'>
{/* Контент с отступом равным высоте Header */}
<div className='flex-1 overflow-auto'>
<IonRouterOutlet>
<AppRoutes />
</IonRouterOutlet>
</div>
{/* Постоянный Footer */}
<Footer />
</div>
</IonReactRouter>
</IonApp>
);

View File

@ -1,4 +1,3 @@
import React from 'react';
import { Route } from 'react-router-dom';
import Home from './pages/Home';

View File

@ -1,10 +1,10 @@
import { IonRouterLink } from '@ionic/react';
function Footer() {
return (
<div className='mt-auto bg-fuchsia-400'>
<h1>Footer</h1>
<div className='w-full bg-fuchsia-400 shadow h-12 px-4 flex justify-center items-center fixed bottom-0 left-0 right-0 bg-opacity-80'>
{/* Можно добавить содержимое футера */}
Футер
</div>
);
}

View File

@ -1,16 +1,17 @@
import React from 'react';
import { IonRouterLink } from '@ionic/react';
function Header() {
return (
<div className='fixed top-0 left-0 w-full z-50 bg-fuchsia-400 shadow h-12 px-4 flex justify-between'>
<h1>Вмеда</h1>
<IonRouterLink href="/register">
<a className="text-sm">Зарегистрироваться</a>
<div className='w-full z-50 bg-fuchsia-400 shadow h-12 px-4 flex justify-between items-center fixed top-0 left-0 right-0 bg-opacity-80'>
<IonRouterLink href='/home' className='cursor-pointer'>
Вмеда
</IonRouterLink>
<IonRouterLink href="/register" className="text-sm">
Зарегистрироваться
</IonRouterLink>
</div>
);
}
export default Header;

View File

@ -1,12 +0,0 @@
function MainContent() {
return (
<div className="flex-1 mt-12 bg-green-200">
<p>main content</p>
</div>
);
}
export default MainContent;

View File

@ -2,7 +2,10 @@
function Home() {
return (
<>
<p className="pt-20">Домашняя страница</p>
<div className="pt-20 mx-auto px-4">
<p>Домашняя страница</p>
</div>
</>
);
}

View File

@ -2,7 +2,6 @@ function Login() {
return (
<div className=''>
<h1>Войти/залогиниться</h1>
</div>
);
}

View File

@ -1,11 +1,7 @@
function Auth() {
return (
<div className='pt-20'>
<h1 className='cursor-pointer'>Страница регистрации</h1>
<div className="pt-20 mx-auto px-4">
<h1>Страница регистрации</h1>
</div>
);
}