This repository has been archived by the owner on Jul 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathRNMaterialShadows.js
59 lines (50 loc) · 1.51 KB
/
RNMaterialShadows.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import React, { Component } from "react";
import { StyleSheet, ViewPropTypes, Platform } from "react-native";
import PropTypes from "prop-types";
import { requireNativeComponent } from "react-native";
class RNMaterialShadows extends Component {
render () {
return <MaterialShadows
shadowOffsetX={this.props.shadowOffsetX}
shadowOffsetY={this.props.shadowOffsetY}
shadowAlpha={this.props.shadowAlpha}
calculateAsync={this.props.calculateAsync}
showWhenAllReady={this.props.showWhenAllReady}
animateShadow={this.props.animateShadow}
animationDuration={this.props.animationDuration}
padding={this.props.padding}
style={this.props.style}
>
{this.props.children}
</MaterialShadows>;
}
}
RNMaterialShadows.propTypes = {
...ViewPropTypes,
shadowOffsetX: PropTypes.number,
shadowOffsetY: PropTypes.number,
shadowAlpha: PropTypes.number,
calculateAsync: PropTypes.bool,
showWhenAllReady: PropTypes.bool,
animateShadow: PropTypes.bool,
animationDuration: PropTypes.number,
padding: PropTypes.number
};
RNMaterialShadows.defaultProps = {
shadowOffsetX: -15,
shadowOffsetY: 30,
shadowAlpha: 20,
calculateAsync: true,
showWhenAllReady: true,
animateShadow: true,
animationDuration: 300,
padding: 20
};
const MaterialShadows = requireNativeComponent(
"RNMaterialShadows",
RNMaterialShadows,
{
nativeOnly: { }
}
);
export default RNMaterialShadows;