import React, { Component } from "react"; import { Elements, StripeProvider} from 'react-stripe-elements'; import { Container, Header, Segment, Icon, Divider, Button, Message } from 'semantic-ui-react' import PaymentSource from "./PaymentSource" import InvoiceList from "./InvoiceList" // ---------------------------------------------------- class Billing extends Component { constructor(props) { super(props); this.handleShowAddSource = this.handleShowAddSource.bind(this); this.handleNewSource = this.handleNewSource.bind(this); this.state = {showAddSource: false}; } componentDidMount() { this.props.fetchBilling(); this.props.fetchInvoices(); } handleShowAddSource() { this.setState({ showAddSource: !this.state.showAddSource }); } handleNewSource(newSource) { this.setState({ showAddSource: false }); this.props.updateCard(newSource); } //https://stackoverflow.com/questions/36559661/how-can-i-dispatch-from-child-components-in-react-redux //https://stackoverflow.com/questions/42597602/react-onclick-pass-event-with-parameter render() { var name = this.props.user.firstName + " " + this.props.user.lastName; var section=
; if (!this.props.billing || this.state.showAddSource) { section = (It is free to use OpenMHz. Add payment in order to upgrade features.
{section}We updated our privacy policy here to better service our customers. We recommend reviewing the changes.