Back out "Show FB internal instructions by default on "Getting Started" page"
Summary: Unfortunately optional require does not work with docusaurus bundler configuration in case file not exist, so open source build is failing now. I'm backing out this commit until solution for dynamic imports in docusaurus found. Reviewed By: mweststrate Differential Revision: D23679198 fbshipit-source-id: 9be008f19b5945d17ec31614a8d2cb80bad9ca2e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
643a656cd9
commit
d468d94363
@@ -29,6 +29,7 @@ module.exports = {
|
||||
},
|
||||
setup: {
|
||||
'Getting Started': [
|
||||
...fbInternalOnly(['getting-started/fb/using-flipper-at-facebook']),
|
||||
'getting-started/index',
|
||||
'getting-started/android-native',
|
||||
'getting-started/ios-native',
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import {isInternal} from 'internaldocs-fb-helpers';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
function createElement(createElement) {
|
||||
if (!createElement) return undefined;
|
||||
if (React.isValidElement(createElement)) {
|
||||
return createElement;
|
||||
}
|
||||
const element = createElement();
|
||||
if (React.isValidElement(element)) {
|
||||
return element;
|
||||
}
|
||||
return React.createElement(element.default || element, {});
|
||||
}
|
||||
|
||||
function FBContent({internal, external}) {
|
||||
if (!isInternal()) {
|
||||
return createElement(external);
|
||||
}
|
||||
if (internal && external) {
|
||||
return (
|
||||
<Tabs
|
||||
defaultValue="internal-docs"
|
||||
values={[
|
||||
{label: 'FB Internal', value: 'internal-docs'},
|
||||
{label: 'Open-Source', value: 'external-docs'},
|
||||
]}>
|
||||
<TabItem value="internal-docs">{createElement(internal)}</TabItem>
|
||||
<TabItem value="external-docs">{createElement(external)}</TabItem>
|
||||
</Tabs>
|
||||
);
|
||||
} else {
|
||||
return createElement(internal || external);
|
||||
}
|
||||
}
|
||||
|
||||
export default FBContent;
|
||||
Reference in New Issue
Block a user