index.js 882 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // import Remote from '../../plugins/Remote'
  2. import AuthView from './AuthView'
  3. import Browser from './Browser'
  4. import ErrorView from './ErrorView'
  5. const GoogleDrive = (props) => {
  6. // Methods
  7. // const addFile = (file) => {
  8. // props.dispatch('add-file', file)
  9. // }
  10. // const getFolder = (directory) => {
  11. // props.dispatch(Remote.prototype.actions.list(directory))
  12. // }
  13. // const filterItems = () => {}
  14. // Start Component
  15. const {
  16. authenticated,
  17. error,
  18. link
  19. } = props
  20. if (error) {
  21. return ErrorView({ error: error })
  22. }
  23. if (!authenticated) {
  24. // const authState = btoa(JSON.stringify({
  25. // redirect: location.href.split('#')[0]
  26. // }))
  27. return AuthView({
  28. link: link,
  29. handleDemoAuth: this.handleDemoAuth
  30. })
  31. }
  32. return Browser({})
  33. }
  34. export default GoogleDrive