From 1d950bd0339c7d4b2fb2c7fec269e16293d624b2 Mon Sep 17 00:00:00 2001 From: Tom Ekander Date: Thu, 26 Sep 2019 10:38:52 +0200 Subject: [PATCH] feat: add loader after selecting PDS (#32) --- lib/components/wizard/PDS.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/components/wizard/PDS.js b/lib/components/wizard/PDS.js index 4218c240..949b13ec 100644 --- a/lib/components/wizard/PDS.js +++ b/lib/components/wizard/PDS.js @@ -1,11 +1,17 @@ import React, { Component } from 'react' import { Image, View } from 'react-native' import { H1, Paragraph } from '../typography/Typography' +import { Wrap } from '../view/Wrapper' import { PrimaryButton } from '../elements/Button/Button' +import { Spinner } from '../elements/Spinner/Spinner' import dropbox from '../../services/dropbox' export default class PDS extends Component { + state = { + loading: false, + } + connectToDropbox = async () => { dropbox.once('connect', pds => { this.props.onConnect(pds) @@ -15,6 +21,7 @@ export default class PDS extends Component { } useMem = () => { + this.setState(prevState => ({ ...prevState, loading: true })) this.props.onConnect({ provider: 'memory', access_token: 'nope', @@ -22,7 +29,14 @@ export default class PDS extends Component { } render() { - return ( + return this.state.loading ? ( + + + + Ansluter... + + + ) : ( <>

Lagring