context = window rest = context.JK.Rest() logger = context.JK.logger UserStore = context.UserStore @StripeConnect = React.createClass({ getInitialState: () -> { clicked:false } openBrowser: () -> context.JK.popExternalLink("https://www.jamkazam.com/client#/jamclass") onStripeConnect: (e) -> if this.state.clicked return e.preventDefault() if window.jamClient.IsNativeClient() buttons = [] buttons.push({name: 'CLOSE', buttonStyle: 'button-grey'}) buttons.push({ name: 'OPEN BROWSER', buttonStyle: 'button-orange', click: (() => (@openBrowser())) }) context.JK.Banner.show({ title: "Browser Needed", html: "You must connect to Stripe in a normal browser.

Please select the OPEN BROWSER button to open this page in your system browser.", buttons: buttons }) return this.setState({clicked: true}) StripeActions.connect(this.props.purpose, this.props.user) render: () -> if this.props.purpose == 'jamclass-home' label = `` else label = `` if this.props.user?.stripe_auth? if this.props.purpose == 'jamclass-home' return `

Your Stripe account is properly set up and connected to enable transfer of student payments. To view lesson payment history, click the button below.

VIEW PAYMENTS
` else return `
You have successfully connected your Stripe account for payments. If you need to make any changes to your Stripe account, please go to the Stripe website and sign in using your Stripe credentials there to make any changes needed.
` if this.state.clicked imageUrl = '/assets/content/stripe-connect-light-on-dark.png' else imageUrl = '/assets/content/stripe-connect-blue-on-dark.png' `
{label}
` })