Added sign out button to user page
This commit is contained in:
22
front/src/components/SignOut.tsx
Normal file
22
front/src/components/SignOut.tsx
Normal file
@ -0,0 +1,22 @@
|
||||
import { Navbar } from 'react-bootstrap'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { CSSProperties } from 'react'
|
||||
|
||||
import { clearToken } from '../utils/auth'
|
||||
|
||||
import signOutIcon from '../assets/signOut.svg'
|
||||
|
||||
const styles = {
|
||||
rightIcon: {
|
||||
marginLeft: '1rem',
|
||||
marginRight: 0
|
||||
} as CSSProperties,
|
||||
}
|
||||
|
||||
const SignOut = () => (
|
||||
<Navbar.Brand style={styles.rightIcon} as={Link} to='/'>
|
||||
<img onClick={clearToken} src={signOutIcon} alt='Выйти' />
|
||||
</Navbar.Brand>
|
||||
)
|
||||
|
||||
export default SignOut
|
Reference in New Issue
Block a user