mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-05-24 01:09:12 +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.
36 lines
689 B
JavaScript
36 lines
689 B
JavaScript
/* eslint-disable react/prop-types */
|
|
import React from 'react';
|
|
|
|
const Dot = ({ size, x, y, children, color }) => (
|
|
<div
|
|
style={{
|
|
...styles.root,
|
|
...{
|
|
borderBottomColor: color,
|
|
borderRightWidth: `${size / 2}px`,
|
|
borderBottomWidth: `${size / 2}px`,
|
|
borderLeftWidth: `${size / 2}px`,
|
|
marginLeft: `${x}px`,
|
|
marginTop: `${y}px`
|
|
}
|
|
}}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
|
|
const styles = {
|
|
root: {
|
|
position: 'absolute',
|
|
cursor: 'pointer',
|
|
width: 0,
|
|
height: 0,
|
|
borderColor: 'transparent',
|
|
borderStyle: 'solid',
|
|
borderTopWidth: 0,
|
|
transform: 'translate(50%, 50%)'
|
|
}
|
|
};
|
|
|
|
export default Dot;
|