Changeset e903234 for pages/admin


Ignore:
Timestamp:
07/17/22 09:43:05 (2 years ago)
Author:
anastasovv <simon@…>
Branches:
main
Children:
faff334
Parents:
e007fcd
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pages/admin/index.js

    re007fcd re903234  
    22
    33import 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'
    411
    512const Admin = () => {
    6   return (
    7     <div>
    8         <Head>
    9             <title>Caessino - Activate account</title>
    10         </Head>
    11        
    12         Admin
    13     </div>
    14   )
     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    )
    1535}
    1636
Note: See TracChangeset for help on using the changeset viewer.