-
Notifications
You must be signed in to change notification settings - Fork 3k
/
index.js
39 lines (35 loc) · 1.1 KB
/
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 React, {PureComponent} from 'react';
import {Animated} from 'react-native';
import styles from '../../../styles/styles';
import {propTypes, defaultProps} from './TextInputLabelPropTypes';
class TextInputLabel extends PureComponent {
componentDidMount() {
if (!this.props.for) {
return;
}
this.label.setNativeProps({for: this.props.for});
}
render() {
return (
<Animated.Text
pointerEvents="none"
accessibilityRole="label"
ref={el => this.label = el}
style={[
styles.textInputLabel,
styles.textInputLabelDesktop,
styles.textInputLabelTransformation(
this.props.labelTranslateY,
0,
this.props.labelScale,
),
]}
>
{this.props.label}
</Animated.Text>
);
}
}
TextInputLabel.propTypes = propTypes;
TextInputLabel.defaultProps = defaultProps;
export default TextInputLabel;