Skip to content

Commit 9607c63

Browse files
authored
Fix/docs add native components and various fixes (#909)
* Docs - add native components * Docs - remove components from docs (IGNORE) * Add display name for WheelPicker.Item * Chip - do not use React.FC since it breaks the docs
1 parent 0481e65 commit 9607c63

File tree

17 files changed

+36
-6
lines changed

17 files changed

+36
-6
lines changed

lib/components/HighlighterOverlayView.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,6 @@ HighlighterOverlayView.propTypes = {
9393
innerPadding: PropTypes.number,
9494
};
9595

96+
HighlighterOverlayView.displayName = 'IGNORE';
97+
9698
export default HighlighterOverlayView;

lib/components/Keyboard/KeyboardInput/CustomKeyboardView.android.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import CustomKeyboardViewBase from './CustomKeyboardViewBase';
88
const CustomKeyboardViewNativeAndroid = requireNativeComponent('CustomKeyboardViewNativeTemp');
99

1010
export default class CustomKeyboardView extends CustomKeyboardViewBase {
11+
static displayName = 'IGNORE';
1112
static propTypes = {
1213
initialProps: PropTypes.object,
1314
component: PropTypes.string,

lib/components/Keyboard/KeyboardInput/CustomKeyboardView.ios.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import KeyboardRegistry from './KeyboardRegistry';
44
import CustomKeyboardViewBase from './CustomKeyboardViewBase';
55

66
export default class CustomKeyboardView extends CustomKeyboardViewBase {
7+
static displayName = 'IGNORE';
78
static propTypes = {
89
/**
910
* The reference to the actual text input (or the keyboard may not reset when instructed to, etc.)

lib/components/Keyboard/KeyboardTracking/KeyboardTrackingView.android.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, {PureComponent} from 'react';
22
import {View} from 'react-native';
33

44
class KeyboardTrackingView extends PureComponent {
5+
static displayName = 'IGNORE';
56
render() {
67
return <View {...this.props}/>;
78
}

lib/components/WheelPicker/WheelPickerItem.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, {Component} from 'react'; //eslint-disable-line
22
import PropTypes from 'prop-types';
33

44
export default class WheelPickerItem extends Component {
5+
static displayName = 'WheelPicker.Item';
56
// eslint-disable-line react/no-multi-comp
67
static propTypes = {
78
/**

src/components/KeyboardAwareScrollView/KeyboardAwareListView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {ScrollView} from 'react-native';
44
import KeyboardAwareBase from './KeyboardAwareBase';
55

66
export default class KeyboardAwareListView extends KeyboardAwareBase {
7-
static displayName = 'KeyboardAwareListView';
7+
static displayName = 'IGNORE';
88

99
static propTypes = {
1010
onScroll: PropTypes.func

src/components/chip/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export type ChipPropTypes = ViewProps & TouchableOpacityProps & {
123123
* @extendslink: docs/TouchableOpacity
124124
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ChipScreen.tsx
125125
*/
126-
const Chip: React.FC<ChipPropTypes> = ({
126+
const Chip = ({
127127
avatarProps,
128128
backgroundColor,
129129
badgeProps,
@@ -146,10 +146,10 @@ const Chip: React.FC<ChipPropTypes> = ({
146146
useSizeAsMinimum,
147147
testID,
148148
...others
149-
}) => {
149+
}: ChipPropTypes) => {
150150

151151
const renderIcon = useCallback((iconPosition) => {
152-
const isLeftIcon = iconPosition === 'left'
152+
const isLeftIcon = iconPosition === 'left';
153153

154154
return (
155155
<Image

src/components/dialog/OverlayFadingBackground.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
overlayBackgroundColor: string;
99
}
1010

11-
export default ({
11+
const OverlayFadingBackground = ({
1212
dialogVisibility,
1313
modalVisibility,
1414
overlayBackgroundColor
@@ -44,3 +44,7 @@ export default ({
4444

4545
return <View absF animated style={style} pointerEvents="none"/>;
4646
};
47+
48+
OverlayFadingBackground.displayName = 'IGNORE';
49+
50+
export default OverlayFadingBackground;

src/components/drawer/Swipeable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ type StateType = {
6767
};
6868

6969
export default class Swipeable extends Component<PropType, StateType> {
70+
static displayName = 'IGNORE';
7071
static defaultProps = {
7172
friction: 1,
7273
overshootFriction: 1,

src/components/picker/NativePicker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import TouchableOpacity from '../touchableOpacity';
88
import {Colors} from '../../style';
99

1010
class NativePicker extends BaseComponent {
11+
static displayName = 'IGNORE';
1112
state = {
1213
selectedValue: this.props.value,
1314
items: this.extractPickerItems(this.props),

src/components/picker/PickerDialog.android.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {Colors, BorderRadiuses} from '../../style';
1111
import {WheelPicker} from '../../nativeComponents';
1212

1313
class PickerDialog extends BaseComponent {
14+
static displayName = 'IGNORE';
1415
static propTypes = {
1516
selectedValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
1617
onValueChange: PropTypes.func,

src/components/picker/PickerDialog.ios.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {Colors} from '../../style';
1111
import {WheelPicker} from '../../nativeComponents';
1212

1313
class PickerDialog extends BaseComponent {
14+
static displayName = 'IGNORE';
1415
static propTypes = {
1516
selectedValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
1617
onValueChange: PropTypes.func,

src/components/scrollBar/ScrollBarGradient.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,6 @@ const ScrollBarGradient = ({
6161
);
6262
};
6363

64+
ScrollBarGradient.displayName = 'IGNORE';
65+
6466
export default ScrollBarGradient;

src/components/scrollBar/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,6 @@ const Item = ({children, index, onLayout}) => {
254254
);
255255
};
256256

257+
Item.displayName = 'IGNORE';
257258
ScrollBar.Item = Item;
258259
export default forwardRef(ScrollBar);

src/components/slider/context/SliderGroup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import View from '../../view';
77

88

99
export default class SliderGroup extends Component {
10+
static displayName = 'IGNORE';
1011
static propTypes = {
1112
color: PropTypes.string,
1213
onValueChange: PropTypes.func

uilib-docs/configurations/plugins.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ const componentsDocgenPlugin = [
3434
}
3535
];
3636

37+
const nativeComponentsDocgenPlugin = [
38+
'gatsby-transformer-react-docgen',
39+
{
40+
resolve: 'gatsby-source-filesystem',
41+
options: {
42+
path: `${__dirname}/../../lib/components/`
43+
}
44+
}
45+
];
46+
3747
const imagesPlugin = [
3848
{
3949
resolve: `gatsby-source-filesystem`,
@@ -59,6 +69,7 @@ module.exports = {
5969
manifestPlugin,
6070
markdownPagesPlugin,
6171
componentsDocgenPlugin,
72+
nativeComponentsDocgenPlugin,
6273
imagesPlugin,
6374
layoutPlugin
6475
};

uilib-docs/gatsby-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {manifestPlugin, markdownPagesPlugin, componentsDocgenPlugin, imagesPlugin, layoutPlugin} = require('./configurations/plugins');
1+
const {manifestPlugin, markdownPagesPlugin, componentsDocgenPlugin, nativeComponentsDocgenPlugin, imagesPlugin, layoutPlugin} = require('./configurations/plugins');
22

33
module.exports = {
44
pathPrefix: '/react-native-ui-lib',
@@ -12,6 +12,7 @@ module.exports = {
1212
`gatsby-plugin-sass`,
1313
...markdownPagesPlugin,
1414
...componentsDocgenPlugin,
15+
...nativeComponentsDocgenPlugin,
1516
...imagesPlugin,
1617
...manifestPlugin,
1718
...layoutPlugin

0 commit comments

Comments
 (0)