Skip to content

Commit

Permalink
feat: add loader after selecting PDS (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
lessp authored Sep 26, 2019
1 parent 57284f0 commit 1d950bd
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/components/wizard/PDS.js
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -15,14 +21,22 @@ export default class PDS extends Component {
}

useMem = () => {
this.setState(prevState => ({ ...prevState, loading: true }))
this.props.onConnect({
provider: 'memory',
access_token: 'nope',
})
}

render() {
return (
return this.state.loading ? (
<Wrap>
<Spinner />
<Paragraph align="center" style={{ marginTop: 24 }}>
Ansluter...
</Paragraph>
</Wrap>
) : (
<>
<H1>Lagring</H1>
<Image
Expand Down

0 comments on commit 1d950bd

Please sign in to comment.