@@ -179,34 +179,29 @@ class InviteTicket extends React.Component {
181 getStageText() {
181 getStageText() {
182− switch (this.state.stage) {
182+ const { stage } = this.state
184+ let progressWidth = this.state.transactionProgress.pct;
183− case INVITE_STAGES.INVITE_LOGIN:
186+ const stageText = stage === INVITE_STAGES.INVITE_LOGIN
185− <h1 className="text-700 mt-15">Welcome</h1>
187+ ? <h1 className="text-700 mt-15">Welcome</h1>
188− case INVITE_STAGES.INVITE_WALLET:
188+ : stage === INVITE_STAGES.INVITE_LOGIN
191 <h1 className="fs-6 lh-8 mb-3">Passport</h1>
191 <h1 className="fs-6 lh-8 mb-3">Passport</h1>
192 <p>A passport is your digital identity. You will use your passport to access your true computer, send payments, and administer your identity. So naturally, you must keep this secure.</p>
192 <p>A passport is your digital identity. You will use your passport to access your true computer, send payments, and administer your identity. So naturally, you must keep this secure.</p>
193 <p>After you’ve downloaded your passport, back up the ticket manually or store on a trusted device.</p>
193 <p>After you’ve downloaded your passport, back up the ticket manually or store on a trusted device.</p>
197− case INVITE_STAGES.INVITE_VERIFY:
196+ : stage === INVITE_STAGES.INVITE_VERIFY
200 <h1 className="fs-6 lh-8 mb-3">Verify Passport</h1>
199 <h1 className="fs-6 lh-8 mb-3">Verify Passport</h1>
201 <p>Afer you download your passport, verify your custody. Your passport should be a folder of image files. One of them is your Master Ticket. Open it and enter the 4 word phrase below (with hyphens).</p>
200 <p>Afer you download your passport, verify your custody. Your passport should be a folder of image files. One of them is your Master Ticket. Open it and enter the 4 word phrase below (with hyphens).</p>
205− case INVITE_STAGES.INVITE_TRANSACTIONS:
202+ ) : INVITE_STAGES.INVITE_TRANSACTIONS
206− let progressWidth = this.state.transactionProgress.pct;
208− if (this.state.transactionProgress.label === TRANSACTION_STATES.DONE.label) {
203+ ? this.state.transactionProgress.label === TRANSACTION_STATES.DONE.label
211 <h1 className="fs-6 lh-8 mb-3">
206 <h1 className="fs-6 lh-8 mb-3">
212 <span>Success</span>
207 <span>Success</span>
@@ -215,8 +210,7 @@ class InviteTicket extends React.Component {
215 <p>Transferring to Bridge...</p>
210 <p>Transferring to Bridge...</p>
221 <h1 className="fs-6 lh-8 mb-3">Submitting</h1>
215 <h1 className="fs-6 lh-8 mb-3">Submitting</h1>
222 <p className="mt-4 mb-4">This step can take up to five minutes. Please do not leave this page until the transactions are complete.</p>
216 <p className="mt-4 mb-4">This step can take up to five minutes. Please do not leave this page until the transactions are complete.</p>
@@ -228,9 +222,9 @@ class InviteTicket extends React.Component {
233− }
227+ return stageText
236 updateProgress(transactionProgress) {
230 updateProgress(transactionProgress) {
@@ -240,75 +234,73 @@ class InviteTicket extends React.Component {
242 getContinueButton() {
236 getContinueButton() {
243− if (this.state.stage === INVITE_STAGES.INVITE_TRANSACTIONS) return null
237+ const { realPoint, realWallet, inviteWallet, stage, walletStates,
245− const { realPoint, realWallet, inviteWallet, verifyTicket, inviteTicket } = this.state
238+ verifyTicket, inviteTicket } = this.state
246 const { web3, contracts, setUrbitWallet } = this.props
239 const { web3, contracts, setUrbitWallet } = this.props
249− let btnColor = this.state.walletStates.includes(WALLET_STATES.PAPER_READY)
241+ const btnColor = this.state.walletStates.includes(WALLET_STATES.PAPER_READY)
250 ? 'green'
242 ? 'green'
251 : 'black'
243 : 'black'
254− switch(this.state.stage) {
255− case INVITE_STAGES.INVITE_LOGIN:
256− clickHandler = () => {
257− this.unlockInviteWallet(inviteTicket)
259− continueReady = true
261− case INVITE_STAGES.INVITE_WALLET:
262− clickHandler = () => {
264− stage: INVITE_STAGES.INVITE_VERIFY
267− continueReady = this.state.walletStates.includes(WALLET_STATES.DOWNLOADED)
269− case INVITE_STAGES.INVITE_VERIFY:
270− clickHandler = () => {
271− const realTicket = realWallet.matchWith({
272− Just: w => w.value.ticket,
277− stage: INVITE_STAGES.INVITE_TRANSACTIONS,
278− walletStates: this.state.walletStates.concat(WALLET_STATES.TRANSACTIONS)
282− inviteWalletM: inviteWallet,
283− realWalletM: realWallet,
284− realPointM: realPoint,
285− realTicket: verifyTicket,
287− contractsM: contracts,
289− updateProgress: this.updateProgress
293− this.props.popRoute()
297− continueReady = true
301− return (
245+ const clickHandler = stage === INVITE_STAGES.INVITE_LOGIN
247+ this.unlockInviteWallet(inviteTicket)
249+ : stage === INVITE_STAGES.INVITE_WALLET
252+ stage: INVITE_STAGES.INVITE_VERIFY
255+ : stage === INVITE_STAGES.INVITE_TRANSACTIONS
257+ const realTicket = realWallet.matchWith({
258+ Just: w => w.value.ticket,
263+ stage: INVITE_STAGES.INVITE_TRANSACTIONS,
264+ walletStates: this.state.walletStates.concat(WALLET_STATES.TRANSACTIONS)
268+ inviteWalletM: inviteWallet,
269+ realWalletM: realWallet,
270+ realPointM: realPoint,
271+ realTicket: verifyTicket,
273+ contractsM: contracts,
275+ updateProgress: this.updateProgress
279+ this.props.popRoute()
285+ const continueReady = stage === INVITE_STAGES.INVITE_WALLET
286+ ? walletStates.includes(WALLET_STATES.DOWNLOADED)
289+ const buttonElem = stage === INVITE_STAGES.INVITE_TRANSACTIONS
303− className={'mt-4'}
293+ className={'mt-4'}
304− prop-size={'lg'}
294+ prop-size={'lg'}
305− prop-color={btnColor}
295+ prop-color={btnColor}
306− disabled={!continueReady}
296+ disabled={!continueReady}
307− onClick={clickHandler}
297+ onClick={clickHandler}
309− { 'Continue →' }
299+ { 'Continue →' }
310− </Button>
300+ </Button>
314 getStageDisplay() {
306 getStageDisplay() {