main
Last change
on this file since 22367db 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:
1.1 KB
|
Rev | Line | |
---|
[e903234] | 1 | import React from 'react'
|
---|
| 2 |
|
---|
| 3 | import { useDispatch, useSelector } from 'react-redux'
|
---|
| 4 | import { setAdmin } from '../../redux/reducers/adminSlice';
|
---|
| 5 |
|
---|
| 6 | const Dashboard = () => {
|
---|
| 7 | const dispatch = useDispatch();
|
---|
| 8 |
|
---|
| 9 | const adminState = useSelector(state => state.admin);
|
---|
| 10 |
|
---|
| 11 | function seeComplaints() {
|
---|
| 12 | dispatch(setAdmin({
|
---|
| 13 | ...adminState.admin,
|
---|
| 14 | displays: {
|
---|
| 15 | ...adminState.admin.displays,
|
---|
| 16 | complaintsScreen: true,
|
---|
| 17 | }
|
---|
| 18 | }))
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | function seeLiveGames() {
|
---|
| 22 | dispatch(setAdmin({
|
---|
| 23 | ...adminState.admin,
|
---|
| 24 | displays: {
|
---|
| 25 | ...adminState.admin.displays,
|
---|
| 26 | liveGamesScreen: true,
|
---|
| 27 | }
|
---|
| 28 | }))
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | return (
|
---|
| 32 | <div className="fullscreen fs-centered admin dashboardScreen">
|
---|
| 33 | <div className="fs-inputs-container">
|
---|
| 34 | <div>
|
---|
| 35 | <span>Hello Admin</span>
|
---|
| 36 | <div>
|
---|
| 37 | <button className="primaryButton" onClick={() => seeComplaints()}>See complaints</button>
|
---|
| 38 | <button className="primaryButton" onClick={() => seeLiveGames()}>See live games</button>
|
---|
| 39 | </div>
|
---|
| 40 | </div>
|
---|
| 41 | </div>
|
---|
| 42 | </div>
|
---|
| 43 | )
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | export default Dashboard |
---|
Note:
See
TracBrowser
for help on using the repository browser.