Please enable JavaScript.
Coggle requires JavaScript to display documents.
Admin Panel (this.state (for TUTOR (TUTOR DATA ARRAY contains every tutor…
Admin Panel
this.state
logged in = false
for TUTOR
TUTOR DATA ARRAY
contains every tutor as object
has tutor data been retrieved from firebase = false
tutor data retrieved = true / false
for CLIENT
has client data been retrieved = false
client data retrieved status
CLIENT DATA ARRAY
contains every client as object
which data to show to admin = tutor (default)
which data to show to admin
componentDidMount() :warning:
componentDidUpdate() :warning:
if admin is logged in
retrieve all tutor data from firebase
do these
change "retrieved data" to true
push all tutor as objects in this array
loginObserver() :warning:
if user is logged in && is admin, change it to true
JSX
anything that is to be displayed on website
admin decides which data he wants
default is = tutor
IF
"to show data" = client
IF
client data not retrieved
retrieve all CLIENT data from firebase :warning:
do these
put all client Objects in an array inside state
1 more item...
change "retrieved data" = true
1 more item...
show wait screen until data retrieved
client data has been retrieved
display client data in tablular form
"to show data" = tutor
IF
tutor data has been retrieved
display this data in tabular format
tutor data not retrieved
change "which data to show" to = "tutor" or "client" according to admin's input