mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-03-27 01:34:17 +08:00
committed by
Nicolas Gallagher
parent
9d8d4057f6
commit
985c1d63b6
26
packages/benchmarks/src/implementations/react-jss/Dot.js
vendored
Normal file
26
packages/benchmarks/src/implementations/react-jss/Dot.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/* eslint-disable react/prop-types */
|
||||
import injectSheet from 'react-jss';
|
||||
import React from 'react';
|
||||
|
||||
const Dot = ({ classes, children }) => <div className={classes.root}>{children}</div>;
|
||||
|
||||
const styles = {
|
||||
root: {
|
||||
position: 'absolute',
|
||||
cursor: 'pointer',
|
||||
width: 0,
|
||||
height: 0,
|
||||
borderColor: 'transparent',
|
||||
borderStyle: 'solid',
|
||||
borderTopWidth: 0,
|
||||
transform: 'translate(50%, 50%)',
|
||||
borderBottomColor: ({ color }) => color,
|
||||
borderRightWidth: ({ size }) => size / 2,
|
||||
borderBottomWidth: ({ size }) => size / 2,
|
||||
borderLeftWidth: ({ size }) => size / 2,
|
||||
marginLeft: ({ x }) => x,
|
||||
marginTop: ({ y }) => y
|
||||
}
|
||||
};
|
||||
|
||||
export default injectSheet(styles)(Dot);
|
||||
@@ -1,9 +1,11 @@
|
||||
import Box from './Box';
|
||||
import Dot from './Dot';
|
||||
import Provider from './Provider';
|
||||
import View from './View';
|
||||
|
||||
export default {
|
||||
Box,
|
||||
Dot,
|
||||
Provider,
|
||||
View
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user