Skip to content

Commit 3b684aa

Browse files
committed
Revert "fix for tabbar types for scrollbar"
This reverts commit 5405420.
1 parent 5405420 commit 3b684aa

File tree

4 files changed

+61
-30
lines changed

4 files changed

+61
-30
lines changed

generatedTypes/components/scrollBar/index.d.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component } from 'react';
22
import { Animated, FlatListProps, ImageSourcePropType, NativeSyntheticEvent, NativeScrollEvent, LayoutChangeEvent } from 'react-native';
33
import { ForwardRefInjectedProps } from '../../commons/new';
4-
export interface ScrollBarProps extends FlatListProps<any> {
4+
interface Props extends FlatListProps<any>, ForwardRefInjectedProps {
55
/**
66
* Whether to use a FlatList. NOTE: you must pass 'data' and 'renderItem' props as well
77
*/
@@ -44,7 +44,7 @@ export interface ScrollBarProps extends FlatListProps<any> {
4444
*/
4545
focusIndex?: number;
4646
}
47-
declare type Props = ScrollBarProps & ForwardRefInjectedProps;
47+
export declare type ScrollBarProps = Props;
4848
export declare type State = {
4949
gradientOpacity: Animated.Value;
5050
gradientOpacityLeft: Animated.Value;
@@ -83,7 +83,9 @@ declare const Item: {
8383
({ children, index, onLayout }: any): JSX.Element;
8484
displayName: string;
8585
};
86-
declare const _default: React.ComponentClass<ScrollBarProps & {
87-
useCustomTheme?: boolean | undefined;
86+
declare const _default: React.ComponentClass<Props & {
87+
useCustomTheme?: boolean | undefined; /**
88+
* Whether to use a FlatList. NOTE: you must pass 'data' and 'renderItem' props as well
89+
*/
8890
}, any> & typeof ScrollBar;
8991
export default _default;

generatedTypes/components/tabBar/index.d.ts

Lines changed: 52 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import React from 'react';
2-
import { StyleProp, ViewStyle } from 'react-native';
3-
import { ScrollBarProps } from '../scrollBar';
4-
import TabBarItem, { TabBarItemProps } from './TabBarItem';
5-
interface Props extends ScrollBarProps, TabBarItemProps {
2+
import { Animated, ViewStyle } from 'react-native';
3+
import { BaseComponentInjectedProps } from '../../commons/new';
4+
import { ViewProps } from '../view';
5+
import TabBarItem from './TabBarItem';
6+
export declare type TabBarProps = BaseComponentInjectedProps & ViewProps & {
67
/**
78
* Show Tab Bar bottom shadow
89
*/
910
enableShadow?: boolean;
1011
/**
11-
* The minimum number of tabs to render in scroll mode
12+
* The minimum number of tabs to render
1213
*/
1314
minTabsForScroll?: number;
1415
/**
@@ -18,37 +19,69 @@ interface Props extends ScrollBarProps, TabBarItemProps {
1819
/**
1920
* callback for when index has change (will not be called on ignored items)
2021
*/
21-
onChangeIndex?: (index: number) => void;
22+
onChangeIndex?: (props: any) => void;
2223
/**
2324
* callback for when tab selected
2425
*/
25-
onTabSelected?: (index: number) => void;
26+
onTabSelected?: (props: any) => void;
2627
/**
2728
* custom style for the selected indicator
2829
*/
29-
indicatorStyle?: StyleProp<ViewStyle>;
30+
indicatorStyle?: ViewStyle;
31+
/**
32+
* The background color
33+
*/
34+
backgroundColor: string;
3035
/**
3136
* Tab Bar height
3237
*/
3338
height?: number;
39+
children: React.ReactNode;
40+
style?: ViewStyle;
41+
testID?: string;
42+
};
43+
export declare type State = {
44+
gradientOpacity: Animated.Value;
45+
scrollEnabled?: boolean;
46+
currentIndex?: number;
47+
};
48+
declare const _default: React.ComponentClass<BaseComponentInjectedProps & ViewProps & {
3449
/**
35-
* Pass when container width is different than the screen width
50+
* Show Tab Bar bottom shadow
51+
*/
52+
enableShadow?: boolean | undefined;
53+
/**
54+
* The minimum number of tabs to render
55+
*/
56+
minTabsForScroll?: number | undefined;
57+
/**
58+
* current selected tab index
3659
*/
37-
containerWidth?: number;
60+
selectedIndex?: number | undefined;
61+
/**
62+
* callback for when index has change (will not be called on ignored items)
63+
*/
64+
onChangeIndex?: ((props: any) => void) | undefined;
65+
/**
66+
* callback for when tab selected
67+
*/
68+
onTabSelected?: ((props: any) => void) | undefined;
69+
/**
70+
* custom style for the selected indicator
71+
*/
72+
indicatorStyle?: ViewStyle | undefined;
3873
/**
3974
* The background color
4075
*/
41-
backgroundColor?: string;
76+
backgroundColor: string;
4277
/**
43-
* set darkTheme style
78+
* Tab Bar height
4479
*/
45-
darkTheme?: boolean;
46-
children?: React.ReactNode;
47-
style?: ViewStyle;
48-
testID?: string;
49-
}
50-
export declare type TabBarProps = Props;
51-
declare const _default: React.ComponentClass<Props & {
80+
height?: number | undefined;
81+
children: React.ReactNode;
82+
style?: ViewStyle | undefined;
83+
testID?: string | undefined;
84+
} & {
5285
useCustomTheme?: boolean | undefined;
5386
}, any> & {
5487
Item: typeof TabBarItem;

generatedTypes/components/tabController/TabBarItem.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ export interface TabControllerItemProps {
4343
* Badge component props to display next the item label
4444
*/
4545
badge?: BadgeProps;
46-
/**
47-
* maximun number of lines the label can break
48-
*/
49-
/**
50-
* whether the tab will have a divider on its right
51-
*/
5246
/**
5347
* A fixed width for the item
5448
*/

src/components/tabBar/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ import {Constants} from '../../helpers';
55
import {Colors} from '../../style';
66
import {asBaseComponent} from '../../commons/new';
77
import View from '../view';
8-
import ScrollBar , {ScrollBarProps} from '../scrollBar';
8+
import ScrollBar/* , {ScrollBarProps} */ from '../scrollBar';
99
import TabBarItem, {TabBarItemProps} from './TabBarItem';
1010

1111

1212
const MIN_TABS_FOR_SCROLL = 1;
1313
const DEFAULT_BACKGROUND_COLOR = Colors.white;
1414
const DEFAULT_HEIGHT = 48;
1515

16+
const ScrollBarProps = ScrollBar.propTypes; //TODO: remove after TS migration
17+
1618
interface Props extends ScrollBarProps, TabBarItemProps {
1719
/**
1820
* Show Tab Bar bottom shadow

0 commit comments

Comments
 (0)