diff --git a/src/components/atoms/Action.js b/src/components/atoms/Action.js index 047b953..9d19c91 100644 --- a/src/components/atoms/Action.js +++ b/src/components/atoms/Action.js @@ -87,12 +87,16 @@ export default function SessionAction({action, authUser, dataUser}) { setStress(stress+1)}> - - {/* Coach Only */} - - setOrderIndex(e.target.value)} /> - - + { + dataUser.userType === "coach" && + + {/* Coach Only */} + + setOrderIndex(e.target.value)} /> + + + } + ) } diff --git a/src/containers/SessionDetails.js b/src/containers/SessionDetails.js index 58cdf95..5772d60 100644 --- a/src/containers/SessionDetails.js +++ b/src/containers/SessionDetails.js @@ -35,8 +35,12 @@ export default function SessionDetails({authUser, dataUser, session, exitSession sessions: firebase.firestore.FieldValue.arrayUnion(session.id), }).then(() => changeTab(e, 0)) } - const completeSession = () => { + const completeSession = (e) => { setSessionInProgress(false) + sessionsRef.doc(session.id).update({ + status: 'completed', + }) + changeTab(e, 1) // UPDATE Firestore (status, data fields) console.log("startSession clicked") } @@ -80,7 +84,7 @@ export default function SessionDetails({authUser, dataUser, session, exitSession {session.status === "draft" && } - + { dataUser.userType === "coach" && } @@ -102,12 +106,16 @@ export default function SessionDetails({authUser, dataUser, session, exitSession { addingAction && } - + { + dataUser.userType === "coach" && + { session.status && } - + + } + ) diff --git a/src/pages/DashPage.js b/src/pages/DashPage.js index cef6231..a1b163b 100644 --- a/src/pages/DashPage.js +++ b/src/pages/DashPage.js @@ -51,7 +51,11 @@ export default function DashPage({authUser, dataUser}) { > - + { + dataUser?.userType === 'coach' && + + } + { dataUser?.userType === 'coach' && diff --git a/src/styles/sessionStyles.js b/src/styles/sessionStyles.js index c432bec..3f57f45 100644 --- a/src/styles/sessionStyles.js +++ b/src/styles/sessionStyles.js @@ -155,7 +155,6 @@ const newSessionFormStyles = makeStyles(() => ({ borderRadius: '15px', backgroundColor: holisticTheme.bgBtnPrimary, }, - })) const sessionActionStyles = makeStyles(() => ({