Skip to content

Commit e4384fc

Browse files
authored
Infra/export SegmentedControlItemProps (#1280)
1 parent 8505bbf commit e4384fc

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

generatedTypes/components/segmentedControl/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import React from 'react';
22
import { StyleProp, ViewStyle } from 'react-native';
3-
import { SegmentItemProps } from './segment';
3+
import { SegmentedControlItemProps as SegmentProps } from './segment';
4+
export declare type SegmentedControlItemProps = SegmentProps;
45
export declare type SegmentedControlProps = {
56
/**
67
* Array on segments.
78
*/
8-
segments?: SegmentItemProps[];
9+
segments?: SegmentedControlItemProps[];
910
/**
1011
* The color of the active segment label.
1112
*/

generatedTypes/components/segmentedControl/segment.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { LayoutChangeEvent, ImageSourcePropType, ImageStyle, StyleProp } from 'react-native';
3-
export declare type SegmentItemProps = {
3+
export declare type SegmentedControlItemProps = {
44
/**
55
* The label of the segment.
66
*/
@@ -18,7 +18,7 @@ export declare type SegmentItemProps = {
1818
*/
1919
iconOnRight?: boolean;
2020
};
21-
export declare type SegmentProps = SegmentItemProps & {
21+
export declare type SegmentProps = SegmentedControlItemProps & {
2222
/**
2323
* Is the item selected.
2424
*/
@@ -44,7 +44,7 @@ export declare type SegmentProps = SegmentItemProps & {
4444
*/
4545
onLayout?: (index: number, event: LayoutChangeEvent) => void;
4646
};
47-
declare const _default: React.ComponentClass<SegmentItemProps & {
47+
declare const _default: React.ComponentClass<SegmentedControlItemProps & {
4848
/**
4949
* Is the item selected.
5050
*/

src/components/segmentedControl/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ import Reanimated, {EasingNode, Easing as _Easing} from 'react-native-reanimated
55
import {Colors, BorderRadiuses, Spacings} from '../../style';
66
import {asBaseComponent} from '../../commons/new';
77
import View from '../view';
8-
import Segment, {SegmentItemProps} from './segment';
8+
import Segment, {SegmentedControlItemProps as SegmentProps} from './segment';
99

1010
const {interpolate: _interpolate, interpolateNode} = Reanimated;
1111
const interpolate = interpolateNode || _interpolate;
1212
const Easing = EasingNode || _Easing;
1313
const BORDER_WIDTH = 1;
1414

15+
export type SegmentedControlItemProps = SegmentProps;
1516
export type SegmentedControlProps = {
1617
/**
1718
* Array on segments.
1819
*/
19-
segments?: SegmentItemProps[];
20+
segments?: SegmentedControlItemProps[];
2021
/**
2122
* The color of the active segment label.
2223
*/

src/components/segmentedControl/segment.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import TouchableOpacity from '../touchableOpacity';
66
import Text from '../text';
77
import Image from '../image';
88

9-
export type SegmentItemProps = {
9+
export type SegmentedControlItemProps = {
1010
/**
1111
* The label of the segment.
1212
*/
@@ -25,7 +25,7 @@ export type SegmentItemProps = {
2525
iconOnRight?: boolean;
2626
};
2727

28-
export type SegmentProps = SegmentItemProps & {
28+
export type SegmentProps = SegmentedControlItemProps & {
2929
/**
3030
* Is the item selected.
3131
*/

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export {default as Image, ImageProps} from './components/image';
3636
export {default as Overlay, OverlayTypes} from './components/overlay';
3737
export {default as RadioButton, RadioButtonPropTypes, RadioButtonProps} from './components/radioButton/RadioButton';
3838
export {default as RadioGroup, RadioGroupPropTypes, RadioGroupProps} from './components/radioButton/RadioGroup';
39-
export {default as SegmentedControl, SegmentedControlProps} from './components/segmentedControl';
39+
export {default as SegmentedControl, SegmentedControlProps, SegmentedControlItemProps} from './components/segmentedControl';
4040
export {default as Switch, SwitchProps} from './components/switch';
4141
export {default as TabController, TabControllerProps, TabControllerItemProps} from './components/tabController';
4242
export {default as TabBar, TabBarProps} from './components/TabBar';

0 commit comments

Comments
 (0)