SPRINT 2 ‐ UserRole - BlueJayBird11/UniJet GitHub Wiki
User Story: As a user, I have a screen that lets me select whether I am a rider or a driver.
About UserRole
There are two roles users can take right now:
- Driver: Driver lets you act as a driver and take passengers with you.
- Passenger: Passenger lets you act as a passengers and go on a ride with the driver.
Usage
The option to select between Driver
and a Passenger
is first prompted when you sign up with the website.
After you correctly put all your credentials and signup, it will ask you if you want to signup as a driver or just the passenger. If you select passenger, it will disable the Driver feature. If you select Driver, it will then ask you for your driver license, vehicle info and other required stuff (!! currently work in progress !!).
You can also choose between driver and the passenger from the settings page.
Features
As mentioned above, Driver Page allows you to view the website as the Driver. Other pages of the website are set to change according to that. and similarly when your role is Passenger, you can view the website from Passenger stand point. Currently the history page is implemented with this feature.
When you are in Driver role, you can look at certain details about the last passengers you had.
And, when you are in Passenger role, you can look at certain details about the drivers you had last rides with.
The user role is defined by UserRoleContext.tsx.
type UserRoleContextType = {
userRole: 'driver' | 'passenger';
setUserRole: (role: 'driver' | 'passenger') => void;
};