Revize b523c74d
Přidáno uživatelem Michal Schwob před asi 2 roky(ů)
frontend/src/features/Auth/Register.tsx | ||
---|---|---|
1 |
import { Fragment, useEffect } from 'react' |
|
2 |
import { useSelector } from 'react-redux' |
|
3 |
import { useNavigate } from 'react-router-dom' |
|
4 |
import { RootState } from '../redux/store' |
|
5 |
import LoginDialog from './LoginDialog' |
|
6 |
import NotAuthorized from "../NotAuthorized/NotAuthorized" |
|
7 |
import RegisterDialog from "./RegisterDialog" |
|
1 | 8 |
|
2 |
export default {} |
|
9 |
|
|
10 |
const Register = () => { |
|
11 |
const isAdmin = useSelector( |
|
12 |
(state: RootState) => state.user.roles.includes("ROLE_ADMIN") |
|
13 |
) |
|
14 |
|
|
15 |
return ( |
|
16 |
<Fragment> |
|
17 |
{isAdmin ? (<RegisterDialog />) : <NotAuthorized />} |
|
18 |
</Fragment> |
|
19 |
) |
|
20 |
} |
|
21 |
|
|
22 |
export default Register |
Také k dispozici: Unified diff
Creation of administration page and user registration
re #9627