boolean-uk / team-dev-frontend-client

1 stars 11 forks source link

Add Exercise Button in the NavigationRail #226

Closed lucianosimoni closed 1 year ago

lucianosimoni commented 1 year ago

Reason: Cause it is beautiful with another button in there It is a big component. But all linked. It is divided in 3 phases.

  1. Create New page component
  2. Update to MyExercises
  3. Creation of Exercises button in the NavigationRail

Create new Page component

Location:

Cohorts > Exercises Page <------------------- New folder

Name of Files:

New Routes:

Two Routes are necessary because the Student user will only be able to navigate to the exercises of his cohort, while the Teacher will be redirect to a list of all exercises available.


Update to MyExercises

Must include a check if user role is Teacher or Student.

If TEACHER:

if STUDENT:

Useful link to the API documentation:

https://boolean-uk.github.io/team-dev-frontend-server/#tag/exercise/operation/createExercise

Creation of Exercises button in the NavigationRail

In the NavigationRail, create a new button using the same structure of the previous buttons.

Link the onClick of the button to a new function called exercisesPressed() in which takes the user to the respective based on its role (Check cohortPressed for condition example in the same file)

Add an Icon from Google Icons and update necessary CSS

Auenc commented 1 year ago

Looks great :)