navbar
This commit is contained in:
23
src/App.tsx
23
src/App.tsx
@ -5,8 +5,8 @@ import Login from './components/Login';
|
||||
import Register from './components/Register';
|
||||
import Dog from './components/Dog';
|
||||
import Qr from './components/Qr';
|
||||
import Header from './components/Header';
|
||||
import Footer from './components/Footer';
|
||||
import Header2 from './components/Header2';
|
||||
import Footer2 from './components/Footer2';
|
||||
import Impressum from './components/Impressum';
|
||||
import "bootstrap/dist/css/bootstrap.min.css";
|
||||
import FileUpload from './components/FileUpload';
|
||||
@ -16,9 +16,18 @@ import {getUser} from './services/PhpApi'
|
||||
import { TUser } from './context/UserContext';
|
||||
import PasswordReset from './components/PasswordReset';
|
||||
import WantNewPw from './components/WantNewPw';
|
||||
import { MantineProvider } from '@mantine/core';
|
||||
import
|
||||
{
|
||||
MantineProvider,
|
||||
AppShell,
|
||||
Navbar,
|
||||
Header,
|
||||
Aside,
|
||||
Footer
|
||||
} from '@mantine/core';
|
||||
import { NotificationsProvider } from '@mantine/notifications';
|
||||
import { notificationError } from './services/Notifications';
|
||||
import DogNavbar from './components/DogNavbar';
|
||||
|
||||
const App: React.FC = () =>
|
||||
{
|
||||
@ -50,10 +59,14 @@ const App: React.FC = () =>
|
||||
return (
|
||||
<MantineProvider withNormalizeCSS withGlobalStyles>
|
||||
<NotificationsProvider position="top-center" >
|
||||
<AppShell
|
||||
padding={0}
|
||||
navbarOffsetBreakpoint={500}
|
||||
navbar={<DogNavbar hasUser={user ? true : false} />}
|
||||
>
|
||||
<div className="App">
|
||||
<div className="col middle">
|
||||
<BrowserRouter basename='/dog/'>
|
||||
{user && <Header />}
|
||||
<Routes>
|
||||
{user && <Route index path="/" element={<Profil/>} />}
|
||||
{/* {user && <Route index path="/" element={<Home/>} />} */}
|
||||
@ -69,11 +82,11 @@ const App: React.FC = () =>
|
||||
{user && <Route path="/upload" element={<FileUpload/>} />}
|
||||
{user && <Route path="/profil" element={<Profil/>} />}
|
||||
</Routes>
|
||||
<Footer/>
|
||||
</BrowserRouter>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</AppShell>
|
||||
</NotificationsProvider>
|
||||
</MantineProvider>
|
||||
);
|
||||
|
||||
26
src/components/DogNavbar.tsx
Normal file
26
src/components/DogNavbar.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { Navbar, Text } from '@mantine/core'
|
||||
import React from 'react'
|
||||
import Footer2 from './Footer2'
|
||||
|
||||
function DogNavbar({hasUser}:{hasUser: boolean})
|
||||
{
|
||||
return (
|
||||
<Navbar
|
||||
width={{ base: 100 }}
|
||||
height={500}
|
||||
hiddenBreakpoint={500}
|
||||
hidden={true}
|
||||
p="xs">
|
||||
|
||||
<Navbar.Section><Text>Titel</Text></Navbar.Section>
|
||||
<Navbar.Section grow mt="md">{/* Links sections */}</Navbar.Section>
|
||||
<Navbar.Section><Text>Login</Text></Navbar.Section>
|
||||
<Navbar.Section><Text>Register</Text></Navbar.Section>
|
||||
{hasUser && <Navbar.Section><Text>Profil</Text></Navbar.Section>}
|
||||
{hasUser && <Navbar.Section><Text>QrCode</Text></Navbar.Section>}
|
||||
{hasUser && <Navbar.Section><Text>Logout</Text></Navbar.Section>}
|
||||
<Navbar.Section>Footer</Navbar.Section>
|
||||
</Navbar> )
|
||||
}
|
||||
|
||||
export default DogNavbar
|
||||
@ -1,10 +1,10 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import './Footer.css';
|
||||
|
||||
function Footer() {
|
||||
function Footer2() {
|
||||
return (
|
||||
<div className="noprint"><Link to={'./Impressum'}>Impressum</Link></div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Footer;
|
||||
export default Footer2;
|
||||
@ -5,7 +5,7 @@ import {logOut} from '../services/PhpApi'
|
||||
import { notificationSuccess } from '../services/Notifications';
|
||||
|
||||
|
||||
function Header()
|
||||
function Header2()
|
||||
{
|
||||
const logOutForm = () =>
|
||||
{
|
||||
@ -17,10 +17,9 @@ function Header()
|
||||
|
||||
return (
|
||||
<div className='logout InputForm'>
|
||||
<div className='noprint'>Header</div>
|
||||
<button onClick={logOutForm}>Logout</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Header;
|
||||
export default Header2;
|
||||
Reference in New Issue
Block a user