mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
LogBox - Add build version and open in browser
Summary: Adds build version and an onPress for the build info. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D19334440 fbshipit-source-id: b201b630086179faca31a08c62019a2019cedf4f
This commit is contained in:
1 parent
1947e1684f
commit
044991a93f
2 files changed
+20
-3
No files matched your search
@@ -60,6 +60,7 @@ export type WarningFilter = (format: string) => WarningInfo;
|
||||
type AppInfo = $ReadOnly<{|
|
||||
appVersion: string,
|
||||
engine: string,
|
||||
onPress?: ?() => void,
|
||||
|}>;
|
||||
|
||||
const observers: Set<{observer: Observer, ...}> = new Set();
|
||||
|
||||
@@ -87,9 +87,19 @@ function AppInfo() {
|
||||
}
|
||||
|
||||
return (
|
||||
<Text style={appInfoStyles.text}>
|
||||
{appInfo.appVersion} ({appInfo.engine})
|
||||
</Text>
|
||||
<LogBoxButton
|
||||
backgroundColor={{
|
||||
default: 'transparent',
|
||||
pressed: appInfo.onPress
|
||||
? LogBoxStyle.getBackgroundColor(1)
|
||||
: 'transparent',
|
||||
}}
|
||||
style={appInfoStyles.buildButton}
|
||||
onPress={appInfo.onPress}>
|
||||
<Text style={appInfoStyles.text}>
|
||||
{appInfo.appVersion} ({appInfo.engine})
|
||||
</Text>
|
||||
</LogBoxButton>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -98,8 +108,14 @@ const appInfoStyles = StyleSheet.create({
|
||||
color: LogBoxStyle.getTextColor(0.4),
|
||||
fontSize: 12,
|
||||
lineHeight: 12,
|
||||
},
|
||||
buildButton: {
|
||||
flex: 0,
|
||||
flexGrow: 0,
|
||||
paddingVertical: 4,
|
||||
paddingHorizontal: 5,
|
||||
borderRadius: 5,
|
||||
marginRight: -8,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user