mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-16 04:10:30 +00:00
[change] Remove platform-specific exports
This commit is contained in:
committed by
Nicolas Gallagher
parent
bf24fb5a3a
commit
3a024ee308
@@ -7,14 +7,11 @@ module.exports = {
|
||||
AppRegistry: true,
|
||||
AppState: true,
|
||||
Appearance: true,
|
||||
BackHandler: true,
|
||||
Button: true,
|
||||
CheckBox: true,
|
||||
Clipboard: true,
|
||||
DeviceEventEmitter: true,
|
||||
DeviceInfo: true,
|
||||
Dimensions: true,
|
||||
DrawerLayoutAndroid: true,
|
||||
Easing: true,
|
||||
FlatList: true,
|
||||
I18nManager: true,
|
||||
@@ -31,7 +28,6 @@ module.exports = {
|
||||
NativeEventEmitter: true,
|
||||
NativeModules: true,
|
||||
PanResponder: true,
|
||||
PermissionsAndroid: true,
|
||||
Picker: true,
|
||||
PixelRatio: true,
|
||||
Platform: true,
|
||||
@@ -41,16 +37,12 @@ module.exports = {
|
||||
SafeAreaView: true,
|
||||
ScrollView: true,
|
||||
SectionList: true,
|
||||
Settings: true,
|
||||
Share: true,
|
||||
StatusBar: true,
|
||||
StyleSheet: true,
|
||||
Switch: true,
|
||||
Systrace: true,
|
||||
TVEventHandler: true,
|
||||
Text: true,
|
||||
TextInput: true,
|
||||
ToastAndroid: true,
|
||||
Touchable: true,
|
||||
TouchableHighlight: true,
|
||||
TouchableNativeFeedback: true,
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
function emptyFunction() {}
|
||||
|
||||
const BackHandler = {
|
||||
exitApp: emptyFunction,
|
||||
addEventListener(): {| remove: () => void |} {
|
||||
return {
|
||||
remove: emptyFunction
|
||||
};
|
||||
},
|
||||
removeEventListener: emptyFunction
|
||||
};
|
||||
|
||||
export default BackHandler;
|
||||
@@ -1,57 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import type { DisplayMetrics } from '../Dimensions';
|
||||
|
||||
import Dimensions from '../Dimensions';
|
||||
import canUseDOM from '../../modules/canUseDom';
|
||||
|
||||
const DeviceInfo = {
|
||||
Dimensions: {
|
||||
get windowPhysicalPixels(): DisplayMetrics {
|
||||
const { width, height, fontScale, scale } = Dimensions.get('window');
|
||||
return {
|
||||
width: width * scale,
|
||||
height: height * scale,
|
||||
scale,
|
||||
fontScale
|
||||
};
|
||||
},
|
||||
get screenPhysicalPixels(): DisplayMetrics {
|
||||
const { width, height, fontScale, scale } = Dimensions.get('screen');
|
||||
return {
|
||||
width: width * scale,
|
||||
height: height * scale,
|
||||
scale,
|
||||
fontScale
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
get locale(): string | void {
|
||||
if (canUseDOM) {
|
||||
if (navigator.languages) {
|
||||
return navigator.languages[0];
|
||||
} else {
|
||||
return navigator.language;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
get totalMemory(): number | void {
|
||||
// $FlowIssue deviceMemory not defined in navigator
|
||||
return canUseDOM ? navigator.deviceMemory : undefined;
|
||||
},
|
||||
|
||||
get userAgent(): string {
|
||||
return canUseDOM ? navigator.userAgent : '';
|
||||
}
|
||||
};
|
||||
|
||||
export default DeviceInfo;
|
||||
@@ -1,2 +0,0 @@
|
||||
import UnimplementedView from '../../modules/UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
@@ -1,10 +0,0 @@
|
||||
const promiseMock = () => Promise.resolve(false);
|
||||
export default {
|
||||
PERMISSIONS: {},
|
||||
RESULTS: {},
|
||||
checkPermission: promiseMock,
|
||||
check: promiseMock,
|
||||
requestPermission: promiseMock,
|
||||
request: promiseMock,
|
||||
requestMultiple: promiseMock
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
export default {};
|
||||
@@ -1 +0,0 @@
|
||||
export default {};
|
||||
@@ -1 +0,0 @@
|
||||
export default {};
|
||||
@@ -1,2 +0,0 @@
|
||||
import UnimplementedView from '../../modules/UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
-12
@@ -13,9 +13,7 @@ export { default as Animated } from './exports/Animated';
|
||||
export { default as Appearance } from './exports/Appearance';
|
||||
export { default as AppRegistry } from './exports/AppRegistry';
|
||||
export { default as AppState } from './exports/AppState';
|
||||
export { default as BackHandler } from './exports/BackHandler';
|
||||
export { default as Clipboard } from './exports/Clipboard';
|
||||
export { default as DeviceInfo } from './exports/DeviceInfo';
|
||||
export { default as Dimensions } from './exports/Dimensions';
|
||||
export { default as Easing } from './exports/Easing';
|
||||
export { default as I18nManager } from './exports/I18nManager';
|
||||
@@ -62,16 +60,6 @@ export { default as VirtualizedList } from './exports/VirtualizedList';
|
||||
export { default as YellowBox } from './exports/YellowBox';
|
||||
export { default as LogBox } from './exports/LogBox';
|
||||
|
||||
// compat (components)
|
||||
export { default as DrawerLayoutAndroid } from './exports/DrawerLayoutAndroid';
|
||||
export { default as InputAccessoryView } from './exports/InputAccessoryView';
|
||||
export { default as ToastAndroid } from './exports/ToastAndroid';
|
||||
// compat (apis)
|
||||
export { default as PermissionsAndroid } from './exports/PermissionsAndroid';
|
||||
export { default as Settings } from './exports/Settings';
|
||||
export { default as Systrace } from './exports/Systrace';
|
||||
export { default as TVEventHandler } from './exports/TVEventHandler';
|
||||
|
||||
// plugins
|
||||
export { default as DeviceEventEmitter } from './exports/DeviceEventEmitter';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user