forked from BuilderIO/demo-editor
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
285.8b60dd3b.chunk.js.download
1 lines (1 loc) · 5.64 KB
/
285.8b60dd3b.chunk.js.download
1
(this["webpackJsonp@builder.io/app"]=this["webpackJsonp@builder.io/app"]||[]).push([[285],{3213:function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(49);Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=_interopRequireDefault(__webpack_require__(3)),_createSvgIcon=_interopRequireDefault(__webpack_require__(51)),_default=(0,_createSvgIcon.default)(_react.default.createElement("g",null,_react.default.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})),"Info");exports.default=_default},6338:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"VerifyEmailSnackbar",function(){return VerifyEmailSnackbar});var _emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),firebase_compat_app__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(60),_material_ui_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(1975),_material_ui_core__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_material_ui_core__WEBPACK_IMPORTED_MODULE_2__),_material_ui_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1091),_material_ui_core__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_material_ui_core__WEBPACK_IMPORTED_MODULE_3__),_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(40),_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4__),_material_ui_icons__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(3213),_material_ui_icons__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_material_ui_icons__WEBPACK_IMPORTED_MODULE_5__),mobx_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(90),react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(3),react__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__),_constants_app_state_constant__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(1),_hooks_use_reaction__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(132),_constants_firebase_auth_constant__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(62);function VerifyEmailSnackbar(){const intervalRef=Object(react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);return Object(_hooks_use_reaction__WEBPACK_IMPORTED_MODULE_9__.a)(()=>_constants_app_state_constant__WEBPACK_IMPORTED_MODULE_8__.appState.user.emailIsNotVerified,notVerified=>{notVerified&&intervalRef.current===null&&(intervalRef.current=setInterval(()=>{var _a,_b;!((_a=_constants_firebase_auth_constant__WEBPACK_IMPORTED_MODULE_10__.c.currentUser)===null||_a===void 0)&&_a.emailVerified&&intervalRef.current!==null&&(clearInterval(intervalRef.current),intervalRef.current=null,_constants_app_state_constant__WEBPACK_IMPORTED_MODULE_8__.appState.user.data.emailVerified=!0),(_b=_constants_firebase_auth_constant__WEBPACK_IMPORTED_MODULE_10__.c.currentUser)===null||_b===void 0||_b.reload()},1e3))}),Object(react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>()=>{intervalRef.current!==null&&(clearInterval(intervalRef.current),intervalRef.current=null)}),Object(mobx_react__WEBPACK_IMPORTED_MODULE_6__.g)(()=>{var _a,_b;const small=_constants_app_state_constant__WEBPACK_IMPORTED_MODULE_8__.appState.document.small,twoDaysInMilliseconds=2*24*60*60*1e3,showThis=_constants_app_state_constant__WEBPACK_IMPORTED_MODULE_8__.appState.user.emailIsNotVerified&&((_a=_constants_app_state_constant__WEBPACK_IMPORTED_MODULE_8__.appState.user.settings)===null||_a===void 0?void 0:_a.value.createdDate)&&Math.abs(((_b=_constants_app_state_constant__WEBPACK_IMPORTED_MODULE_8__.appState.user.settings)===null||_b===void 0?void 0:_b.value.createdDate.getTime())-Date.now())>twoDaysInMilliseconds;return Object(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.b)(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.a,{children:!_constants_app_state_constant__WEBPACK_IMPORTED_MODULE_8__.appState.globalState.globalPopovers.length&&showThis&&Object(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.b)(_material_ui_core__WEBPACK_IMPORTED_MODULE_2___default.a,Object.assign({css:{left:94,bottom:8},anchorOrigin:{vertical:"bottom",horizontal:"left"},open:!0},{children:Object(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.b)(_material_ui_core__WEBPACK_IMPORTED_MODULE_3___default.a,{css:Object.assign({color:"var(--text-light)",backgroundColor:"var(--off-background)",transition:"transform 0.3s var(--smooth), opacity 0.3s var(--smooth) !important"},small&&{justifyContent:"center"}),message:Object(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.c)("div",Object.assign({css:{display:"flex",alignItems:"center"}},{children:[Object(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.b)(_material_ui_icons__WEBPACK_IMPORTED_MODULE_5___default.a,{css:{marginRight:15}}),"Please verify your email address"]})),action:Object(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.b)(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.a,{children:Object(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.b)(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4___default.a,Object.assign({onClick:e=>{e.stopPropagation(),firebase_compat_app__WEBPACK_IMPORTED_MODULE_1__.a.auth().currentUser.sendEmailVerification(),_constants_app_state_constant__WEBPACK_IMPORTED_MODULE_8__.appState.snackBar.display({message:"Sent - check your inbox!"})},css:Object.assign({},small&&{width:"calc(100vw - 90px)",marginRight:45,marginTop:10,marginBottom:10}),color:"primary",variant:"contained"},{children:"Re-send verification email"}))})})}))})})}}}]);