-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create more mobile-friendly version of the platform test results UI
Summary: Changelog: [RNTester][Internal] - Create more mobile-friendly version of the platform test results UI The original UI design for displaying the test results was done with only really tablets in mind so in order to better accomidate mobile screen sizes this diff adds a new expanding UI for the test results. Reviewed By: lunaleaps Differential Revision: D37701638 fbshipit-source-id: a1789abb15db7ab162fe90afc32d23c435f1bdb5
- Loading branch information
1 parent
fba485a
commit 8bb0a9f
Showing
3 changed files
with
230 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
...n-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestMinimizedResultView.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/** | ||
* 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. | ||
* | ||
* @format | ||
* @flow | ||
*/ | ||
|
||
import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; | ||
|
||
import * as React from 'react'; | ||
import {View, Text, StyleSheet, TouchableHighlight} from 'react-native'; | ||
|
||
type Props = $ReadOnly<{| | ||
numFail: number, | ||
numError: number, | ||
numPass: number, | ||
numPending: number, | ||
onPress?: () => void, | ||
style?: ?ViewStyleProp, | ||
|}>; | ||
export default function RNTesterPlatformTestMinimizedResultView({ | ||
numFail, | ||
numError, | ||
numPass, | ||
numPending, | ||
onPress, | ||
style, | ||
}: Props): React.MixedElement { | ||
return ( | ||
<TouchableHighlight onPress={onPress} style={[styles.root, style]}> | ||
<View style={styles.innerContainer}> | ||
<View style={styles.statsContainer}> | ||
<Text style={styles.summaryText}> | ||
{numPass} <Text style={styles.passText}>Pass</Text> | ||
</Text> | ||
<Text style={styles.summaryText}> | ||
{numFail} <Text style={styles.failText}>Fail</Text> | ||
</Text> | ||
<Text style={styles.summaryText}> | ||
{numError} <Text style={styles.errorText}>Error</Text> | ||
</Text> | ||
<Text style={styles.summaryText}> | ||
{numPending} <Text style={styles.pendingText}>Pending</Text> | ||
</Text> | ||
</View> | ||
<Text style={styles.caret}>⌃</Text> | ||
</View> | ||
</TouchableHighlight> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
caret: { | ||
fontSize: 24, | ||
transform: [{translateY: 4}], | ||
marginEnd: 8, | ||
opacity: 0.5, | ||
}, | ||
errorText: { | ||
color: 'orange', | ||
}, | ||
failText: { | ||
color: 'red', | ||
}, | ||
innerContainer: { | ||
width: '100%', | ||
height: '100%', | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
paddingHorizontal: 8, | ||
backgroundColor: 'white', | ||
}, | ||
passText: { | ||
color: 'green', | ||
}, | ||
pendingText: { | ||
color: 'gray', | ||
}, | ||
root: { | ||
borderTopColor: 'rgb(171, 171, 171)', | ||
borderTopWidth: StyleSheet.hairlineWidth, | ||
minHeight: 60, | ||
}, | ||
statsContainer: { | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
justifyContent: 'flex-start', | ||
}, | ||
summaryText: { | ||
marginStart: 8, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters