account and protected router
This commit is contained in:
25
src/views/home/account/RightPanel.tsx
Normal file
25
src/views/home/account/RightPanel.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ReverseButton } from '../../../components/button/ReverseButton';
|
||||
import { useAppDispatch, useAppSelector } from '../../../redux/hooks';
|
||||
import { logout } from '../../../redux/slices/auth';
|
||||
|
||||
const RightPanel = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
const name = useAppSelector((state) => state.auth.username);
|
||||
const email = useAppSelector((state) => state.auth.email);
|
||||
return (
|
||||
<div className="h-full w-full relative p-[20px]">
|
||||
<div>{name}</div>
|
||||
<div>{email}</div>
|
||||
<ReverseButton
|
||||
className="absolute bottom-[20px] right-[20px]"
|
||||
onClick={() => {
|
||||
dispatch(logout());
|
||||
}}
|
||||
text="Выход"
|
||||
color="error"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default RightPanel;
|
||||
Reference in New Issue
Block a user