mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-22 11:16:55 +08:00
Reorganizes and rewrites the benchmarks. Each implementation is now self-contained and the benchmarks can be run using a GUI. The benchmarks themselves have been changed so that individual tests render over a shorter time frame and more samples are taken.
51 lines
889 B
JavaScript
51 lines
889 B
JavaScript
/* eslint-disable react/prop-types */
|
|
import React from 'react';
|
|
import View from './View';
|
|
import { StyleSheet } from 'aphrodite';
|
|
|
|
const Box = ({ color, fixed = false, layout = 'column', outer = false, ...other }) => (
|
|
<View
|
|
{...other}
|
|
style={[
|
|
styles[`color${color}`],
|
|
fixed && styles.fixed,
|
|
layout === 'row' && styles.row,
|
|
outer && styles.outer
|
|
]}
|
|
/>
|
|
);
|
|
|
|
const styles = StyleSheet.create({
|
|
outer: {
|
|
alignSelf: 'flex-start',
|
|
padding: 4
|
|
},
|
|
row: {
|
|
flexDirection: 'row'
|
|
},
|
|
color0: {
|
|
backgroundColor: '#14171A'
|
|
},
|
|
color1: {
|
|
backgroundColor: '#AAB8C2'
|
|
},
|
|
color2: {
|
|
backgroundColor: '#E6ECF0'
|
|
},
|
|
color3: {
|
|
backgroundColor: '#FFAD1F'
|
|
},
|
|
color4: {
|
|
backgroundColor: '#F45D22'
|
|
},
|
|
color5: {
|
|
backgroundColor: '#E0245E'
|
|
},
|
|
fixed: {
|
|
width: 6,
|
|
height: 6
|
|
}
|
|
});
|
|
|
|
export default Box;
|