Commit fc65b4b2 authored by Phuengton Chummuel's avatar Phuengton Chummuel

...

parent fb253d7f
......@@ -8,6 +8,8 @@ import {
} from 'native-base'
import { SinglePickerMaterialDialog } from 'react-native-material-dialog'
import { ToastAndroid } from 'react-native'
import { connect } from 'react-redux'
import { reminderCreate } from './../actions'
import realm from './../Database'
class ReminderDialogForm extends Component {
......@@ -42,12 +44,12 @@ class ReminderDialogForm extends Component {
const dose = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
const { uploadProgress, imageToText } = this.props
const { uploadProgress, imageToText, onOk } = this.props
const Loading = ({ uploadProgress }) => {
return (
<View>
<Text>{"Upload : " + uploadProgress + "%\n"}</Text>
<Text>{"Upload : " + uploadProgress + "%\n" + onOk.toString()}</Text>
</View>
)
}
......@@ -55,7 +57,6 @@ class ReminderDialogForm extends Component {
if (uploadProgress !== "100") {
return <Loading uploadProgress={uploadProgress} />;
} else {
if (imageToText && imageToText.closeMatches != -1) {
return (
<View>
......@@ -109,4 +110,4 @@ class ReminderDialogForm extends Component {
}
}
export default ReminderDialogForm;
\ No newline at end of file
export default connect(null, { reminderCreate })(ReminderDialogForm);
\ No newline at end of file
......@@ -30,10 +30,10 @@ class AppCamera extends Component {
visible: false,
imageToText: "",
uploadProgress: "0",
addReminder: false,
onAddReminder: false,
dataType: '',
qrData: {},
uuid: ''
uuid: '',
}
}
......@@ -72,11 +72,12 @@ class AppCamera extends Component {
<MaterialDialog
title="Add Reminder"
visible={this.state.visible}
onOk={() => this.setState({ visible: false, imageToText: '', uploadProgress: '0' })}
onCancel={() => this.setState({ visible: false, imageToText: '', uploadProgress: '0' })}>
onOk={() => this.setState({ visible: false, imageToText: '', uploadProgress: '0', onAddReminder: true })}
onCancel={() => this.setState({ visible: false, imageToText: '', uploadProgress: '0', onAddReminder: false })}>
<ReminderDialogForm
uploadProgress={this.state.uploadProgress}
imageToText={this.state.imageToText}
onOk={this.state.onAddReminder}
/>
</MaterialDialog>
<MaterialDialog
......@@ -155,9 +156,6 @@ class AppCamera extends Component {
break;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment