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

React cal poc kl #85

Merged
merged 32 commits into from
Apr 1, 2024
Merged

React cal poc kl #85

merged 32 commits into from
Apr 1, 2024

Conversation

KVinyl
Copy link
Collaborator

@KVinyl KVinyl commented Mar 9, 2024

Changelog from #79
Moved calendar and event cards to one row.
Allow multiple event cards to be displayed.
Scroll bar is shown when multiple event cards are displayed.
No event cards are shown when selected date has no events.
Text color of day number during the weekend in calendar is white when selected or has event instead of black.

--
Event card text needs formatting.
Does not look good on mobile.
Lots of module warnings during webpack compilation.

Copy link

netlify bot commented Mar 9, 2024

Deploy Preview for dev-fcccolumbus ready!

Name Link
🔨 Latest commit dd7ab07
🔍 Latest deploy log https://app.netlify.com/sites/dev-fcccolumbus/deploys/660350b3c3ecd0000887644d
😎 Deploy Preview https://deploy-preview-85--dev-fcccolumbus.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@KVinyl
Copy link
Collaborator Author

KVinyl commented Mar 9, 2024

@readysetagile

@readysetagile
Copy link
Collaborator

@KVinyl please resolve the merge conflicts and the linting errors

@KVinyl
Copy link
Collaborator Author

KVinyl commented Mar 12, 2024

@readysetagile Merge conflicts and linting errors have been resolved. Did some further refactoring. Of course, more needs to be done, just looking for feedback for I have so far.

@readysetagile
Copy link
Collaborator

@KVinyl a test is failing. Make sure you run npm run build && npm run lint && npm run test before pushing

@KVinyl
Copy link
Collaborator Author

KVinyl commented Mar 14, 2024

@readysetagile Updated the snapshots to pass testing.

@KVinyl KVinyl force-pushed the react-cal-poc-kl branch from 7b83732 to dd2e133 Compare March 20, 2024 04:25
@KVinyl
Copy link
Collaborator Author

KVinyl commented Mar 20, 2024

@readysetagile Further optimization, refactoring, minor bug fixes

Copy link
Collaborator

@readysetagile readysetagile left a comment

Choose a reason for hiding this comment

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

It looks like it works great, so nice work there!

I think that we might want to follow good design patterns here also -- like a MVC. So let's move the code that is currently in Events.jsx into a controller structure, that is, eventsController.js The model is already taken care of in the calendar control. That way Events.jsx becomes the "view", and just handles user events and initialization. you can ask GPT this question to know what I mean:

can this react.js code for Events.jsx be refactored so that it follows a view-controller design, that is, the Events.jsx serves as a view to just handle user events and initialization, and the controller does the stuff that happens when an event is fired? [include the code for Events.jsx]

Seeing this will also likely bring up more refactoring, like being able to configure the link for the calendar through a file and possibly make it data driven also -- along with other maintainability concerns, so let's start with the controller.

@KVinyl
Copy link
Collaborator Author

KVinyl commented Mar 26, 2024

@readysetagile Created two custom hooks. useEvents is responsible for fetching events. useCalendar takes in events as an input and returns the variables/functions used by the Calendar/Events section.

Fixed unwanted multiple events CSS behavior in Chrome.

const fetchData = async () => {
try {
const response = await fetch(
'https://docs.google.com/document/d/1OcnWWt1qHaJWE-8v_FPtNO8DKviRQ7DMaqylupuvPXE/export?format=txt'
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will create another backlog item to make this value configurable. It's outside the scope of this backlog item.

Copy link
Collaborator

@readysetagile readysetagile left a comment

Choose a reason for hiding this comment

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

Well done, @KVinyl ! This captures the essence of a good design.

@readysetagile readysetagile merged commit ac855e3 into dev Apr 1, 2024
4 checks passed
@readysetagile readysetagile deleted the react-cal-poc-kl branch April 1, 2024 14:19
@readysetagile readysetagile linked an issue Apr 1, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendar control renders on a page [POC]
3 participants