{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\n\nvar _this = this,\n    _jsxFileName = \"C:\\\\Users\\\\winston\\\\Documents\\\\react-native-boilerplate-master\\\\src\\\\routes\\\\Routes.js\";\n\nimport React, { useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport Text from \"react-native-web/dist/exports/Text\";\nimport Connector from \"../utils/connector\";\nimport Main from \"./navigation\";\n\nvar Routes = function Routes(_ref) {\n  var actions = _ref.actions,\n      checked = _ref.checked,\n      loggedIn = _ref.loggedIn;\n  useEffect(function () {\n    actions.authenticate();\n  }, []);\n  console.log('[##] loggedIn', loggedIn);\n  if (!checked) return React.createElement(Text, {\n    __self: _this,\n    __source: {\n      fileName: _jsxFileName,\n      lineNumber: 16,\n      columnNumber: 24\n    }\n  }, \"Loading...\");\n  return React.createElement(Main, {\n    __self: _this,\n    __source: {\n      fileName: _jsxFileName,\n      lineNumber: 17,\n      columnNumber: 10\n    }\n  });\n};\n\nRoutes.propTypes = {\n  actions: PropTypes.shape({\n    authenticate: PropTypes.func\n  }),\n  checked: PropTypes.bool,\n  loggedIn: PropTypes.bool\n};\nRoutes.defaultProps = {\n  actions: {\n    authenticate: function authenticate() {\n      return null;\n    }\n  },\n  checked: false,\n  loggedIn: false\n};\nexport default (function (props) {\n  return React.createElement(Connector, {\n    __self: _this,\n    __source: {\n      fileName: _jsxFileName,\n      lineNumber: 37,\n      columnNumber: 3\n    }\n  }, function (_ref2) {\n    var actions = _ref2.actions,\n        app = _ref2.state.app;\n    return React.createElement(Routes, _extends({\n      actions: actions.app\n    }, app, props, {\n      __self: _this,\n      __source: {\n        fileName: _jsxFileName,\n        lineNumber: 39,\n        columnNumber: 7\n      }\n    }));\n  });\n});","map":{"version":3,"sources":["C:/Users/winston/Documents/react-native-boilerplate-master/src/routes/Routes.js"],"names":["React","useEffect","PropTypes","Connector","Main","Routes","actions","checked","loggedIn","authenticate","console","log","propTypes","shape","func","bool","defaultProps","props","app","state"],"mappings":";;;;;A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,WACC,oBAAC,MAAD;AAAQ,MAAA,OAAO,EAAEZ,OAAO,CAACY;AAAzB,OAAkCA,GAAlC,EAA2CD,KAA3C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OADD;AAAA,GADH,CADa;AAAA,CAAf","sourcesContent":["import React, { useEffect } from 'react'\nimport PropTypes from 'prop-types'\nimport { Text } from 'react-native'\nimport Connector from 'utils/connector'\nimport Main from './navigation'\n\nconst Routes = ({ actions, checked, loggedIn }) => {\n  useEffect(() => {\n    actions.authenticate()\n  }, [])\n\n  // TODO: switch router by loggedIn state\n  console.log('[##] loggedIn', loggedIn)\n\n  // rendering\n  if (!checked) return <Text>Loading...</Text>\n  return <Main />\n}\n\nRoutes.propTypes = {\n  actions: PropTypes.shape({\n    authenticate: PropTypes.func,\n  }),\n  checked: PropTypes.bool,\n  loggedIn: PropTypes.bool,\n}\n\nRoutes.defaultProps = {\n  actions: {\n    authenticate: () => null,\n  },\n  checked: false,\n  loggedIn: false,\n}\n\nexport default (props) => (\n  <Connector>\n    {({ actions, state: { app } }) => (\n      <Routes actions={actions.app} {...app} {...props} />\n    )}\n  </Connector>\n)\n"]},"metadata":{},"sourceType":"module"}