source: pages/admin/index.js@ e903234

main
Last change on this file since e903234 was e903234, checked in by anastasovv <simon@…>, 23 months ago

Added an admin panel, and the admin can now answer complaints

  • Property mode set to 100644
File size: 949 bytes
Line 
1import Head from 'next/head'
2
3import React from 'react'
4import Complaints from '../../components/admin/Complaints'
5import Dashboard from '../../components/admin/Dashboard'
6import LiveGames from '../../components/admin/LiveGames'
7import Login from '../../components/admin/Login'
8
9import { useSelector } from 'react-redux';
10import Loading from '../../components/Loading'
11
12const 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
37export default Admin
Note: See TracBrowser for help on using the repository browser.