Repository navigation
Expand file tree
/
Copy pathRecordButton.js
More file actions
73 lines (68 loc) · 1.67 KB
/
Copy pathRecordButton.js
File metadata and controls
73 lines (68 loc) · 1.67 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import * as React from 'react'
import { StyleSheet, TouchableOpacity } from 'react-native'
import { scaleSize } from '../../utils/index'
// import { Bar } from 'react-native-progress'
const styles = StyleSheet.create({
container: {
// flex: 1,
flexDirection: 'column',
backgroundColor: 'transparent',
},
imageSm: {
height: scaleSize(60),
width: scaleSize(60),
alignSelf: 'center',
},
imageLg: {
height: scaleSize(80),
width: scaleSize(80),
alignSelf: 'center',
},
text: {
backgroundColor: 'transparent',
textAlign: 'center',
},
})
export default class RecordButton extends React.Component {
props: {
style: any,
onPress: () => {},
image: any,
title: string,
imageStyle: any,
titleStyle: any,
size: string,
disable: boolean,
}
static defaultProps = {
size: 'large',
disable: false,
}
action = () => {
if (this.props.disable) return
this.props.onPress && this.props.onPress()
}
render() {
// let imgStyle = this.props.size === 'small' ? styles.imageSm : styles.imageLg
return (
<TouchableOpacity
activeOpacity={this.props.disable ? 1 : 0.8}
disable={this.props.disable}
accessible={true}
accessibilityLabel={this.props.title}
style={[styles.container, this.props.style]}
onPress={this.action}
>
{/*<Bar*/}
{/*style={styles.progress}*/}
{/*// indeterminate={true}*/}
{/*progress={*/}
{/*this.props.online.share[this.props.online.share.length - 1]*/}
{/*.progress*/}
{/*}*/}
{/*width={scaleSize(60)}*/}
{/*/>*/}
</TouchableOpacity>
)
}
}