Commit fc65b4b2 authored by Phuengton Chummuel's avatar Phuengton Chummuel

...

parent fb253d7f
...@@ -8,6 +8,8 @@ import { ...@@ -8,6 +8,8 @@ import {
} from 'native-base' } from 'native-base'
import { SinglePickerMaterialDialog } from 'react-native-material-dialog' import { SinglePickerMaterialDialog } from 'react-native-material-dialog'
import { ToastAndroid } from 'react-native' import { ToastAndroid } from 'react-native'
import { connect } from 'react-redux'
import { reminderCreate } from './../actions'
import realm from './../Database' import realm from './../Database'
class ReminderDialogForm extends Component { class ReminderDialogForm extends Component {
...@@ -42,12 +44,12 @@ 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 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 }) => { const Loading = ({ uploadProgress }) => {
return ( return (
<View> <View>
<Text>{"Upload : " + uploadProgress + "%\n"}</Text> <Text>{"Upload : " + uploadProgress + "%\n" + onOk.toString()}</Text>
</View> </View>
) )
} }
...@@ -55,7 +57,6 @@ class ReminderDialogForm extends Component { ...@@ -55,7 +57,6 @@ class ReminderDialogForm extends Component {
if (uploadProgress !== "100") { if (uploadProgress !== "100") {
return <Loading uploadProgress={uploadProgress} />; return <Loading uploadProgress={uploadProgress} />;
} else { } else {
if (imageToText && imageToText.closeMatches != -1) { if (imageToText && imageToText.closeMatches != -1) {
return ( return (
<View> <View>
...@@ -109,4 +110,4 @@ class ReminderDialogForm extends Component { ...@@ -109,4 +110,4 @@ class ReminderDialogForm extends Component {
} }
} }
export default ReminderDialogForm; export default connect(null, { reminderCreate })(ReminderDialogForm);
\ No newline at end of file \ No newline at end of file
...@@ -30,10 +30,10 @@ class AppCamera extends Component { ...@@ -30,10 +30,10 @@ class AppCamera extends Component {
visible: false, visible: false,
imageToText: "", imageToText: "",
uploadProgress: "0", uploadProgress: "0",
addReminder: false, onAddReminder: false,
dataType: '', dataType: '',
qrData: {}, qrData: {},
uuid: '' uuid: '',
} }
} }
...@@ -72,11 +72,12 @@ class AppCamera extends Component { ...@@ -72,11 +72,12 @@ class AppCamera extends Component {
<MaterialDialog <MaterialDialog
title="Add Reminder" title="Add Reminder"
visible={this.state.visible} visible={this.state.visible}
onOk={() => 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' })}> onCancel={() => this.setState({ visible: false, imageToText: '', uploadProgress: '0', onAddReminder: false })}>
<ReminderDialogForm <ReminderDialogForm
uploadProgress={this.state.uploadProgress} uploadProgress={this.state.uploadProgress}
imageToText={this.state.imageToText} imageToText={this.state.imageToText}
onOk={this.state.onAddReminder}
/> />
</MaterialDialog> </MaterialDialog>
<MaterialDialog <MaterialDialog
...@@ -155,9 +156,6 @@ class AppCamera extends Component { ...@@ -155,9 +156,6 @@ class AppCamera extends Component {
break; 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