main
Last change
on this file since faff334 was e903234, checked in by anastasovv <simon@…>, 2 years ago |
Added an admin panel, and the admin can now answer complaints
|
-
Property mode
set to
100644
|
File size:
949 bytes
|
Line | |
---|
1 | import Head from 'next/head'
|
---|
2 |
|
---|
3 | import React from 'react'
|
---|
4 | import Complaints from '../../components/admin/Complaints'
|
---|
5 | import Dashboard from '../../components/admin/Dashboard'
|
---|
6 | import LiveGames from '../../components/admin/LiveGames'
|
---|
7 | import Login from '../../components/admin/Login'
|
---|
8 |
|
---|
9 | import { useSelector } from 'react-redux';
|
---|
10 | import Loading from '../../components/Loading'
|
---|
11 |
|
---|
12 | const Admin = () => {
|
---|
13 | const adminState = useSelector(state => state.admin);
|
---|
14 |
|
---|
15 | return (
|
---|
16 | <div>
|
---|
17 | <Head>
|
---|
18 | <title>Caessino - Admin dashboard</title>
|
---|
19 | </Head>
|
---|
20 |
|
---|
21 |
|
---|
22 | <Loading/>
|
---|
23 |
|
---|
24 | { adminState.admin.session_id === '' ? (
|
---|
25 | <Login/>
|
---|
26 | ) : (
|
---|
27 | <Dashboard/>
|
---|
28 | )}
|
---|
29 |
|
---|
30 | { adminState.admin.displays.complaintsScreen && <Complaints/> }
|
---|
31 |
|
---|
32 | { adminState.admin.displays.liveGamesScreen && <LiveGames/> }
|
---|
33 | </div>
|
---|
34 | )
|
---|
35 | }
|
---|
36 |
|
---|
37 | export default Admin |
---|
Note:
See
TracBrowser
for help on using the repository browser.