Skip to content

Commit f76db46

Browse files
authored
Fix issues with docs extend links for various components (#1372)
* Fix issues with docs extend links for various components * Update stars count * Remove commented code
1 parent 1770950 commit f76db46

File tree

28 files changed

+22
-41
lines changed

28 files changed

+22
-41
lines changed

generatedTypes/components/avatar/index.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ export declare type AvatarProps = Pick<AccessibilityProps, 'accessibilityLabel'>
140140
export declare type AvatarPropTypes = AvatarProps;
141141
/**
142142
* @description: Avatar component for displaying user profile images
143-
* @extends: TouchableOpacity
144-
* @extendsnotes: (when passing onPress)
145-
* @extendsLink: docs/TouchableOpacity
143+
* @extends: TouchableOpacity, Image
146144
* @image: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Avatar/Avarat_1.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Avatar/Avarat_2.png?raw=true
147145
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/AvatarsScreen.tsx
148146
*/

generatedTypes/components/carousel/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ declare type DefaultProps = Partial<CarouselProps>;
88
* @gif: https://user-images.githubusercontent.com/1780255/107120258-40b5bc80-6895-11eb-9596-8065d3a940ff.gif, https://user-images.githubusercontent.com/1780255/107120257-3eebf900-6895-11eb-9800-402e9e0dc692.gif
99
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/CarouselScreen.tsx
1010
* @extends: ScrollView
11-
* @extendsLink: https://facebook.github.io/react-native/docs/scrollview
11+
* @extendsLink: https://reactnative.dev/docs/scrollview
1212
* @notes: This is a screen width Component
1313
*/
1414
declare class Carousel extends Component<CarouselProps, CarouselState> {

generatedTypes/components/featureHighlight/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ interface State {
108108
* @notes: 1) FeatureHighlight component must be a direct child of the root view returned in render().; 2) If the element to be highlighted doesn't have a style attribute add 'style={{opacity: 1}}' so the Android OS can detect it.
109109
* @important: FeatureHighlight uses a native library. You MUST add and link the native library to both iOS and Android projects. For instruction please see
110110
* @importantLink: https://facebook.github.io/react-native/docs/linking-libraries-ios.html
111-
* @extends: HighlighterOverlayView
112-
* @extendsLink: docs/HighlighterOverlayView
113111
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/FeatureHighlight/FeatureHighlight.gif?raw=true
114112
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/FeatureHighlightScreen.js
115113
*/

generatedTypes/components/image/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ declare type State = {
5757
/**
5858
* @description: Image wrapper with extra functionality like source transform and assets support
5959
* @extends: Image
60-
* @extendsLink: https://facebook.github.io/react-native/docs/image.html
60+
* @extendsLink: https://reactnative.dev/docs/image
6161
* @notes: please note that for SVG support you need to add both
6262
* `react-native-svg` and `react-native-svg-transformer`,
6363
* and also configure them (see `metro.config.js`)

generatedTypes/components/modal/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface ModalProps extends RNModalProps {
3232
/**
3333
* @description: Component that present content on top of the invoking screen
3434
* @extends: Modal
35-
* @extendsLink: https://facebook.github.io/react-native/docs/modal.html
35+
* @extendsLink: https://reactnative.dev/docs/modal
3636
* @gif: https://media.giphy.com/media/3oFzmfSX8KgvctI4Ks/giphy.gif
3737
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ModalScreen.tsx
3838
*/

generatedTypes/components/overlay/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export declare type OverlayTypes = {
2424
/**
2525
* @description: Overlay view with types (default, top, bottom, solid)
2626
* @extends: Image
27-
* @extendsLink: https://facebook.github.io/react-native/docs/image
27+
* @extendsLink: https://reactnative.dev/docs/image
2828
*/
2929
declare class Overlay extends PureComponent<OverlayTypes> {
3030
static displayName: string;

generatedTypes/components/text/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ declare type PropsTypes = BaseComponentInjectedProps & ForwardRefInjectedProps &
3434
/**
3535
* @description: A wrapper for Text component with extra functionality like modifiers support
3636
* @extends: Text
37-
* @extendsLink: https://facebook.github.io/react-native/docs/text.html
37+
* @extendsLink: https://reactnative.dev/docs/text
3838
* @modifiers: margins, color, typography
3939
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TextScreen.js
4040
* @image: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Text/Modifiers.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Text/Transformation.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Text/Highlights.png?raw=true

src/components/avatar/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ export type AvatarPropTypes = AvatarProps; //TODO: remove after ComponentPropTyp
174174

175175
/**
176176
* @description: Avatar component for displaying user profile images
177-
* @extends: TouchableOpacity
178-
* @extendsnotes: (when passing onPress)
179-
* @extendsLink: docs/TouchableOpacity
177+
* @extends: TouchableOpacity, Image
180178
* @image: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Avatar/Avarat_1.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Avatar/Avarat_2.png?raw=true
181179
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/AvatarsScreen.tsx
182180
*/

src/components/button/ButtonTypes.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ export const DEFAULT_PROPS = {
159159
/**
160160
* @description: Basic button component
161161
* @extends: TouchableOpacity
162-
* @extendsLink: docs/TouchableOpacity
163162
* @modifiers: margin, background
164163
* @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
165164
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Button/Button%20Animated.gif?raw=true

src/components/card/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ type State = {
106106
/**
107107
* @description: Card component
108108
* @extends: TouchableOpacity
109-
* @extendsnotes: (Touchable when passing onPress)
110-
* @extendsLink: docs/TouchableOpacity
111109
* @modifiers: margin, padding
112110
* @image: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Card/Cards_01.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Card/Cards_02.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Card/Cards_03.png?raw=true
113111
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Card/Card_Selecteable.gif, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Card/Cards_activeScale.gif?raw=true

src/components/carousel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type DefaultProps = Partial<CarouselProps>
1818
* @gif: https://user-images.githubusercontent.com/1780255/107120258-40b5bc80-6895-11eb-9596-8065d3a940ff.gif, https://user-images.githubusercontent.com/1780255/107120257-3eebf900-6895-11eb-9800-402e9e0dc692.gif
1919
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/CarouselScreen.tsx
2020
* @extends: ScrollView
21-
* @extendsLink: https://facebook.github.io/react-native/docs/scrollview
21+
* @extendsLink: https://reactnative.dev/docs/scrollview
2222
* @notes: This is a screen width Component
2323
*/
2424
class Carousel extends Component<CarouselProps, CarouselState> {

src/components/checkbox/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ interface CheckboxState {
9393
/**
9494
* @description: Checkbox component for toggling boolean value related to some context
9595
* @extends: TouchableOpacity
96-
* @extendsLink: docs/TouchableOpacity
9796
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/CheckboxScreen.tsx
9897
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Checkbox/Checkbox.gif?raw=true
9998
*/

src/components/chip/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ const DEFAULT_SIZE = 26;
135135
/**
136136
* @description: Chip component
137137
* @extends: TouchableOpacity
138-
* @extendsLink: docs/TouchableOpacity
139138
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ChipScreen.tsx
140139
* @image: https://user-images.githubusercontent.com/1780255/119636022-e9743180-be1c-11eb-8f02-22eeab6558cd.png
141140
*/

src/components/colorPicker/ColorSwatch.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ export const SWATCH_SIZE = DEFAULT_SIZE;
4646
/**
4747
* @description: A color swatch component
4848
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ColorPickerScreen.js
49-
* @extends: Animated.View
50-
* @extendsLink: https://facebook.github.io/react-native/docs/animated
5149
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/ColorPalette/ColorPalette.gif?raw=true
5250
*/
5351
class ColorSwatch extends PureComponent<Props> {

src/components/featureHighlight/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ interface State {
146146
* @notes: 1) FeatureHighlight component must be a direct child of the root view returned in render().; 2) If the element to be highlighted doesn't have a style attribute add 'style={{opacity: 1}}' so the Android OS can detect it.
147147
* @important: FeatureHighlight uses a native library. You MUST add and link the native library to both iOS and Android projects. For instruction please see
148148
* @importantLink: https://facebook.github.io/react-native/docs/linking-libraries-ios.html
149-
* @extends: HighlighterOverlayView
150-
* @extendsLink: docs/HighlighterOverlayView
151149
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/FeatureHighlight/FeatureHighlight.gif?raw=true
152150
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/FeatureHighlightScreen.js
153151
*/

src/components/image/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type State = {
7777
/**
7878
* @description: Image wrapper with extra functionality like source transform and assets support
7979
* @extends: Image
80-
* @extendsLink: https://facebook.github.io/react-native/docs/image.html
80+
* @extendsLink: https://reactnative.dev/docs/image
8181
* @notes: please note that for SVG support you need to add both
8282
* `react-native-svg` and `react-native-svg-transformer`,
8383
* and also configure them (see `metro.config.js`)

src/components/listItem/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import ListItemPart from './ListItemPart';
1010
/**
1111
* @description: List item component to render inside a List component
1212
* @extends: TouchableOpacity
13-
* @extendsLink: docs/TouchableOpacity
1413
* @gif: https://media.giphy.com/media/l1IBjHowyPcOTWAY8/giphy.gif
1514
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/BasicListScreen.js
1615
*/

src/components/modal/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface ModalProps extends RNModalProps {
4141
/**
4242
* @description: Component that present content on top of the invoking screen
4343
* @extends: Modal
44-
* @extendsLink: https://facebook.github.io/react-native/docs/modal.html
44+
* @extendsLink: https://reactnative.dev/docs/modal
4545
* @gif: https://media.giphy.com/media/3oFzmfSX8KgvctI4Ks/giphy.gif
4646
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ModalScreen.tsx
4747
*/

src/components/overlay/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export type OverlayTypes = {
3232
/**
3333
* @description: Overlay view with types (default, top, bottom, solid)
3434
* @extends: Image
35-
* @extendsLink: https://facebook.github.io/react-native/docs/image
35+
* @extendsLink: https://reactnative.dev/docs/image
3636
*/
3737
class Overlay extends PureComponent<OverlayTypes> {
3838
static displayName = 'Overlay';

src/components/picker/PickerItem.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import PickerContext from './PickerContext';
1616
/**
1717
* @description: Picker.Item, for configuring the Picker's selectable options
1818
* @extends: TouchableOpacity
19-
* @extendsLink: docs/TouchableOpacity
2019
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/PickerScreen.js
2120
*/
2221
const PickerItem = props => {

src/components/tabBar/TabBarItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ interface State {
113113
* @description: TabBar.Item, inner component of TabBar for configuring the tabs
114114
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabBarScreen.tsx
115115
* @extends: TouchableOpacity
116-
* @extendsLink: https://facebook.github.io/react-native/docs/touchableopacity
116+
* @extendsLink: https://reactnative.dev/docs/touchableopacity
117117
*/
118118
class TabBarItem extends PureComponent<TabBarItemProps, State> {
119119
static displayName = 'TabBar.Item';

src/components/text/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type PropsTypes = BaseComponentInjectedProps & ForwardRefInjectedProps & TextPro
4747
/**
4848
* @description: A wrapper for Text component with extra functionality like modifiers support
4949
* @extends: Text
50-
* @extendsLink: https://facebook.github.io/react-native/docs/text.html
50+
* @extendsLink: https://reactnative.dev/docs/text
5151
* @modifiers: margins, color, typography
5252
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TextScreen.js
5353
* @image: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Text/Modifiers.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Text/Transformation.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Text/Highlights.png?raw=true

src/components/textField/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const FLOATING_PLACEHOLDER_SCALE = 0.875;
4747
* @description: A wrapper for TextInput component with extra functionality like floating placeholder and validations (This is an uncontrolled component)
4848
* @modifiers: Typography
4949
* @extends: TextInput
50-
* @extendsLink: https://facebook.github.io/react-native/docs/textinput
50+
* @extendsLink: https://reactnative.dev/docs/textinput
5151
* @gif: https://media.giphy.com/media/xULW8su8Cs5Z9Fq4PS/giphy.gif, https://media.giphy.com/media/3ohc1dhDcLS9FvWLJu/giphy.gif, https://media.giphy.com/media/oNUSOxnHdMP5ZnKYsh/giphy.gif
5252
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TextFieldScreen/BasicTextFieldScreen.js
5353
*/

src/components/touchableOpacity/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ type Props = BaseComponentInjectedProps &
5353

5454
/**
5555
* @description: A wrapper for TouchableOpacity component. Support onPress, throttling and activeBackgroundColor
56-
* @extends: TouchableOpacity
5756
* @modifiers: margins, paddings, alignments, background, borderRadius
58-
* @extendsLink: https://facebook.github.io/react-native/docs/touchableopacity.html
57+
* @extends: TouchableOpacity
58+
* @extendsLink: https://reactnative.dev/docs/touchableopacity
5959
* @gif: https://media.giphy.com/media/xULW8AMIgw7l31zjm8/giphy.gif
6060
* @example: https://github.com/wix/react-native-ui-lib/blob/master/src/components/touchableOpacity/index.tsx
6161
*/

src/components/view/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ interface ViewState {
5757
/**
5858
* @description: An enhanced View component
5959
* @extends: View
60-
* @extendsLink: https://facebook.github.io/react-native/docs/view.html
60+
* @extendsLink: https://reactnative.dev/docs/view
6161
* @modifiers: margins, paddings, alignments, background, borderRadius
6262
*/
6363
class View extends PureComponent<PropsTypes, ViewState> {

uilib-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "uilib-docs",
33
"description": "uilib docs template",
4-
"version": "1.0.16",
4+
"version": "1.0.17",
55
"author": "Ethan Sharabi <[email protected]>",
66
"main": "index.js",
77
"dependencies": {

uilib-docs/src/pages/sections/IntroSection.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default () => {
1616
</p>
1717
<div className="git-stars">
1818
<img src={goldStar} alt="gold star" />
19-
<span className="star-count">3.3k</span>
19+
<span className="star-count">3.4k</span>
2020
</div>
2121

2222
<div className="buttons">

uilib-docs/src/templates/component.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,17 @@ export default class ComponentTemplate extends Component {
4848
return _.map(extendedComponents, (component, index) => {
4949
const isLast = index === _.size(extendedComponents) - 1;
5050
const text = `${component}${!isLast ? ', ' : ''}`;
51-
const extendedComponent = _.find(allComponents, c => c.node.displayName.trim() === component.trim());
52-
const path = !extendedComponent && componentInfo.extendsLink ? componentInfo.extendsLink : `/docs/${component}`;
51+
const path = componentInfo.extendsLink ? componentInfo.extendsLink : `/docs/${component}`;
5352

5453
return (
5554
<span className="inline" key={component}>
56-
{extendedComponent && componentInfo.extendsLink ? (
57-
<a href={componentInfo.extendsLink} rel="noopener noreferrer" target="_blank">
55+
{componentInfo.extendsLink ? (
56+
<a href={path} rel="noopener noreferrer" target="_blank">
5857
{text}
5958
</a>
6059
) : (
6160
<Link to={path}>{text}</Link>
6261
)}
63-
{componentInfo.extendsnotes}
6462
<br />
6563
</span>
6664
);

0 commit comments

Comments
 (0)