-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
…r-dashboard-2 # Conflicts: # components/DayViewItem.tsx
There was a problem hiding this 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.
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!
There was a problem hiding this 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
There was a problem hiding this 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.
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
npm install
npm start
on your deviceComponents
Month View
The month view displays a month calendar using the
<Calendar/>
component fromreact-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](https://private-user-images.githubusercontent.com/13278479/411369175-e91ce379-3a46-43bc-9a8d-731ebf1281f1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTUzMzksIm5iZiI6MTczOTMxNTAzOSwicGF0aCI6Ii8xMzI3ODQ3OS80MTEzNjkxNzUtZTkxY2UzNzktM2E0Ni00M2JjLTlhOGQtNzMxZWJmMTI4MWYxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDIzMDM1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUxYTA0MzVkMzk5NmM5YThkZDVlMTllMGMzNzMwNjk0NjkyMzM0MDlhODEzNjYyN2RjODUxNTAyNTdiYmIyNzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.dCB-F0Q7Mo97eEvTNhg2Ss5Xm1L6nwd9mShPlwLZZVU)
Week View
The week view displays shifts for the current week only using the
![image](https://private-user-images.githubusercontent.com/13278479/411368067-664e5a54-8405-48d7-9469-e38ab90a3daf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTUzMzksIm5iZiI6MTczOTMxNTAzOSwicGF0aCI6Ii8xMzI3ODQ3OS80MTEzNjgwNjctNjY0ZTVhNTQtODQwNS00OGQ3LTk0NjktZTM4YWI5MGEzZGFmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDIzMDM1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkyZGE0MDMwMDMzY2JjMWEyMDliYmIzZTVjNDNiMDJmZDY0ODExMDUyNmZmZjgzMmRlYzI4NzMyZTU0Mzg0NTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.YTVuU8762zmsIxizoJZG8R51ZpLzrPkHQqIU2Fjgoh4)
<WeekCalendar/>
component fromreact-native-calendars
.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)
Day View Items container
This component displays the DayViewItems as a list using
<AgendaList/>
fromreact-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.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.