mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 19:44:13 +00:00
2ae73ffa00
Summary: Button is an important component to help the community get onboarded with RN quickly, so the first few minutes of a developer's experience is not spent formatting a simple button component. In my opinion, `<Button />` should be seen as a "lowest common demoniator" component, rather than "the one button to rule them all". In other words, we should only support features in Button that will work on any platform. We should encourage people to fork Button if they need to add specific features to it, rather than trying to twist and bloat this component until it supports everything. These platform imitations may not have the perfect constants just yet, but they are good enough to make a user feel at home in the app, without any modification. The community can help tweak the final formatting to make them look just right- PRs are welcome! Reviewed By: frantic Differential Revision: D3929041 fbshipit-source-id: 3785fb67472a7614eeee0a9aef504c0bdf62ede7
309 lines
6.7 KiB
JavaScript
309 lines
6.7 KiB
JavaScript
/**
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* The examples provided by Facebook are for non-commercial testing and
|
|
* evaluation purposes only.
|
|
*
|
|
* Facebook reserves all rights not expressly granted.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
|
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
*
|
|
* @flow
|
|
*/
|
|
'use strict';
|
|
|
|
export type UIExplorerExample = {
|
|
key: string,
|
|
module: Object,
|
|
};
|
|
|
|
const ComponentExamples: Array<UIExplorerExample> = [
|
|
{
|
|
key: 'ActivityIndicatorExample',
|
|
module: require('./ActivityIndicatorExample'),
|
|
},
|
|
{
|
|
key: 'ButtonExample',
|
|
module: require('./ButtonExample'),
|
|
},
|
|
{
|
|
key: 'DatePickerIOSExample',
|
|
module: require('./DatePickerIOSExample'),
|
|
},
|
|
{
|
|
key: 'ImageExample',
|
|
module: require('./ImageExample'),
|
|
},
|
|
{
|
|
key: 'KeyboardAvoidingViewExample',
|
|
module: require('./KeyboardAvoidingViewExample'),
|
|
},
|
|
{
|
|
key: 'LayoutEventsExample',
|
|
module: require('./LayoutEventsExample'),
|
|
},
|
|
{
|
|
key: 'ListViewExample',
|
|
module: require('./ListViewExample'),
|
|
},
|
|
{
|
|
key: 'ListViewGridLayoutExample',
|
|
module: require('./ListViewGridLayoutExample'),
|
|
},
|
|
{
|
|
key: 'ListViewPagingExample',
|
|
module: require('./ListViewPagingExample'),
|
|
},
|
|
{
|
|
key: 'MapViewExample',
|
|
module: require('./MapViewExample'),
|
|
},
|
|
{
|
|
key: 'ModalExample',
|
|
module: require('./ModalExample'),
|
|
},
|
|
{
|
|
key: 'NavigatorExample',
|
|
module: require('./Navigator/NavigatorExample'),
|
|
},
|
|
{
|
|
key: 'NavigatorIOSColorsExample',
|
|
module: require('./NavigatorIOSColorsExample'),
|
|
},
|
|
{
|
|
key: 'NavigatorIOSExample',
|
|
module: require('./NavigatorIOSExample'),
|
|
},
|
|
{
|
|
key: 'PickerExample',
|
|
module: require('./PickerExample'),
|
|
},
|
|
{
|
|
key: 'PickerIOSExample',
|
|
module: require('./PickerIOSExample'),
|
|
},
|
|
{
|
|
key: 'ProgressViewIOSExample',
|
|
module: require('./ProgressViewIOSExample'),
|
|
},
|
|
{
|
|
key: 'RefreshControlExample',
|
|
module: require('./RefreshControlExample'),
|
|
},
|
|
{
|
|
key: 'ScrollViewExample',
|
|
module: require('./ScrollViewExample'),
|
|
},
|
|
{
|
|
key: 'SegmentedControlIOSExample',
|
|
module: require('./SegmentedControlIOSExample'),
|
|
},
|
|
{
|
|
key: 'SliderExample',
|
|
module: require('./SliderExample'),
|
|
},
|
|
{
|
|
key: 'StatusBarExample',
|
|
module: require('./StatusBarExample'),
|
|
},
|
|
{
|
|
key: 'SwipeableListViewExample',
|
|
module: require('./SwipeableListViewExample')
|
|
},
|
|
{
|
|
key: 'SwitchExample',
|
|
module: require('./SwitchExample'),
|
|
},
|
|
{
|
|
key: 'TabBarIOSExample',
|
|
module: require('./TabBarIOSExample'),
|
|
},
|
|
{
|
|
key: 'TextExample',
|
|
module: require('./TextExample.ios'),
|
|
},
|
|
{
|
|
key: 'TextInputExample',
|
|
module: require('./TextInputExample.ios'),
|
|
},
|
|
{
|
|
key: 'TouchableExample',
|
|
module: require('./TouchableExample'),
|
|
},
|
|
{
|
|
key: 'TransparentHitTestExample',
|
|
module: require('./TransparentHitTestExample'),
|
|
},
|
|
{
|
|
key: 'ViewExample',
|
|
module: require('./ViewExample'),
|
|
},
|
|
{
|
|
key: 'WebViewExample',
|
|
module: require('./WebViewExample'),
|
|
},
|
|
];
|
|
|
|
const APIExamples: Array<UIExplorerExample> = [
|
|
{
|
|
key: 'AccessibilityIOSExample',
|
|
module: require('./AccessibilityIOSExample'),
|
|
},
|
|
{
|
|
key: 'ActionSheetIOSExample',
|
|
module: require('./ActionSheetIOSExample'),
|
|
},
|
|
{
|
|
key: 'AdSupportIOSExample',
|
|
module: require('./AdSupportIOSExample'),
|
|
},
|
|
{
|
|
key: 'AlertExample',
|
|
module: require('./AlertExample').AlertExample,
|
|
},
|
|
{
|
|
key: 'AlertIOSExample',
|
|
module: require('./AlertIOSExample'),
|
|
},
|
|
{
|
|
key: 'AnimatedExample',
|
|
module: require('./AnimatedExample'),
|
|
},
|
|
{
|
|
key: 'AnExApp',
|
|
module: require('./AnimatedGratuitousApp/AnExApp'),
|
|
},
|
|
{
|
|
key: 'AppStateExample',
|
|
module: require('./AppStateExample'),
|
|
},
|
|
{
|
|
key: 'AsyncStorageExample',
|
|
module: require('./AsyncStorageExample'),
|
|
},
|
|
{
|
|
key: 'BorderExample',
|
|
module: require('./BorderExample'),
|
|
},
|
|
{
|
|
key: 'BoxShadowExample',
|
|
module: require('./BoxShadowExample'),
|
|
},
|
|
{
|
|
key: 'CameraRollExample',
|
|
module: require('./CameraRollExample'),
|
|
},
|
|
{
|
|
key: 'ClipboardExample',
|
|
module: require('./ClipboardExample'),
|
|
},
|
|
{
|
|
key: 'GeolocationExample',
|
|
module: require('./GeolocationExample'),
|
|
},
|
|
{
|
|
key: 'ImageEditingExample',
|
|
module: require('./ImageEditingExample'),
|
|
},
|
|
{
|
|
key: 'LayoutAnimationExample',
|
|
module: require('./LayoutAnimationExample'),
|
|
},
|
|
{
|
|
key: 'LayoutExample',
|
|
module: require('./LayoutExample'),
|
|
},
|
|
{
|
|
key: 'LinkingExample',
|
|
module: require('./LinkingExample'),
|
|
},
|
|
{
|
|
key: 'NativeAnimationsExample',
|
|
module: require('./NativeAnimationsExample'),
|
|
},
|
|
{
|
|
key: 'NavigationExperimentalExample',
|
|
module: require('./NavigationExperimental/NavigationExperimentalExample'),
|
|
},
|
|
{
|
|
key: 'NetInfoExample',
|
|
module: require('./NetInfoExample'),
|
|
},
|
|
{
|
|
key: 'OrientationChangeExample',
|
|
module: require('./OrientationChangeExample'),
|
|
},
|
|
{
|
|
key: 'PanResponderExample',
|
|
module: require('./PanResponderExample'),
|
|
},
|
|
{
|
|
key: 'PointerEventsExample',
|
|
module: require('./PointerEventsExample'),
|
|
},
|
|
{
|
|
key: 'PushNotificationIOSExample',
|
|
module: require('./PushNotificationIOSExample'),
|
|
},
|
|
{
|
|
key: 'RCTRootViewIOSExample',
|
|
module: require('./RCTRootViewIOSExample'),
|
|
},
|
|
{
|
|
key: 'RTLExample',
|
|
module: require('./RTLExample'),
|
|
},
|
|
{
|
|
key: 'ShareExample',
|
|
module: require('./ShareExample'),
|
|
},
|
|
{
|
|
key: 'SnapshotExample',
|
|
module: require('./SnapshotExample'),
|
|
},
|
|
{
|
|
key: 'TimerExample',
|
|
module: require('./TimerExample'),
|
|
},
|
|
{
|
|
key: 'TransformExample',
|
|
module: require('./TransformExample'),
|
|
},
|
|
{
|
|
key: 'VibrationExample',
|
|
module: require('./VibrationExample'),
|
|
},
|
|
{
|
|
key: 'WebSocketExample',
|
|
module: require('./WebSocketExample'),
|
|
},
|
|
{
|
|
key: 'XHRExample',
|
|
module: require('./XHRExample.ios'),
|
|
},
|
|
];
|
|
|
|
const Modules = {};
|
|
|
|
APIExamples.concat(ComponentExamples).forEach(Example => {
|
|
Modules[Example.key] = Example.module;
|
|
});
|
|
|
|
const UIExplorerList = {
|
|
APIExamples,
|
|
ComponentExamples,
|
|
Modules,
|
|
};
|
|
|
|
module.exports = UIExplorerList;
|