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

refactor: propose enhancement for calendar 0.1.0 #511

Merged

Conversation

sunjungAn
Copy link
Contributor

@sunjungAn sunjungAn commented Sep 23, 2023

Description

This PR refactors the calendar component to make the code more concise. By leveraging date-fns, we’re now offering more intuitive internationalization. Additionally, a styles prop has been introduced, allowing for customization of all sub-component styles.
To optimize the scrolling experience, the implementation now utilizes FlatList, ensuring smoother horizontal transitions. However, a limitation was encountered with scrollToIndex in FlatList, which didn’t trigger as expected. As a workaround, and as documented in the comments, we’ve implemented the onScrollToIndexFailed solution suggested in this Stack Overflow post.
Lastly, updates have been made to CalendarCarouselBasicStory to reflect the current changes.

Test Plan

You can test by injecting props into CalendarCarouselBasicStory. Currently, it’s a very basic version, and you can primarily try making style-centric changes.

Related Issues

N/A

Tests

WIP

Checklist

Before you create this PR confirms that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • Run yarn test:all and make sure nothing fails.
  • I am willing to follow-up on review comments in a timely manner.

Copy link
Member

Choose a reason for hiding this comment

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

@sunjungAn This test file should be packages/__tests__/CalendarCarousel.test.tsx

@hyochan hyochan marked this pull request as ready for review February 4, 2024 14:40
@hyochan hyochan force-pushed the refactor/calendar-carousel-0.2.0 branch from 197d450 to 06bf394 Compare February 4, 2024 14:43
Copy link

codecov bot commented Feb 4, 2024

Codecov Report

Merging #511 (aaf7fdb) into main (3a72b31) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #511   +/-   ##
=======================================
  Coverage   75.47%   75.47%           
=======================================
  Files          36       36           
  Lines         946      946           
  Branches      427      432    +5     
=======================================
  Hits          714      714           
  Misses        227      227           
  Partials        5        5           

@hyochan hyochan merged commit 1bbf896 into dooboolab-community:main Feb 4, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants