-
Notifications
You must be signed in to change notification settings - Fork 734
Feat/change tab controller center selected logic #1103
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
Feat/change tab controller center selected logic #1103
Conversation
…-component-2 * master: export Button enums fix typings Fix lint issues Fix Switch color based props to use ColorValue typing Fix manual placeholderTextColor typing for ChipsInput Fix manualy typing of ChipsInput for selectionColor prop fix @types/react-native version to 0.63.4 Fix rn63 typings (#1100) Revert "fix for tabbar types for scrollbar" fix for tabbar types for scrollbar ScrollBar - TS migration (#1078) TabBar refactor (#1076) Update reanimated and gesture-handler to their latest version cleanup Cards example screen upgraded expo demo app to expo v40 (#1096) Update RNN version # Conflicts: # src/components/tabController/TabBar.tsx
@M-i-k-e-l |
Reminder:
|
…-logic * master: Fix lint error cleanup eslintrc file Infra/useDidUpdate (#1112) Support UI presets for Incubator.TextField and set a 'default' preset (#1111) Fix lint issues fix radioButton lint errors and generate types Fix/imageSource deprecation (#1115) Typescript/tab controller move to function component (#1098) Feat/radio button customize styling (#1092) bug fixes for TabBar refactor (#1106) Update ios target to 11 prettify file Fix icon size in badges example screen (#1104) icon prop - fix type to be both number and object. (#1086) enable eslint on both ts and js files (#1101) fix eslint (#1107) # Conflicts: # demo/src/screens/componentScreens/FaderScreen.tsx # src/components/fader/index.tsx # src/components/tabController/FadedScrollView.tsx # src/components/tabController/TabBar.tsx
Done |
Fixed and added the new hooks |
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.
Looks great. Good job!
I wrote a few comments..
src/helpers/useFocusItemHelper.ts
Outdated
@@ -0,0 +1,171 @@ | |||
import _ from 'lodash'; |
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.
Few comments on this..
- Is this hook really a common one or mainly for TabController purpose?
I assume you want to use it in FilterChips as well, in that case, consider moving it to Hooks folder. - The name of the hook needs a little work in my opinion
..Helper
doesn't really say much, clearly it's a hook that helps doing something (: Let's try to find a better name.
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.
Moved to hooks.
useFocusItem
useScrollToItem
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.
I think useScrollIToItem hints better what the hook does..
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.
Done
src/helpers/useFocusItemHelper.ts
Outdated
}, | ||
[setSnapBreakpoints]); | ||
|
||
const scroll = (scrollTo: number, animated: boolean) => { |
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.
Is this in order to support ScrollView, FlatList and SectionList?
I think I have a similar code somewhere.. (:
Maybe we should add a specific hook for that (:
Anyway, not for this scope - just FYI
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.
No time like the present.
I'm just not sure it's a hook, maybe a helper function, since it doesn't need useState
, useRef
etc, WDYT?
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.
Technically you can have this hook to create the scrollView ref and provide (and also use it internally for the scrollTo)
something like that..
const [scrollRef, scrollTo] = useScrollTo()
and maybe if someone already has the ref we can support passing it
const myOwnRef = useRef();
const [scrollRef, scrollTo] = useScrollTo(myOwnRef)
WDYT?
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.
Done
…-logic * master: Add missing functionality for Incubator.TextField (#1121) Update all app icons sizes for iOS project Adding 'defaultSource' for image source in case of an error (#1116) DateTimePicker - adding 'headerStyle' prop to adjust iOS dialog header style (#1117) add prepush script Infra/use did update (#1119) SettingsScreen - rename to UNSAFE (#1118) Create a middleware TextField migrator to migrate people to the new TextField implementation (#1113) Fix issue with missing selected indicator in Picker items (#1065) Fix issue for Android on rn63 - when passing null as tintColor to an image, the image is not displayed (#1055) Fix issue #1052 - PickerItem ignore renderItem prop (#1054) Dialog - RN63 broke Modal's onDismiss method, this fixes our API (#1026) pass containerStyle to checkbox when there's no label render checkbox container only if there's label (#1039)
Co-authored-by: Ethan Sharabi <[email protected]>
…-logic * master: update uilib-docs to v1.0.6 Read site metadata from gatsby-config gile Remove animatable from FloatingButton component (#1134) Stop using AnimatableManager in Hint (#1125) Change setTimeout's time from 50 to 100 Update generated types push expo stuff Update wiki links Fix/dialog swiping does not trigger on dialog dismissed (#1093) remove github token Create colors.md CardsScreen - fix backgrounds and remove obsolete examples (#1124) trigger build
Depends on
#1098
Description
Change TabController center selected logic (and move all the focusItems logic to a helper class)
Changelog
Change TabController center selected logic (and move all the focusItems logic to a helper class)