Skip to content

dean-added-auto-scroll-classifier #1474

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

Merged

Conversation

deanblinder
Copy link
Contributor

Description

i added a parameter "isAutoScrolled" on the "onChangePage" method to classify if the image was auto or manually scrolled.

Changelog

the change was in this file "src/components/carousel/index.tsx" lines 40,47,171,264

@deanblinder deanblinder requested a review from ethanshar August 17, 2021 12:14
@ethanshar ethanshar self-assigned this Aug 19, 2021
@@ -105,6 +106,7 @@ export interface CarouselState {
pageHeight: number;
initialOffset: PointPropType;
prevProps: CarouselProps;
// isAutoScrolled:boolean //dean
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that needed?

Suggested change
// isAutoScrolled:boolean //dean

Comment on lines 279 to 283

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest to run document formatting to remove all redundant spaces that were added
If you use VSCode you can run the Format Document on the file

@@ -40,7 +40,7 @@ export interface CarouselProps extends ScrollViewProps {
/**
* callback for when page has changed
*/
onChangePage?: (newPageIndex: number, oldPageIndex: number) => void;
onChangePage?: (newPageIndex: number, oldPageIndex: number, isAutoScrolled: boolean) => void;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider passing the new (last) argument as an object of "info"
If in the future we'll have to pass more info props then instead of adding more arguments, we'll just add to this info object you created.

@deanblinder deanblinder force-pushed the dean/add-option-to-chack-if-image-scrolled-auto-or-manually branch from 0755ac4 to 372d2ac Compare September 9, 2021 11:53
@ethanshar ethanshar enabled auto-merge (squash) September 9, 2021 12:01
@ethanshar ethanshar merged commit 7d1811c into master Sep 9, 2021
@ethanshar ethanshar deleted the dean/add-option-to-chack-if-image-scrolled-auto-or-manually branch November 30, 2021 08:15
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.

2 participants