Closing many tickets

This commit is contained in:
John Lyon-Smith
2018-04-22 15:22:36 -07:00
parent 4bc0a6cd30
commit 5cb13f7498
31 changed files with 392 additions and 100 deletions

View File

@@ -10,7 +10,7 @@ import {
Button,
TouchableWithoutFeedback,
} from "react-native"
import { MessageModal, ApiModal } from "../Modal"
import { MessageModal, ApiModal, WaitModal } from "../Modal"
import logoImage from "./images/deighton.png"
import { FormBinder } from "react-form-binder"
import { api } from "../API"
@@ -19,7 +19,7 @@ import KeyboardSpacer from "react-native-keyboard-spacer"
import { versionInfo } from "../version"
import autobind from "autobind-decorator"
import { isIphoneX } from "react-native-iphone-x-helper"
import { defaultUser } from "../config"
import { config } from "../config"
export class Login extends React.Component {
static bindings = {
@@ -76,9 +76,10 @@ export class Login extends React.Component {
constructor(props) {
super(props)
this.state = {
binder: new FormBinder({ email: defaultUser }, Login.bindings),
binder: new FormBinder({ email: config.defaultUser }, Login.bindings),
messageModal: null,
apiModal: null,
waitModal: null,
}
}
@@ -88,6 +89,7 @@ export class Login extends React.Component {
let { history } = this.props
if (obj) {
this.setState({ waitModal: { message: "Loggin In..." } })
api
.login(obj.email.trim(), obj.password, obj.rememberMe)
.then((user) => {
@@ -95,6 +97,7 @@ export class Login extends React.Component {
})
.catch((error) => {
this.setState({
waitModal: null,
messageModal: {
icon: "hand",
message: "Unable to login",
@@ -178,6 +181,10 @@ export class Login extends React.Component {
{versionInfo.fullVersion}
</Text>
</View>
<WaitModal
open={!!waitModal}
message={waitModal ? waitModal.message : ""}
/>
<MessageModal
open={!!messageModal}
icon={messageModal ? messageModal.icon : ""}