navbar
This commit is contained in:
@ -1,25 +1,40 @@
|
||||
import { Navbar, Text } from '@mantine/core'
|
||||
import React from 'react'
|
||||
import { Button, Navbar, Text } from '@mantine/core'
|
||||
import React, { useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { logOut } from '../services/PhpApi'
|
||||
import Footer2 from './Footer2'
|
||||
|
||||
function DogNavbar({hasUser}:{hasUser: boolean})
|
||||
function DogNavbar({hasUser, onLogout}:{hasUser: boolean, onLogout: () => void})
|
||||
{
|
||||
return (
|
||||
<Navbar
|
||||
width={{ base: 100 }}
|
||||
height={500}
|
||||
hiddenBreakpoint={500}
|
||||
height='100%'
|
||||
hiddenBreakpoint={700}
|
||||
hidden={true}
|
||||
p="xs">
|
||||
p="xs"
|
||||
|
||||
sx={{ backgroundColor: 'rgb(243, 97, 12)'}}
|
||||
>
|
||||
|
||||
<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.Section grow mt="md">
|
||||
<div style={{display: 'flex', flexDirection:'column' }}>
|
||||
{!hasUser && <Text component={Link} variant='link' to='/login'>Login</Text>}
|
||||
{!hasUser && <Text component={Link} variant='link' to='/reg'>Register</Text>}
|
||||
{!hasUser && <Text component={Link} variant='link' to='/wantnewpw'>PW neu</Text>}
|
||||
{hasUser && <Text component={Link} variant='link' to='/profil'>Profil</Text>}
|
||||
{hasUser && <Text component={Link} variant='link' to='/qr'>QrCode</Text>}
|
||||
</div>
|
||||
</Navbar.Section>
|
||||
<Navbar.Section className='InputForm' >
|
||||
{hasUser && <Button sx = {{ padding: '0px 6px;'}} onClick={(e)=>{}}>Account löschen</Button>}
|
||||
</Navbar.Section>
|
||||
<Navbar.Section className='InputForm' >
|
||||
{hasUser && <Button sx = {{ padding: '0px 6px;'}} onClick={(e)=>{onLogout()}}>Logout</Button>}
|
||||
</Navbar.Section>
|
||||
<Navbar.Section> </Navbar.Section>
|
||||
<Navbar.Section><Text component={Link} variant='link' to='/impressum'>Impressum</Text></Navbar.Section>
|
||||
</Navbar> )
|
||||
}
|
||||
|
||||
|
||||
@ -33,6 +33,10 @@ function Profil()
|
||||
const edit = useRef(false);
|
||||
const formDataSave = useRef(formData); // just to fill it
|
||||
// data ist dogdata, logindata holt sich getProfilData.php aus $_SESSION
|
||||
|
||||
const WWW_ROOT: string = process.env.REACT_APP_WWW_ROOT!;
|
||||
|
||||
|
||||
if (error) return (<div>failed to load</div>);
|
||||
if (isLoading) return (<div>loading...</div>);
|
||||
|
||||
@ -177,6 +181,7 @@ function Profil()
|
||||
<Link to={'/upload'}>Bild ändern</Link>
|
||||
</div>
|
||||
<div className='margin'>
|
||||
<Link to={'/' + data.data.qr_id}>{WWW_ROOT + data.data.qr_id}</Link>
|
||||
{data.data && <Img pth={data.data.qr_code} className=''/>}
|
||||
<button className='QRakt' onClick={qr_refresh}>QR aktualisieren</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user