Skip to content

Infra/export SegmentedControlItemProps #1280

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 1 commit into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions generatedTypes/components/segmentedControl/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import { StyleProp, ViewStyle } from 'react-native';
import { SegmentItemProps } from './segment';
import { SegmentedControlItemProps as SegmentProps } from './segment';
export declare type SegmentedControlItemProps = SegmentProps;
export declare type SegmentedControlProps = {
/**
* Array on segments.
*/
segments?: SegmentItemProps[];
segments?: SegmentedControlItemProps[];
/**
* The color of the active segment label.
*/
Expand Down
6 changes: 3 additions & 3 deletions generatedTypes/components/segmentedControl/segment.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { LayoutChangeEvent, ImageSourcePropType, ImageStyle, StyleProp } from 'react-native';
export declare type SegmentItemProps = {
export declare type SegmentedControlItemProps = {
/**
* The label of the segment.
*/
Expand All @@ -18,7 +18,7 @@ export declare type SegmentItemProps = {
*/
iconOnRight?: boolean;
};
export declare type SegmentProps = SegmentItemProps & {
export declare type SegmentProps = SegmentedControlItemProps & {
/**
* Is the item selected.
*/
Expand All @@ -44,7 +44,7 @@ export declare type SegmentProps = SegmentItemProps & {
*/
onLayout?: (index: number, event: LayoutChangeEvent) => void;
};
declare const _default: React.ComponentClass<SegmentItemProps & {
declare const _default: React.ComponentClass<SegmentedControlItemProps & {
/**
* Is the item selected.
*/
Expand Down
5 changes: 3 additions & 2 deletions src/components/segmentedControl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ import Reanimated, {EasingNode, Easing as _Easing} from 'react-native-reanimated
import {Colors, BorderRadiuses, Spacings} from '../../style';
import {asBaseComponent} from '../../commons/new';
import View from '../view';
import Segment, {SegmentItemProps} from './segment';
import Segment, {SegmentedControlItemProps as SegmentProps} from './segment';

const {interpolate: _interpolate, interpolateNode} = Reanimated;
const interpolate = interpolateNode || _interpolate;
const Easing = EasingNode || _Easing;
const BORDER_WIDTH = 1;

export type SegmentedControlItemProps = SegmentProps;
export type SegmentedControlProps = {
/**
* Array on segments.
*/
segments?: SegmentItemProps[];
segments?: SegmentedControlItemProps[];
/**
* The color of the active segment label.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/components/segmentedControl/segment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TouchableOpacity from '../touchableOpacity';
import Text from '../text';
import Image from '../image';

export type SegmentItemProps = {
export type SegmentedControlItemProps = {
/**
* The label of the segment.
*/
Expand All @@ -25,7 +25,7 @@ export type SegmentItemProps = {
iconOnRight?: boolean;
};

export type SegmentProps = SegmentItemProps & {
export type SegmentProps = SegmentedControlItemProps & {
/**
* Is the item selected.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export {default as Image, ImageProps} from './components/image';
export {default as Overlay, OverlayTypes} from './components/overlay';
export {default as RadioButton, RadioButtonPropTypes, RadioButtonProps} from './components/radioButton/RadioButton';
export {default as RadioGroup, RadioGroupPropTypes, RadioGroupProps} from './components/radioButton/RadioGroup';
export {default as SegmentedControl, SegmentedControlProps} from './components/segmentedControl';
export {default as SegmentedControl, SegmentedControlProps, SegmentedControlItemProps} from './components/segmentedControl';
export {default as Switch, SwitchProps} from './components/switch';
export {default as TabController, TabControllerProps, TabControllerItemProps} from './components/tabController';
export {default as TabBar, TabBarProps} from './components/TabBar';
Expand Down