Skip to content

Commit 4f36797

Browse files
authored
Fix missing dev page in some components (#3646)
* Fix failing docs build * bump version 3.17 * Rever BrowserOnly change
1 parent 7733575 commit 4f36797

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

docuilib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uilib-docs",
3-
"version": "3.16.0",
3+
"version": "3.17.0",
44
"main": "./src/index.ts",
55
"scripts": {
66
"docusaurus": "docusaurus",

docuilib/src/components/ComponentPage.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function ComponentPage({component}) {
4949
/** Tabs */
5050

5151
const getTabItems = tabs => {
52-
return _.map(tabs, (tab) => {
52+
return _.map(tabs, tab => {
5353
return (
5454
<TabItem value={tab.title.toLowerCase()} label={tab.title} attributes={{className: 'single-tab'}}>
5555
{buildDocsSections(tab.sections)}
@@ -61,11 +61,16 @@ export default function ComponentPage({component}) {
6161
const buildTabs = () => {
6262
const tabs = component.docs?.tabs ?? [];
6363
const api = component.props;
64-
const tabsArray = !_.isEmpty(api) ? [...tabs, devTab] : tabs;
65-
64+
// Note: empty props arrays is valid (we have some cases with components without props that should show Dev tab)
65+
const tabsArray = api !== undefined ? [...tabs, devTab] : tabs;
66+
6667
// TODO: align Tabs bottom border with TabItem's selected indication line
6768
if (!_.isEmpty(tabsArray)) {
68-
return <Tabs queryString="tab" className="main-tabs">{getTabItems(tabsArray)}</Tabs>;
69+
return (
70+
<Tabs queryString="tab" className="main-tabs">
71+
{getTabItems(tabsArray)}
72+
</Tabs>
73+
);
6974
}
7075
};
7176

src/components/tabController/apis/pageCarousel.api.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
"extendsLink": ["https://reactnative.dev/docs/scrollview"],
88
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabControllerScreen/index.tsx",
99
"images": [],
10+
"props": [],
1011
"snippet": [
11-
"<TabController.PageCarousel>",
12-
" {_.map(items, (item, key) => {",
13-
" return ($1);",
14-
" })}",
15-
"</TabController.PageCarousel>"
12+
"<TabController>",
13+
" <TabController.PageCarousel>",
14+
" {_.map(items, (item, key) => {",
15+
" return <TabController.TabPage index={key}/>;",
16+
" })}",
17+
" </TabController.PageCarousel>",
18+
"</TabController>"
1619
]
1720
}

0 commit comments

Comments
 (0)