Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

79 user dashboard 2 #80

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

79 user dashboard 2 #80

wants to merge 28 commits into from

Conversation

cshimm
Copy link
Contributor

@cshimm cshimm commented Feb 6, 2025

resolves #79

Description

Implements the month view and week view on the user dashboard. These views will be used to display dummy shift data for the user including but not limited to role, building, room, start time, end time and total hours for the shift. When the user navigates to the user dashboard page they will be greeted with the month view with all of their shifts marked with a black dot. Underneath the calendar is a scroll view of shift detail items that correspond to the marked dates in the calendar. Note that days can support multiple shifts.

Technology used

The package react-native-calendars version: ~1.1308.1 was used for both the month and week calendars as well as the item list that displays shift info.
Read more: https://wix.github.io/react-native-calendars/docs/Intro

Data

dummyShiftData.ts contains an array of ShiftData objects. These objects are imported statically and accessed only once when the UserDashboard component mounts.

To test

  1. run npm install
  2. run npm start on your device
  3. navigate to the User Dashboard via the link on the homepage

Components

Month View

The month view displays a month calendar using the <Calendar/> component from react-native-calendars. Days can be tapped to view shift details on a specific day. Tapping days marked with a shift will scroll the shift details container (<AgendaList/>) to that day. Note that nothing happens when selecting a day without a shift.

You can also switch the currently selected month by tapping the arrows in the calendar header.
image

Week View

The week view displays shifts for the current week only using the <WeekCalendar/> component from react-native-calendars.
image

DayViewItem

This is the component that is rendered for every shift in the shift details container. Here is what it displays:

Role
Building: Room
Shift duration | StartTime - EndTime (each 12 hr format)

image

Day View Items container

This component displays the DayViewItems as a list using <AgendaList/> from react-native-calendars. It consists of a date section header with DayViewItems underneath for corresponding shifts. Because <AgendaList/> inhereits from <FlatList/> the items rendered are scrollable.

image

Example

2025-02-09.14-46-51.mp4

Limitations

I ran into issues with the <WeekCalendar/> not initializing properly when it was the default view loaded. I'm not entirely sure what the issue ever was but I'm sure its that can be fixed should we rather have the week view be the default view when loading the user dashboard.

@cshimm cshimm linked an issue Feb 6, 2025 that may be closed by this pull request
4 tasks
@cshimm cshimm self-assigned this Feb 8, 2025
@cshimm cshimm marked this pull request as ready for review February 10, 2025 00:22
@nwm516 nwm516 added the enhancement New feature or request label Feb 10, 2025
Copy link
Contributor

@nwm516 nwm516 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cshimm , this is really solid work. Wonderful job! It really is fulfilling what we're wanting from this feature for the application, so this is a fantastic addition.

Cameron PR Month View User DashCameron PR Week View User Dash

I did run into some issues when jumping between the month and week views, with the latter taking on more of a hit when toggling between the two but I don't feel that that is a major concern this sprint and PR; establishing these components and getting them to where we want conceptually is far more of my aim, which you feel you did quite well. LGTM!

Copy link
Contributor

@katrina-l-hill katrina-l-hill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Cameron, great job on this! I was able to replicate it on the web and emulator with no issues. The result is in alignment with the task description and Figma image. This looks fine to me.

2025-02-09.20-50-05.mp4

Copy link
Contributor

@MiguelQuintana1 MiguelQuintana1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent job, Cameron with this component, I tested on the iOS simulator, and it works perfectly. However, when I tested this component on the web, it seemed like it had a problem resizing. I did like the picker you used; it looks super good. I worked this week applying different pickers, and I know how difficult it is to make this work on all platforms without breaking the others.

GMT20250210-060543_Clip_Miguel.Quintana.s.Clip.02_09_2025.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User dashboard #2
4 participants