Skip to content

Typescript/tab controller move to function component #1098

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

M-i-k-e-l
Copy link
Collaborator

Description

  1. Move TabBar to function component.
  2. Move logic for fading to FadedScrollView (should we make this more generic, it has some RTL logic).
  3. Fix Fader's RTL logic - please take a look at the FaderScreen, it has some logic, I'm not sure if that's ok.

Changelog

Move TabBar to function component & add support for Fader in RTL

@M-i-k-e-l M-i-k-e-l requested a review from ethanshar December 27, 2020 16:54
@M-i-k-e-l M-i-k-e-l changed the title Typescript/tab controller move to function component 2 Typescript/tab controller move to function component Dec 27, 2020
…-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
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 Great!
Anyway, I wish we can maybe clean up some more the code in TabBar.
(Not saying it was super clean before..)

But see in one of my comments, I suggested using custom hooks for different parts of the code, no need to over do it, but it can make the TabBar's code more readable.
What do you think?

}
}, []);

const [itemsWidths, setItemsWidths] = useState<number[]>([]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

consider moving some parts of the code to a separate custom hook (it does't have to be every part)
This will cleanup some of TabBar's code and create better separation.
For instance, maybe we can move the whole logic that calculates itemWidth and itemOffset to a separate hook.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is done in the second PR ✅

@M-i-k-e-l M-i-k-e-l requested a review from ethanshar December 30, 2020 21:08
@ethanshar ethanshar merged commit b5fefd2 into master Jan 3, 2021
M-i-k-e-l added a commit that referenced this pull request Jan 3, 2021
…-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
@M-i-k-e-l M-i-k-e-l deleted the typescript/tab-controller-move-to-function-component-2 branch January 25, 2021 09:10
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