Skip to content

New docs do not require fake components, all typing files should be types.ts #3151

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
Jun 27, 2024
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
2 changes: 1 addition & 1 deletion src/components/button/Button.driver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ButtonProps} from './ButtonTypes';
import {ButtonProps} from './types';
import {ImageDriver} from '../image/Image.driver';
import {ComponentDriver, ComponentDriverArgs} from '../../testkit/Component.driver';
import {TextDriver} from '../text/Text.driver';
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/ButtonConstants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ButtonSize} from './ButtonTypes';
import {ButtonSize} from './types';


export const PADDINGS = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
Props,
DEFAULT_PROPS,
ButtonSizeProp
} from './ButtonTypes';
} from './types';
import {PADDINGS, HORIZONTAL_PADDINGS, MIN_WIDTH, DEFAULT_SIZE} from './ButtonConstants';

export {ButtonSize, ButtonAnimationDirection, ButtonProps};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {PureComponent} from 'react';
import {ImageStyle, TextStyle, StyleProp} from 'react-native';
import {
BaseComponentInjectedProps,
Expand Down Expand Up @@ -166,22 +165,3 @@ export type Props = ButtonProps & BaseComponentInjectedProps & ForwardRefInjecte
export const DEFAULT_PROPS = {
iconOnRight: false
};

/**
* @description: Basic button component
* @extends: TouchableOpacity
* @modifiers: margin, background
* @image: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Sizes.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Typographies.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Outlines.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Corners.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Custom.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Inspirations.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Round.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Full.png?raw=true
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Animated.gif?raw=true
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ButtonsScreen.tsx
*/
// @ts-ignore
class FakeButtonForDocs extends PureComponent<ButtonProps> { // eslint-disable-line
static displayName = 'Button';

static defaultProps = DEFAULT_PROPS;

render() {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {ScrollViewProps, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, Animated} from 'react-native';
// @ts-expect-error No typings available for 'deprecated-react-native-prop-types'
import {PointPropType} from 'deprecated-react-native-prop-types';
Expand Down Expand Up @@ -109,12 +108,3 @@ export interface CarouselState {
initialOffset: PointPropType;
prevProps: CarouselProps;
}

// @ts-ignore
class CarouselTypesForDocs extends React.Component<CarouselProps> { // eslint-disable-line
static displayName = 'Carousel';

render() {
return null;
}
}
50 changes: 0 additions & 50 deletions src/components/connectionStatusBar/Types.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/connectionStatusBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Colors, Typography} from '../../style';
import TouchableOpacity from '../touchableOpacity';
import View from '../view';
import {Constants, asBaseComponent} from '../../commons/new';
import {ConnectionStatusBarProps, ConnectionStatusBarState, DEFAULT_PROPS} from './Types';
import {ConnectionStatusBarProps, ConnectionStatusBarState, DEFAULT_PROPS} from './types';
export {ConnectionStatusBarProps};

/**
Expand Down
31 changes: 31 additions & 0 deletions src/components/connectionStatusBar/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export type ConnectionStatusBarProps = {
/**
* Text to show as the status
*/
label?: string;
/**
* Handler to get connection change events propagation
*/
onConnectionChange?: (isConnected: boolean, isInitial: boolean) => void;
/**
* Text to show as the status
*/
allowDismiss?: boolean;
/**
* Use absolute position for the component
*/
useAbsolutePosition?: boolean;
};

export type ConnectionStatusBarState = {
/* Current connection type */
type?: string;
isConnected: boolean;
isCancelled: boolean;
};

export const DEFAULT_PROPS = {
label: 'No internet. Check your connection.',
allowDismiss: false,
useAbsolutePosition: true
};
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {PureComponent} from 'react';
import {ActivityIndicatorProps, TextStyle, ViewStyle} from 'react-native';

export type LoaderScreenProps = ActivityIndicatorProps & {
Expand Down Expand Up @@ -31,17 +30,3 @@ export type LoaderScreenProps = ActivityIndicatorProps & {
*/
containerStyle?: ViewStyle;
};


/**
* @description: Component that shows a full screen with an activity indicator
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/LoadingScreen.tsx
*/
// @ts-ignore
class FakeLoaderScreenForDocs extends PureComponent<LoaderScreenProps> { // eslint-disable-line
static displayName = 'LoaderScreen';

render() {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {PropsWithChildren, ReactNode} from 'react';
import {PropsWithChildren, ReactNode} from 'react';
import {FlatListProps, StyleProp, ViewStyle, TextStyle} from 'react-native';
import {ExpandableOverlayProps, ExpandableOverlayMethods} from '../../incubator/expandableOverlay';
import {ModalTopBarProps} from '../modal/TopBar';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {PureComponent} from 'react';
import {ImageURISource} from 'react-native';

export type StateScreenProps = {
Expand Down Expand Up @@ -29,17 +28,3 @@ export type StateScreenProps = {
testId?: string;
testID?: string;
};

/**
* @description: Component that shows a full screen for a certain state, like an empty state
* @image: https://user-images.githubusercontent.com/33805983/34672894-f262ab84-f488-11e7-83f0-4ee0f0ac34ba.png
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/EmptyStateScreen.tsx
*/
// @ts-ignore
class FakeStateScreenForDocs extends PureComponent<StateScreenProps> { // eslint-disable-line
static displayName = 'StateScreen';

render() {
return null;
}
}
19 changes: 0 additions & 19 deletions src/components/wizard/types.tsx → src/components/wizard/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {ImageProps} from '../image';
import {StyleProp, TextStyle, ViewStyle} from 'react-native';

Expand Down Expand Up @@ -93,21 +92,3 @@ export interface WizardProps {
testID?: string;
children?: React.ReactNode;
}

// @ts-ignore
class WizardTypesForDocs extends React.Component<WizardProps> { // eslint-disable-line
static displayName = 'Wizard';

render() {
return null;
}
}

// @ts-ignore
class WizardStepTypesForDocs extends React.Component<WizardStepProps> { // eslint-disable-line
static displayName = 'Wizard.Step';

render() {
return null;
}
}