Skip to content

Fix/docs add native components and various fixes #909

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 4 commits into from
Aug 26, 2020
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: 2 additions & 0 deletions lib/components/HighlighterOverlayView.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ HighlighterOverlayView.propTypes = {
innerPadding: PropTypes.number,
};

HighlighterOverlayView.displayName = 'IGNORE';

export default HighlighterOverlayView;
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import CustomKeyboardViewBase from './CustomKeyboardViewBase';
const CustomKeyboardViewNativeAndroid = requireNativeComponent('CustomKeyboardViewNativeTemp');

export default class CustomKeyboardView extends CustomKeyboardViewBase {
static displayName = 'IGNORE';
static propTypes = {
initialProps: PropTypes.object,
component: PropTypes.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import KeyboardRegistry from './KeyboardRegistry';
import CustomKeyboardViewBase from './CustomKeyboardViewBase';

export default class CustomKeyboardView extends CustomKeyboardViewBase {
static displayName = 'IGNORE';
static propTypes = {
/**
* The reference to the actual text input (or the keyboard may not reset when instructed to, etc.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {PureComponent} from 'react';
import {View} from 'react-native';

class KeyboardTrackingView extends PureComponent {
static displayName = 'IGNORE';
render() {
return <View {...this.props}/>;
}
Expand Down
1 change: 1 addition & 0 deletions lib/components/WheelPicker/WheelPickerItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {Component} from 'react'; //eslint-disable-line
import PropTypes from 'prop-types';

export default class WheelPickerItem extends Component {
static displayName = 'WheelPicker.Item';
// eslint-disable-line react/no-multi-comp
static propTypes = {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ScrollView} from 'react-native';
import KeyboardAwareBase from './KeyboardAwareBase';

export default class KeyboardAwareListView extends KeyboardAwareBase {
static displayName = 'KeyboardAwareListView';
static displayName = 'IGNORE';

static propTypes = {
onScroll: PropTypes.func
Expand Down
6 changes: 3 additions & 3 deletions src/components/chip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export type ChipPropTypes = ViewProps & TouchableOpacityProps & {
* @extendslink: docs/TouchableOpacity
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ChipScreen.tsx
*/
const Chip: React.FC<ChipPropTypes> = ({
const Chip = ({
avatarProps,
backgroundColor,
badgeProps,
Expand All @@ -146,10 +146,10 @@ const Chip: React.FC<ChipPropTypes> = ({
useSizeAsMinimum,
testID,
...others
}) => {
}: ChipPropTypes) => {

const renderIcon = useCallback((iconPosition) => {
const isLeftIcon = iconPosition === 'left'
const isLeftIcon = iconPosition === 'left';

return (
<Image
Expand Down
6 changes: 5 additions & 1 deletion src/components/dialog/OverlayFadingBackground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {
overlayBackgroundColor: string;
}

export default ({
const OverlayFadingBackground = ({
dialogVisibility,
modalVisibility,
overlayBackgroundColor
Expand Down Expand Up @@ -44,3 +44,7 @@ export default ({

return <View absF animated style={style} pointerEvents="none"/>;
};

OverlayFadingBackground.displayName = 'IGNORE';

export default OverlayFadingBackground;
1 change: 1 addition & 0 deletions src/components/drawer/Swipeable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type StateType = {
};

export default class Swipeable extends Component<PropType, StateType> {
static displayName = 'IGNORE';
static defaultProps = {
friction: 1,
overshootFriction: 1,
Expand Down
1 change: 1 addition & 0 deletions src/components/picker/NativePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import TouchableOpacity from '../touchableOpacity';
import {Colors} from '../../style';

class NativePicker extends BaseComponent {
static displayName = 'IGNORE';
state = {
selectedValue: this.props.value,
items: this.extractPickerItems(this.props),
Expand Down
1 change: 1 addition & 0 deletions src/components/picker/PickerDialog.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {Colors, BorderRadiuses} from '../../style';
import {WheelPicker} from '../../nativeComponents';

class PickerDialog extends BaseComponent {
static displayName = 'IGNORE';
static propTypes = {
selectedValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
onValueChange: PropTypes.func,
Expand Down
1 change: 1 addition & 0 deletions src/components/picker/PickerDialog.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {Colors} from '../../style';
import {WheelPicker} from '../../nativeComponents';

class PickerDialog extends BaseComponent {
static displayName = 'IGNORE';
static propTypes = {
selectedValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
onValueChange: PropTypes.func,
Expand Down
2 changes: 2 additions & 0 deletions src/components/scrollBar/ScrollBarGradient.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ const ScrollBarGradient = ({
);
};

ScrollBarGradient.displayName = 'IGNORE';

export default ScrollBarGradient;
1 change: 1 addition & 0 deletions src/components/scrollBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,6 @@ const Item = ({children, index, onLayout}) => {
);
};

Item.displayName = 'IGNORE';
ScrollBar.Item = Item;
export default forwardRef(ScrollBar);
1 change: 1 addition & 0 deletions src/components/slider/context/SliderGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import View from '../../view';


export default class SliderGroup extends Component {
static displayName = 'IGNORE';
static propTypes = {
color: PropTypes.string,
onValueChange: PropTypes.func
Expand Down
11 changes: 11 additions & 0 deletions uilib-docs/configurations/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ const componentsDocgenPlugin = [
}
];

const nativeComponentsDocgenPlugin = [
'gatsby-transformer-react-docgen',
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/../../lib/components/`
}
}
];

const imagesPlugin = [
{
resolve: `gatsby-source-filesystem`,
Expand All @@ -59,6 +69,7 @@ module.exports = {
manifestPlugin,
markdownPagesPlugin,
componentsDocgenPlugin,
nativeComponentsDocgenPlugin,
imagesPlugin,
layoutPlugin
};
3 changes: 2 additions & 1 deletion uilib-docs/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {manifestPlugin, markdownPagesPlugin, componentsDocgenPlugin, imagesPlugin, layoutPlugin} = require('./configurations/plugins');
const {manifestPlugin, markdownPagesPlugin, componentsDocgenPlugin, nativeComponentsDocgenPlugin, imagesPlugin, layoutPlugin} = require('./configurations/plugins');

module.exports = {
pathPrefix: '/react-native-ui-lib',
Expand All @@ -12,6 +12,7 @@ module.exports = {
`gatsby-plugin-sass`,
...markdownPagesPlugin,
...componentsDocgenPlugin,
...nativeComponentsDocgenPlugin,
...imagesPlugin,
...manifestPlugin,
...layoutPlugin
Expand Down