Repository navigation
Expand file tree
/
Copy pathBottomDialog.js
More file actions
executable file
·80 lines (73 loc) · 1.73 KB
/
Copy pathBottomDialog.js
File metadata and controls
executable file
·80 lines (73 loc) · 1.73 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
74
75
76
77
78
79
80
/*
Copyright © SuperMap. All rights reserved.
Author: Yang Shanglong
E-mail: yangshanglong@supermap.com
*/
import React, { PureComponent } from 'react'
import { Text, ScrollView, StyleSheet } from 'react-native'
import Dialog from './Dialog'
import { scaleSize } from '../../utils'
const styles = StyleSheet.create({
container: {
position: 'absolute',
backgroundColor: 'transparent',
zIndex: 1000,
top: 0,
left: 0,
right: 0,
bottom: 0,
},
content: {
height: scaleSize(200),
backgroundColor: 'white',
},
})
export default class BottomDialog extends PureComponent {
props: {
confirmAction: () => {},
cancelAction: () => {},
workspace: boolean,
placeholder: string,
title: string,
textStyle: string,
}
static defaultProps = {
label: '',
}
constructor(props) {
super(props)
this.state = {
value: '',
}
}
setVisible(visible) {
this.dialog && this.dialog.setDialogVisible(visible)
}
confirm = () => {
this.props.confirmAction && this.props.confirmAction(this.state.value)
}
cancel = () => {
this.props.cancelAction && this.props.cancelAction()
}
render() {
return (
<Dialog
ref={ref => (this.dialog = ref)}
title={this.props.title}
style={{ height: scaleSize(240) }}
opacityStyle={{ height: scaleSize(240) }}
confirmAction={this.confirm}
cancelAction={this.cancel}
confirmBtnTitle={'保存'}
cancelBtnTitle={'清除'}
type={Dialog.Type.MODAL}
>
<ScrollView style={styles.content}>
<Text style={[styles.title, this.props.textStyle]}>
{this.state.autioText}
</Text>
</ScrollView>
</Dialog>
)
}
}