Header, Footer, FileUpload

This commit is contained in:
Peter Hoppe
2022-12-28 15:08:29 +01:00
parent fd65306aaf
commit 4da1c85fe9
18 changed files with 256 additions and 26 deletions

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

@ -0,0 +1,28 @@
import React, { useContext } from 'react'
import './Header.css';
import {Axios, UserCtx, UserCtxT} from '../context/UserContext';
function Header() {
const {setUser} = useContext<UserCtxT | null>(UserCtx) as UserCtxT;
const logOut = () =>
{
Axios.post('logout.php')
.then((res) =>
{
console.log(res);
})
.catch((err) => console.error(err));
setUser(null);
}
return (
<div className='logout'>
<div>Header</div>
<button onClick={logOut}>Logout</button>
</div>
);
}
export default Header;