-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
39 lines (31 loc) · 893 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// import { NativeModules } from 'react-native';
// const { RNSuperEllipseMask } = NativeModules;
// export default RNSuperEllipseMask;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { requireNativeComponent } from 'react-native';
const SuperEllipseMask = requireNativeComponent(
'SuperEllipseMask',
SuperEllipseMaskView
);
export default class SuperEllipseMaskView extends Component {
render() {
const { radius, ...rest } = this.props;
let r = {
topLeft: radius,
topRight: radius,
bottomLeft: radius,
bottomRight: radius,
};
if (typeof radius == 'object') {
r = radius;
}
return <SuperEllipseMask {...rest} {...r} />;
}
}
SuperEllipseMaskView.propTypes = {
topLeft: PropTypes.number,
topRight: PropTypes.number,
bottomRight: PropTypes.number,
bottomLeft: PropTypes.number,
};