Skip to content

ColorSliderGroup - refactor #3009

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
merged 20 commits into from
Apr 9, 2024
Merged

Conversation

Inbal-Tish
Copy link
Collaborator

@Inbal-Tish Inbal-Tish commented Apr 1, 2024

Description

ColorSliderGroup - refactor

Changelog

ColorSliderGroup - refactor

Additional info

ticket 4107

GradientSlider - change to useContext instead of asSliderGroupChild, fix typo and change useEffect to useDidUpdate.
@Inbal-Tish Inbal-Tish marked this pull request as draft April 1, 2024 06:43
@Inbal-Tish Inbal-Tish requested a review from ethanshar April 1, 2024 10:59
@Inbal-Tish Inbal-Tish marked this pull request as ready for review April 1, 2024 11:01
ethanshar
ethanshar previously approved these changes Apr 3, 2024
@ethanshar ethanshar dismissed their stale review April 3, 2024 13:06

Approved by mistake

Copy link
Collaborator

@ethanshar ethanshar left a comment

Choose a reason for hiding this comment

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

Looks good. Wrote couple of comments, also I noticed a weird bug, I'm not sure if it's a regression, but there's a small flicker when you drag of the sliders in the group

See attached video
https://github.com/wix/react-native-ui-lib/assets/1780255/5bf210f5-68c5-404f-b9f8-e418caf3c5dd

@@ -172,6 +157,5 @@ GradientSlider.displayName = 'GradientSlider';
GradientSlider.types = GradientSliderTypes;
// @ts-expect-error
export default asBaseComponent<GradientSliderProps, ComponentStatics<typeof GradientSlider>>(
// @ts-expect-error
forwardRef(asSliderGroupChild(forwardRef(GradientSlider)))
forwardRef(forwardRef(GradientSlider))
Copy link
Collaborator

Choose a reason for hiding this comment

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

You have forwardRef twice

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed

@@ -172,6 +157,5 @@ GradientSlider.displayName = 'GradientSlider';
GradientSlider.types = GradientSliderTypes;
// @ts-expect-error
export default asBaseComponent<GradientSliderProps, ComponentStatics<typeof GradientSlider>>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can add another simplification
Replace asBaseComponent HOC with the useThemeProps (see usages in View component)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I got issues with the statics and the forwardRef so I decided to leave it

Copy link
Collaborator

Choose a reason for hiding this comment

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

That works for me or at least It didn't throw any errors...

export default forwardRef<GradientSliderProps<string | HSLA>, ComponentStatics<typeof GradientSlider>>(GradientSlider);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, I didn't move the forwardRef... I'll make the change

@Inbal-Tish Inbal-Tish requested a review from ethanshar April 7, 2024 11:51
@Inbal-Tish
Copy link
Collaborator Author

Looks good. Wrote couple of comments, also I noticed a weird bug, I'm not sure if it's a regression, but there's a small flicker when you drag of the sliders in the group

See attached video https://github.com/wix/react-native-ui-lib/assets/1780255/5bf210f5-68c5-404f-b9f8-e418caf3c5dd

Fixed

@ethanshar
Copy link
Collaborator

Looks good. Wrote couple of comments, also I noticed a weird bug, I'm not sure if it's a regression, but there's a small flicker when you drag of the sliders in the group
See attached video https://github.com/wix/react-native-ui-lib/assets/1780255/5bf210f5-68c5-404f-b9f8-e418caf3c5dd

Fixed

Check if ColorPicker works for you?
I can't drag the gradient sliders in ColorPicker

@Inbal-Tish
Copy link
Collaborator Author

Looks good. Wrote couple of comments, also I noticed a weird bug, I'm not sure if it's a regression, but there's a small flicker when you drag of the sliders in the group
See attached video https://github.com/wix/react-native-ui-lib/assets/1780255/5bf210f5-68c5-404f-b9f8-e418caf3c5dd

Fixed

Check if ColorPicker works for you? I can't drag the gradient sliders in ColorPicker

I can move them... wired

@ethanshar ethanshar merged commit f2622cc into master Apr 9, 2024
@ethanshar ethanshar deleted the infra/ColorSliderGroup_refactor branch April 9, 2024 07:07
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