import React from 'react'; import {observer, inject} from 'mobx-react'; import {Dialog, FlatButton, Stepper, Step, StepLabel, Snackbar} from "material-ui"; import {DIALOG} from "../../../../stores/global_ui"; import SelectPaymentType from "./SelectPaymentType"; import BookedOrder from './BookedOrder'; import OrderedOrder from './OrderedOrder'; import CompleteOrder from './CompleteOrder'; @inject('appstate') @observer export default class MakePaymentDialog extends React.Component { constructor(props) { super(props); this.props = props; this.state = { currentStep: 0, handleNext: () => {}, prevText: "Cancel", nextText: "Submit" }; this.defaultState = Object.assign({}, this.state); this.globalUI = props.appstate.globalUI; this.order = props.appstate.order; } componentDidMount() { } getContent() { switch (this.order.selectedOrder.status) { case "ordered": return ; case "booked": return ; case "payment_complete": return ; default: return
; } } render() { const actions = [ this.globalUI.hideDialog(DIALOG.ORDER.MAKE_PAYMENT)} />, this.state.handleNext().catch(err => this.props.appstate.globalUI.openSnackbar(err.message))} />, ]; const actionsCancelOnly = [ this.globalUI.hideDialog(DIALOG.ORDER.MAKE_PAYMENT)} />, ]; return ( {this.getContent()} ) } }