@stokr/components-library 3.0.16 → 3.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +261 -262
- package/dist/analytics/index.js +180 -0
- package/dist/api/auth.js +15 -0
- package/dist/api/fetchData.js +27 -0
- package/dist/api/fetchDataPublic.js +19 -0
- package/dist/auth/index.js +32 -0
- package/dist/components/2FA/Connect2FA.js +55 -0
- package/dist/components/2FA/EnterCode.js +63 -0
- package/dist/components/2FA/InstallAuthApp.js +64 -0
- package/dist/components/2FA/ResetCode.js +33 -0
- package/dist/components/2FA/Sucess2FA.js +51 -0
- package/dist/components/2FA/disable-2fa-flow.js +91 -0
- package/dist/components/2FA/enable-2fa-flow.js +137 -0
- package/dist/components/2FA/login-with-otp-flow.js +206 -0
- package/dist/components/2FA/main-flow.js +217 -0
- package/dist/components/AccountBalance/AccountBalance.js +35 -0
- package/dist/components/AccountBalance/AccountBalance.styles.js +48 -0
- package/dist/components/AdminDashboard/Table/ReactTable.js +266 -0
- package/dist/components/AdminDashboard/Table/ReactTableWrapper.js +65 -0
- package/dist/components/AdminDashboard/Table/Table.js +123 -0
- package/dist/components/AdminDashboard/Table/Table.styles.js +263 -0
- package/dist/components/AgreementItem/AgreementItem.js +39 -0
- package/dist/components/AgreementItem/AgreementItem.styles.js +32 -0
- package/dist/components/BackButton/BackButton.js +34 -0
- package/dist/components/BackButton/BackButton.styles.js +123 -0
- package/dist/components/Background/Background.js +45 -0
- package/dist/components/Background/Background.styles.js +119 -0
- package/dist/components/BasicTable/BasicTable.js +25 -0
- package/dist/components/BasicTable/BasicTable.styles.js +76 -0
- package/dist/components/BlogPost/BlogPost.js +98 -0
- package/dist/components/BlogPost/BlogPost.styles.js +230 -0
- package/dist/components/Button/Button.styles.js +207 -0
- package/dist/components/ButtonContainer/ButtonContainer.styles.js +51 -0
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.js +18 -0
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +41 -0
- package/dist/components/Card/Card.styles.js +97 -0
- package/dist/components/ChartLegend/ChartLegend.js +62 -0
- package/dist/components/ChartLegend/ChartLegend.styles.js +133 -0
- package/dist/components/Checkbox/Checkbox.js +80 -0
- package/dist/components/Checkbox/Checkbox.styles.js +133 -0
- package/dist/components/Checklist/ChecklistCard.js +71 -0
- package/dist/components/Checklist/ChecklistCard.styles.js +82 -0
- package/dist/components/Chips/Chip.js +23 -0
- package/dist/components/Chips/Chip.styles.js +72 -0
- package/dist/components/Chips/ChipWrapper.js +50 -0
- package/dist/components/ComponentScroll/ComponentScroll.js +70 -0
- package/dist/components/ComponentScroll/ComponentScroll.styles.js +127 -0
- package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +165 -0
- package/dist/components/ConfirmModal/ConfirmModal.js +199 -0
- package/dist/components/ConfirmModal/ConfirmModal.styles.js +44 -0
- package/dist/components/CryptoAddress/ComponentWrap.js +16 -0
- package/dist/components/CryptoAddress/CryptoAddress.js +151 -0
- package/dist/components/CryptoAddress/CryptoAddress.styles.js +443 -0
- package/dist/components/CryptoAddress/RadioWrap.js +47 -0
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.js +34 -0
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.styles.js +125 -0
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.js +25 -0
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +111 -0
- package/dist/components/DoubleButton/DoubleButton.styles.js +27 -0
- package/dist/components/ErrorMessage/ErrorMessage.styles.js +9 -0
- package/dist/components/FAQ/FAQ.js +73 -0
- package/dist/components/FAQ/FAQ.styles.js +128 -0
- package/dist/components/Footer/Footer.js +55 -0
- package/dist/components/Footer/Footer.styles.js +256 -0
- package/dist/components/Footer/FooterLayout.js +145 -0
- package/dist/components/Footer/FooterMenu.js +100 -0
- package/dist/components/Footer/FooterMenu.styles.js +321 -0
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +100 -0
- package/dist/components/Form/Form.js +21 -0
- package/dist/components/Form/Form.styles.js +72 -0
- package/dist/components/Grid/Grid.styles.js +212 -0
- package/dist/components/Header/Header.js +425 -0
- package/dist/components/Header/Header.styles.js +567 -0
- package/dist/components/HeroBlock/HeroVideoBlock.js +105 -0
- package/dist/components/Icon/Icon.style.js +92 -0
- package/dist/components/Icon/Icon2.js +12 -0
- package/dist/components/InfoBox/InfoBox.js +93 -0
- package/dist/components/InfoIcon/InfoIcon.js +62 -0
- package/dist/components/InfoIcon/InfoIcon.styles.js +64 -0
- package/dist/components/Input/DatePickerInput.js +139 -0
- package/dist/components/Input/DatePickerInput.styles.js +165 -0
- package/dist/components/Input/Input.js +108 -0
- package/dist/components/Input/Input.styles.js +154 -0
- package/dist/components/Input/InputPassword.js +122 -0
- package/dist/components/Input/InputPassword.styles.js +166 -0
- package/dist/components/Input/InputUsername.js +92 -0
- package/dist/components/Input/InputWithButton.js +53 -0
- package/dist/components/Input/InputWithButton.styles.js +57 -0
- package/dist/components/Input/MultiSelect.js +306 -0
- package/dist/components/Input/OtpInput.js +70 -0
- package/dist/components/Input/RangeInput.js +80 -0
- package/dist/components/Input/RangeInput.styles.js +129 -0
- package/dist/components/Input/SearchInput.js +68 -0
- package/dist/components/Input/SearchInput.styles.js +92 -0
- package/dist/components/Input/Select.js +151 -0
- package/dist/components/Input/Select.styles.js +148 -0
- package/dist/components/Input/TableFilterDropdown.js +247 -0
- package/dist/components/Input/Textarea.js +51 -0
- package/dist/components/Input/Textarea.styles.js +62 -0
- package/dist/components/InvestCalculator/InvestCalculator.js +283 -0
- package/dist/components/InvestCalculator/InvestCalculator.styles.js +94 -0
- package/dist/components/InvestmentStat/InvestmentStat.js +24 -0
- package/dist/components/InvestmentStat/InvestmentStat.styles.js +62 -0
- package/dist/components/LatestUpdate/LatestUpdate.js +24 -0
- package/dist/components/LatestUpdate/LatestUpdate.styles.js +90 -0
- package/dist/components/Layout/Layout.js +69 -0
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.js +32 -0
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.styles.js +208 -0
- package/dist/components/LearnMorePage/LearnMore.js +190 -0
- package/dist/components/LearnMorePage/LearnMore.propTypes.js +20 -0
- package/dist/components/LearnMorePage/LearnMore.shared.styles.js +56 -0
- package/dist/components/LearnMorePage/LearnMore.styles.js +276 -0
- package/dist/components/LearnMorePage/LearnMoreExampleObject.js +120 -0
- package/dist/components/LearnMorePage/LearnMoreItem.js +57 -0
- package/dist/components/LearnMorePage/LearnMoreItem.styles.js +234 -0
- package/dist/components/LearnMoreSection/LearnMore.js +138 -0
- package/dist/components/LearnMoreSection/LearnMore.styles.js +147 -0
- package/dist/components/LearnMoreSection/LearnMoreItem.js +33 -0
- package/dist/components/LearnMoreSection/LearnMoreItem.styles.js +60 -0
- package/dist/components/LoginModal/LoginModal.js +142 -0
- package/dist/components/MainMenu/DynamicMainMenu.js +38 -0
- package/dist/components/MainMenu/MainMenu.js +210 -0
- package/dist/components/MainMenu/MainMenu.styles.js +362 -0
- package/dist/components/MenuNav/MenuNav.styles.js +66 -0
- package/dist/components/Modal/Modal.js +119 -0
- package/dist/components/Modal/Modal.styles.js +450 -0
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +262 -0
- package/dist/components/Modal/PaymentModal.js +149 -0
- package/dist/components/Modal/SideModal.js +134 -0
- package/dist/components/Modal/SideModal.styles.js +55 -0
- package/dist/components/Modal/SuccessModal/SuccessModal.js +170 -0
- package/dist/components/Modal/SuccessModal/SuccessModal.styles.js +53 -0
- package/dist/components/MultiProgressBar/MultiProgressBar.js +30 -0
- package/dist/components/MultiProgressBar/MultiProgressBar.styles.js +105 -0
- package/dist/components/Newsletter/Newsletter.js +122 -0
- package/dist/components/Newsletter/Newsletter.styles.js +186 -0
- package/dist/components/NotificationCounter/NotificationCounter.styles.js +38 -0
- package/dist/components/Number/Number.js +50 -0
- package/dist/components/Number/Number.styles.js +23 -0
- package/dist/components/PageTransition/PageTransition.js +51 -0
- package/dist/components/Pagination/Pagination.js +58 -0
- package/dist/components/Pagination/Pagination.styles.js +59 -0
- package/dist/components/Pagination/PaginationControls.js +113 -0
- package/dist/components/Pagination/usePagination.js +40 -0
- package/dist/components/Payment/PaymentDetailsCard.js +359 -0
- package/dist/components/Payment/PaymentDisplay.js +199 -0
- package/dist/components/Payment/TimerComponent.js +92 -0
- package/dist/components/Process/Process.styles.js +84 -0
- package/dist/components/ProfileBadge/ProfileBadge.js +35 -0
- package/dist/components/ProfileBadge/ProfileBadge.styles.js +53 -0
- package/dist/components/ProfileBox/ProfileBox.js +27 -0
- package/dist/components/ProfileBox/ProfileBox.styles.js +67 -0
- package/dist/components/ProfileStat/ProfileStat.js +29 -0
- package/dist/components/ProfileStat/ProfileStat.styles.js +90 -0
- package/dist/components/QRCode/QRCode.js +51 -0
- package/dist/components/Radio/Radio.js +51 -0
- package/dist/components/Radio/Radio.styles.js +100 -0
- package/dist/components/RefreshButton/RefreshButton.js +21 -0
- package/dist/components/RefreshButton/RefreshButton.styles.js +64 -0
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +65 -0
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.styles.js +20 -0
- package/dist/components/RegisterModal/RegisterModal.js +248 -0
- package/dist/components/RequestDataBox/RequestDataBox.js +21 -0
- package/dist/components/RequestDataBox/RequestDataBox.styles.js +43 -0
- package/dist/components/ResetConfirmModal/ResetConfirmModal.js +44 -0
- package/dist/components/ResetConfirmModal/ResetConfirmModal.styles.js +41 -0
- package/dist/components/ResetPasswordModal/ResetPasswordModal.js +134 -0
- package/dist/components/SEO/SEO.js +66 -0
- package/dist/components/SectionTitle/SectionTitle.styles.js +26 -0
- package/dist/components/SideLine/SideLine.js +7 -0
- package/dist/components/SideLine/SideLine.styles.js +33 -0
- package/dist/components/Slider/Slider.js +31 -0
- package/dist/components/Slider/Slider.styles.js +120 -0
- package/dist/components/Snackbar/Snackbar.js +111 -0
- package/dist/components/Snackbar/Snackbar.styles.js +230 -0
- package/dist/components/Snackbar/SnackbarProvider.js +66 -0
- package/dist/components/Snackbar/useSnackbar.js +12 -0
- package/dist/components/SpanButton/SpanButton.styles.js +19 -0
- package/dist/components/StatusBadge/StatusBadge.styles.js +18 -0
- package/dist/components/StatusTag/StatusTag.js +105 -0
- package/dist/components/StatusTag/StatusTag.styles.js +88 -0
- package/dist/components/StepController/StepController.js +86 -0
- package/dist/components/StepController/StepController.styles.js +33 -0
- package/dist/components/StepController/StepControllerContext.js +65 -0
- package/dist/components/StepController/StepControllerProgress.js +37 -0
- package/dist/components/StepsProgress/StepIndicator.js +40 -0
- package/dist/components/StepsProgress/StepIndicator.styles.js +69 -0
- package/dist/components/StepsProgress/StepsProgress.js +67 -0
- package/dist/components/StepsProgress/StepsProgress.styles.js +105 -0
- package/dist/components/StokrLoader/StokrLoader.js +111 -0
- package/dist/components/StokrLoader/media.js +23 -0
- package/dist/components/SvgIcons/AdminBadgeSvg.js +27 -0
- package/dist/components/SvgIcons/CameraSvg.js +31 -0
- package/dist/components/SvgIcons/CapsLockSvg.js +36 -0
- package/dist/components/SvgIcons/DocumentBackSvg.js +20 -0
- package/dist/components/SvgIcons/DocumentSmallSvg.js +41 -0
- package/dist/components/SvgIcons/DocumentSvg.js +39 -0
- package/dist/components/SvgIcons/EthSvg.js +28 -0
- package/dist/components/SvgIcons/EurSvg.js +27 -0
- package/dist/components/SvgIcons/FaceScanIconSvg.js +17 -0
- package/dist/components/SvgIcons/FourSvg.js +7 -0
- package/dist/components/SvgIcons/Glassess.js +26 -0
- package/dist/components/SvgIcons/LogoSvg.js +17 -0
- package/dist/components/SvgIcons/OneSvg.js +10 -0
- package/dist/components/SvgIcons/PassportSvg.js +37 -0
- package/dist/components/SvgIcons/RefreshSvg.js +28 -0
- package/dist/components/SvgIcons/SocialFacebook.js +22 -0
- package/dist/components/SvgIcons/SocialInstagram.js +13 -0
- package/dist/components/SvgIcons/SocialLinkedIn.js +31 -0
- package/dist/components/SvgIcons/SocialMedium.js +21 -0
- package/dist/components/SvgIcons/SocialReddit.js +21 -0
- package/dist/components/SvgIcons/SocialTelegram.js +60 -0
- package/dist/components/SvgIcons/SocialTwitter.js +62 -0
- package/dist/components/SvgIcons/SocialYoutube.js +22 -0
- package/dist/components/SvgIcons/ThreeSvg.js +7 -0
- package/dist/components/SvgIcons/TwoSidedDocumentSvg.js +48 -0
- package/dist/components/SvgIcons/TwoSvg.js +10 -0
- package/dist/components/SvgIcons/UpdateDefaultSvg.js +12 -0
- package/dist/components/SvgIcons/UpdateHardSvg.js +10 -0
- package/dist/components/SvgIcons/UpdateSoftSvg.js +11 -0
- package/dist/components/SvgIcons/UploadSvg.js +12 -0
- package/dist/components/SvgIcons/VerifiedBadge.js +16 -0
- package/dist/components/Switch/Switch.js +63 -0
- package/dist/components/Switch/Switch.styles.js +126 -0
- package/dist/components/Tabs/Tabs.js +54 -0
- package/dist/components/Tabs/Tabs.styles.js +15 -0
- package/dist/components/TabsNav/TabNav.js +16 -0
- package/dist/components/TabsNav/TabsNav.js +30 -0
- package/dist/components/TabsNav/TabsNav.styles.js +103 -0
- package/dist/components/TeamOverview/TeamOverview.js +80 -0
- package/dist/components/TeamOverview/TeamOverview.styles.js +167 -0
- package/dist/components/TermsModal/TermsModal.js +145 -0
- package/dist/components/TermsModal/_styles.js +313 -0
- package/dist/components/Text/Text.styles.js +220 -0
- package/dist/components/TextLink/TextLink.styles.js +67 -0
- package/dist/components/Timeline/Timeline.js +44 -0
- package/dist/components/Timeline/Timeline.styles.js +147 -0
- package/dist/components/Timeline/TimelineStep.js +58 -0
- package/dist/components/ToDoList/ToDoList.js +172 -0
- package/dist/components/ToDoList/ToDoList.styles.js +122 -0
- package/dist/components/ToDoList/ToDoListTask.js +95 -0
- package/dist/components/ToDoList/ToDoListTask.styles.js +119 -0
- package/dist/components/TransactionDetails/TransactionDetails.js +27 -0
- package/dist/components/TransactionDetails/TransactionDetails.styles.js +38 -0
- package/dist/components/TransactionInfo/TransactionInfo.js +41 -0
- package/dist/components/TransactionInfo/TransactionInfo.styles.js +75 -0
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +122 -0
- package/dist/components/breakdown/Breakdown.js +126 -0
- package/dist/components/headerHo/HeaderHo.js +709 -0
- package/dist/components/icons/Arrow.js +38 -0
- package/dist/components/icons/ArrowSimple.js +34 -0
- package/dist/components/icons/Check.js +16 -0
- package/dist/components/icons/Facebook.js +10 -0
- package/dist/components/icons/Info.js +27 -0
- package/dist/components/icons/Instagram.js +10 -0
- package/dist/components/icons/LinkIcon.js +49 -0
- package/dist/components/icons/LinkedIn.js +13 -0
- package/dist/components/icons/Medium.js +13 -0
- package/dist/components/icons/Reddit.js +16 -0
- package/dist/components/icons/Share.js +31 -0
- package/dist/components/icons/Telegram.js +13 -0
- package/dist/components/icons/Twitter.js +10 -0
- package/dist/components/icons/X.js +10 -0
- package/dist/components/icons/Youtube.js +10 -0
- package/dist/components/icons/index.js +32 -0
- package/dist/components/landing-page/List.js +51 -0
- package/dist/components/landing-page/PageContent.js +65 -0
- package/dist/components/landing-page/PageText.js +171 -0
- package/dist/components/landing-page/PageTitle.js +259 -0
- package/dist/components/logo/Logo.js +57 -0
- package/dist/components/taxId/complete.js +24 -0
- package/dist/components/taxId/flow.js +53 -0
- package/dist/components/taxId/register-taxid.js +166 -0
- package/dist/config.js +44 -0
- package/dist/constants/globalVariables.js +87 -0
- package/dist/constants/style.js +48 -0
- package/dist/context/Auth.js +396 -0
- package/dist/context/AuthContext.js +781 -0
- package/dist/context/Checkbox/CheckboxContext.js +151 -0
- package/dist/firebase-config.js +73 -0
- package/dist/hooks/useNewVentureForm.js +262 -0
- package/dist/hooks/useTimer.js +89 -0
- package/dist/hooks/useTransactionPolling.js +100 -0
- package/dist/index.js +632 -25463
- package/dist/model/axios.js +10 -0
- package/dist/model/axiosPublic.js +9 -0
- package/dist/services/TimerService.js +80 -0
- package/dist/static/animations/checked.lottie.js +4 -0
- package/dist/static/animations/progress.lottie.js +4 -0
- package/dist/static/fonts/Ionicons/Ionicons.ttf.js +4 -0
- package/dist/static/fonts/Ionicons/Ionicons.woff.js +4 -0
- package/dist/static/fonts/Ionicons/Ionicons.woff2.js +4 -0
- package/dist/static/fonts/Ionicons/ionicons.min.css.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff2.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.eot.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.svg.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.ttf.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.woff.js +4 -0
- package/dist/static/images/add-folder-icon.svg.js +5 -0
- package/dist/static/images/address-refreshing.gif.js +4 -0
- package/dist/static/images/arrow-down-black.svg.js +4 -0
- package/dist/static/images/avatar-placeholder.png.js +4 -0
- package/dist/static/images/background3.png.js +4 -0
- package/dist/static/images/bitcoin-logo.svg.js +4 -0
- package/dist/static/images/bmn2-logo.svg.js +4 -0
- package/dist/static/images/check-icon.svg.js +5 -0
- package/dist/static/images/checkmark-circle-icon.svg.js +5 -0
- package/dist/static/images/close-circle-icon.svg.js +5 -0
- package/dist/static/images/copy_icon.svg.js +5 -0
- package/dist/static/images/cross-icon.svg.js +5 -0
- package/dist/static/images/early-adopter.png.js +4 -0
- package/dist/static/images/eth_logo.svg.js +4 -0
- package/dist/static/images/external-link-icon.svg +3 -0
- package/dist/static/images/external-link-icon.svg.js +4 -0
- package/dist/static/images/filter-icon.svg.js +5 -0
- package/dist/static/images/google_auth.png.js +4 -0
- package/dist/static/images/graduation.png.js +4 -0
- package/dist/static/images/mangopay.svg.js +4 -0
- package/dist/static/images/numbers/number_eight.svg.js +5 -0
- package/dist/static/images/numbers/number_five.svg.js +5 -0
- package/dist/static/images/numbers/number_four.svg.js +5 -0
- package/dist/static/images/numbers/number_nine.svg.js +5 -0
- package/dist/static/images/numbers/number_one.svg.js +5 -0
- package/dist/static/images/numbers/number_seven.svg.js +5 -0
- package/dist/static/images/numbers/number_six.svg.js +5 -0
- package/dist/static/images/numbers/number_three.svg.js +5 -0
- package/dist/static/images/numbers/number_two.svg.js +5 -0
- package/dist/static/images/numbers/number_zero.svg.js +5 -0
- package/dist/static/images/process-waiting.gif.js +4 -0
- package/dist/static/images/search-icon.svg.js +5 -0
- package/dist/static/images/social/Facebook_Logo.png.js +4 -0
- package/dist/static/images/social/LI-In-Bug.png.js +4 -0
- package/dist/static/images/social/Telegram-Logo.png.js +4 -0
- package/dist/static/images/social/X-logo-black.png.js +4 -0
- package/dist/static/images/social/youtube_social_circle_red.png.js +4 -0
- package/dist/static/images/transfer-icon.svg.js +5 -0
- package/dist/static/images/usdc-logo.svg.js +4 -0
- package/dist/static/images/usdq-logo.png.js +4 -0
- package/dist/static/images/warning-filled.svg.js +5 -0
- package/dist/styles/colors.js +57 -0
- package/dist/styles/fonts.js +100 -0
- package/dist/styles/global.js +74 -0
- package/dist/styles/grid.js +11 -0
- package/dist/styles/ioniconsStyles.js +31 -0
- package/dist/styles/reactTippy.js +40 -0
- package/dist/styles/rwd.js +56 -0
- package/dist/styles/semanticUi.js +84 -0
- package/dist/styles/spacing.js +8 -0
- package/dist/styles/theme.js +34 -0
- package/dist/utils/check-sale-time-left.js +85 -0
- package/dist/utils/check-todo-status.js +11 -0
- package/dist/utils/checklistGenerator.js +195 -0
- package/dist/utils/copyToClipboard.js +92 -0
- package/dist/utils/customHooks.js +126 -0
- package/dist/utils/delete-redirect-cookie-and-navigate.js +12 -0
- package/dist/utils/fix-decimals.js +5 -0
- package/dist/utils/formatCurrencyValue.js +95 -0
- package/dist/utils/get-cookie-domain.js +10 -0
- package/dist/utils/get-short-address.js +4 -0
- package/dist/utils/isUSInvestor.js +6 -0
- package/dist/utils/km_ify.js +33 -0
- package/dist/utils/moment.js +26 -0
- package/dist/utils/redirect-url.js +5 -0
- package/dist/utils/saveAs.js +17 -0
- package/dist/utils/scrollUtils.js +63 -0
- package/dist/utils/set-redirect-cookie.js +16 -0
- package/dist/utils/transition.js +101 -0
- package/dist/utils/withRouter.js +24 -0
- package/package.json +11 -11
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Component } from "react";
|
|
3
|
+
import styled, { css } from "styled-components";
|
|
4
|
+
import { MAX_WIDTH, GRAY_BASE_HEX } from "../../constants/style.js";
|
|
5
|
+
import stdin_default$4 from "../RegisterModal/RegisterModal.js";
|
|
6
|
+
import stdin_default$6 from "../RegisterConfirmModal/RegisterConfirmModal.js";
|
|
7
|
+
import stdin_default$5 from "../TermsModal/TermsModal.js";
|
|
8
|
+
import stdin_default$7 from "../ForgotPasswordModal/ForgotPasswordModal.js";
|
|
9
|
+
import stdin_default$8 from "../ResetPasswordModal/ResetPasswordModal.js";
|
|
10
|
+
import stdin_default$9 from "../ResetConfirmModal/ResetConfirmModal.js";
|
|
11
|
+
import stdin_default$1 from "../LoginModal/LoginModal.js";
|
|
12
|
+
import stdin_default$a from "../VerifyEmailModal/VerifyEmailModal.js";
|
|
13
|
+
import stdin_default from "../Header/Header.js";
|
|
14
|
+
import "../../styles/rwd.js";
|
|
15
|
+
import "../Text/Text.styles.js";
|
|
16
|
+
import "../Button/Button.styles.js";
|
|
17
|
+
import "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
18
|
+
import "../Modal/Modal.styles.js";
|
|
19
|
+
import "react-qr-code";
|
|
20
|
+
import "../Grid/Grid.styles.js";
|
|
21
|
+
import "../CryptoAddress/CryptoAddress.js";
|
|
22
|
+
import { cooldownHOC } from "../../utils/customHooks.js";
|
|
23
|
+
import "../Modal/Modal.js";
|
|
24
|
+
import "../StepController/StepController.js";
|
|
25
|
+
import "../StepController/StepControllerContext.js";
|
|
26
|
+
import stdin_default$2 from "../2FA/EnterCode.js";
|
|
27
|
+
import { AuthContext } from "../../context/AuthContext.js";
|
|
28
|
+
import "../2FA/Sucess2FA.js";
|
|
29
|
+
import "js-cookie";
|
|
30
|
+
import "../../model/axios.js";
|
|
31
|
+
import "../Layout/Layout.js";
|
|
32
|
+
import stdin_default$3 from "../2FA/ResetCode.js";
|
|
33
|
+
import { authAPI } from "../../api/auth.js";
|
|
34
|
+
import "../2FA/main-flow.js";
|
|
35
|
+
import fetchDataPublic from "../../api/fetchDataPublic.js";
|
|
36
|
+
import { withRouter } from "../../utils/withRouter.js";
|
|
37
|
+
import { checkActionCode } from "firebase/auth";
|
|
38
|
+
import { auth } from "../../firebase-config.js";
|
|
39
|
+
const Outer = styled.div.withConfig({
|
|
40
|
+
shouldForwardProp: (props) => !["fixed"].includes(props)
|
|
41
|
+
})`
|
|
42
|
+
position: relative;
|
|
43
|
+
${({ fixed }) => fixed && css`
|
|
44
|
+
position: fixed;
|
|
45
|
+
z-index: 99;
|
|
46
|
+
top: 0;
|
|
47
|
+
left: 50%;
|
|
48
|
+
width: 100%;
|
|
49
|
+
background: white;
|
|
50
|
+
max-width: ${MAX_WIDTH}px;
|
|
51
|
+
transform: translateX(-50%);
|
|
52
|
+
border-left: 1px solid ${GRAY_BASE_HEX};
|
|
53
|
+
border-right: 1px solid ${GRAY_BASE_HEX};
|
|
54
|
+
`}
|
|
55
|
+
`;
|
|
56
|
+
const _HeaderHoClass = class _HeaderHoClass extends Component {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments);
|
|
59
|
+
this.state = {
|
|
60
|
+
mobileMenuOpen: false,
|
|
61
|
+
isModalOpen: {
|
|
62
|
+
login: false,
|
|
63
|
+
signUp: false,
|
|
64
|
+
terms: false,
|
|
65
|
+
confirm: false,
|
|
66
|
+
forgot: false,
|
|
67
|
+
resetPassword: false,
|
|
68
|
+
confirmReset: false,
|
|
69
|
+
enter2fa: false,
|
|
70
|
+
resetCode: false,
|
|
71
|
+
verifyEmail: false
|
|
72
|
+
},
|
|
73
|
+
userInfo: {
|
|
74
|
+
email: void 0,
|
|
75
|
+
password: void 0,
|
|
76
|
+
newsletter: void 0,
|
|
77
|
+
terms: void 0
|
|
78
|
+
},
|
|
79
|
+
popupError: {
|
|
80
|
+
popup: void 0,
|
|
81
|
+
message: void 0,
|
|
82
|
+
field: void 0
|
|
83
|
+
},
|
|
84
|
+
popupSuccess: {
|
|
85
|
+
popup: void 0,
|
|
86
|
+
message: void 0
|
|
87
|
+
},
|
|
88
|
+
isActionLoading: void 0,
|
|
89
|
+
termsData: void 0,
|
|
90
|
+
isResettingExpiredToken: false
|
|
91
|
+
};
|
|
92
|
+
this.checkForModals = () => {
|
|
93
|
+
const { isLogin, isSignUp, isResetPassword, isVerifyEmail } = this.props;
|
|
94
|
+
const { user } = this.context;
|
|
95
|
+
const { isModalOpen } = this.state;
|
|
96
|
+
const { login, signUp, resetPassword, verifyEmail } = isModalOpen;
|
|
97
|
+
const isAnyModalOpen = Object.values(isModalOpen).some((value) => value === true);
|
|
98
|
+
if (isAnyModalOpen) return;
|
|
99
|
+
if (isLogin && !user && !login) {
|
|
100
|
+
this.setState((prevState) => ({
|
|
101
|
+
...prevState,
|
|
102
|
+
isModalOpen: {
|
|
103
|
+
...isModalOpen,
|
|
104
|
+
login: true
|
|
105
|
+
}
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
if (isSignUp && !user && !signUp) {
|
|
109
|
+
this.setState((prevState) => ({
|
|
110
|
+
...prevState,
|
|
111
|
+
isModalOpen: {
|
|
112
|
+
...isModalOpen,
|
|
113
|
+
signUp: true
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
if (isResetPassword && !user && !resetPassword) {
|
|
118
|
+
this.setState((prevState) => ({
|
|
119
|
+
...prevState,
|
|
120
|
+
isModalOpen: {
|
|
121
|
+
...isModalOpen,
|
|
122
|
+
resetPassword: true
|
|
123
|
+
}
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
if (isVerifyEmail && !verifyEmail) {
|
|
127
|
+
this.setState((prevState) => ({
|
|
128
|
+
...prevState,
|
|
129
|
+
isModalOpen: {
|
|
130
|
+
...isModalOpen,
|
|
131
|
+
verifyEmail: true
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
this.setOpenModalStatus = (modalId, status) => {
|
|
137
|
+
const { isModalOpen } = this.state;
|
|
138
|
+
const { onSignupModalClose, navigate } = this.props;
|
|
139
|
+
if (!onSignupModalClose) {
|
|
140
|
+
window.history.pushState("", "", modalId === "login" ? "/login" : modalId === "signUp" ? "/signup" : "/");
|
|
141
|
+
if ((modalId === "login" || modalId === "signUp" || modalId === "resetPassword" || modalId === "verifyEmail") && !status) {
|
|
142
|
+
navigate("/");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
this.setState((prevState) => ({
|
|
146
|
+
...prevState,
|
|
147
|
+
isModalOpen: {
|
|
148
|
+
...isModalOpen,
|
|
149
|
+
[modalId]: status
|
|
150
|
+
},
|
|
151
|
+
// we need to reset the expired token flag when closing forgot password modal
|
|
152
|
+
...modalId === "forgot" && !status && { isResettingExpiredToken: false }
|
|
153
|
+
}));
|
|
154
|
+
};
|
|
155
|
+
this.switchOpenModal = (prevModalId, nextModalId) => {
|
|
156
|
+
const { isModalOpen } = this.state;
|
|
157
|
+
if (nextModalId === "login" || nextModalId === "signUp") {
|
|
158
|
+
window.history.pushState("", "", nextModalId === "login" ? "/login" : nextModalId === "signUp" ? "/signup" : "/");
|
|
159
|
+
}
|
|
160
|
+
this.setState((prevState) => ({
|
|
161
|
+
...prevState,
|
|
162
|
+
isModalOpen: {
|
|
163
|
+
...isModalOpen,
|
|
164
|
+
[prevModalId]: false,
|
|
165
|
+
[nextModalId]: true
|
|
166
|
+
}
|
|
167
|
+
}));
|
|
168
|
+
};
|
|
169
|
+
this.setUserInfo = (userInfo) => {
|
|
170
|
+
this.setState((prevState) => ({
|
|
171
|
+
...prevState,
|
|
172
|
+
userInfo
|
|
173
|
+
}));
|
|
174
|
+
};
|
|
175
|
+
this.setPopupError = (popup, message, field = null) => {
|
|
176
|
+
this.setState((prevState) => ({
|
|
177
|
+
...prevState,
|
|
178
|
+
popupError: {
|
|
179
|
+
popup,
|
|
180
|
+
message,
|
|
181
|
+
field
|
|
182
|
+
}
|
|
183
|
+
}));
|
|
184
|
+
};
|
|
185
|
+
this.clearPopupError = () => {
|
|
186
|
+
this.setState((prevState) => ({
|
|
187
|
+
...prevState,
|
|
188
|
+
popupError: {
|
|
189
|
+
popup: void 0,
|
|
190
|
+
message: void 0,
|
|
191
|
+
field: void 0
|
|
192
|
+
}
|
|
193
|
+
}));
|
|
194
|
+
};
|
|
195
|
+
this.setPopupSuccess = (popup, message) => {
|
|
196
|
+
this.setState((prevState) => ({
|
|
197
|
+
...prevState,
|
|
198
|
+
popupSuccess: {
|
|
199
|
+
popup,
|
|
200
|
+
message
|
|
201
|
+
}
|
|
202
|
+
}));
|
|
203
|
+
};
|
|
204
|
+
this.clearPopupSuccess = () => {
|
|
205
|
+
this.setState((prevState) => ({
|
|
206
|
+
...prevState,
|
|
207
|
+
popupSuccess: {
|
|
208
|
+
popup: void 0,
|
|
209
|
+
message: void 0
|
|
210
|
+
}
|
|
211
|
+
}));
|
|
212
|
+
};
|
|
213
|
+
this.setIsActionLoading = (popup) => {
|
|
214
|
+
this.setState({
|
|
215
|
+
isActionLoading: popup
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
componentWillUnmount() {
|
|
220
|
+
document.body.style.overflow = "unset";
|
|
221
|
+
}
|
|
222
|
+
componentDidUpdate(prevProps, prevState) {
|
|
223
|
+
const isOpenCurrent = Object.values(this.state.isModalOpen).some((popup) => popup);
|
|
224
|
+
const isOpenPrev = Object.values(prevState.isModalOpen).some((popup) => popup);
|
|
225
|
+
const { mobileMenuOpen } = this.state;
|
|
226
|
+
const { isFetchingUser, verifyEmailError } = this.context;
|
|
227
|
+
if (!mobileMenuOpen) {
|
|
228
|
+
if (isOpenCurrent) {
|
|
229
|
+
document.body.style.overflow = "hidden";
|
|
230
|
+
} else if (isOpenPrev) {
|
|
231
|
+
document.body.style.overflow = "unset";
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (verifyEmailError?.code === "auth/invalid-action-code" && !window.location.href.includes("login")) {
|
|
235
|
+
this.props.navigate("/login");
|
|
236
|
+
this.props.navigate(0);
|
|
237
|
+
}
|
|
238
|
+
if (!isFetchingUser) {
|
|
239
|
+
this.checkForModals();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
render() {
|
|
243
|
+
const { isModalOpen, userInfo, isActionLoading, termsData, isResettingExpiredToken } = this.state;
|
|
244
|
+
const {
|
|
245
|
+
fixed,
|
|
246
|
+
activateMenu,
|
|
247
|
+
activeMenu,
|
|
248
|
+
withoutLoginSignupButton,
|
|
249
|
+
useRelativePathForMenu,
|
|
250
|
+
isLoginModalOpen,
|
|
251
|
+
setIsLoginModalOpen,
|
|
252
|
+
cooldown
|
|
253
|
+
} = this.props;
|
|
254
|
+
const {
|
|
255
|
+
getUser,
|
|
256
|
+
user = {},
|
|
257
|
+
avatar,
|
|
258
|
+
logoutUser,
|
|
259
|
+
loginUser,
|
|
260
|
+
waitingFor2fa,
|
|
261
|
+
firebaseError,
|
|
262
|
+
loginUserWithTotp,
|
|
263
|
+
createUser,
|
|
264
|
+
handleResetPassword,
|
|
265
|
+
resendActivationEmail,
|
|
266
|
+
verifyEmailError,
|
|
267
|
+
isVerifyingEmail
|
|
268
|
+
} = this.context;
|
|
269
|
+
return /* @__PURE__ */ jsxs(Outer, { fixed, children: [
|
|
270
|
+
/* @__PURE__ */ jsx(
|
|
271
|
+
stdin_default,
|
|
272
|
+
{
|
|
273
|
+
user,
|
|
274
|
+
activeMenu,
|
|
275
|
+
activateMenu,
|
|
276
|
+
useRelativePathForMenu,
|
|
277
|
+
userPhoto: avatar,
|
|
278
|
+
logoutUser,
|
|
279
|
+
noFixedPosition: true,
|
|
280
|
+
withoutLoginSignupButton,
|
|
281
|
+
onLoginClick: () => {
|
|
282
|
+
this.setOpenModalStatus("login", true);
|
|
283
|
+
},
|
|
284
|
+
onSignUpClick: () => {
|
|
285
|
+
this.setOpenModalStatus("signUp", true);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
),
|
|
289
|
+
/* @__PURE__ */ jsx(
|
|
290
|
+
stdin_default$1,
|
|
291
|
+
{
|
|
292
|
+
isActionLoading,
|
|
293
|
+
popupError: this.state.popupError,
|
|
294
|
+
isModalOpen: !!(isModalOpen.login || isLoginModalOpen),
|
|
295
|
+
onModalClose: () => {
|
|
296
|
+
this.setOpenModalStatus("login", false);
|
|
297
|
+
setIsLoginModalOpen?.(false);
|
|
298
|
+
this.clearPopupError();
|
|
299
|
+
this.setIsActionLoading(void 0);
|
|
300
|
+
},
|
|
301
|
+
onModalSwitch: () => {
|
|
302
|
+
this.switchOpenModal("login", "signUp");
|
|
303
|
+
setIsLoginModalOpen?.(false);
|
|
304
|
+
this.clearPopupError();
|
|
305
|
+
this.setIsActionLoading(void 0);
|
|
306
|
+
},
|
|
307
|
+
onForgotPassword: () => {
|
|
308
|
+
this.switchOpenModal("login", "forgot");
|
|
309
|
+
setIsLoginModalOpen?.(false);
|
|
310
|
+
this.clearPopupError();
|
|
311
|
+
this.setIsActionLoading(void 0);
|
|
312
|
+
},
|
|
313
|
+
onFormSend: async ({ email, password }) => {
|
|
314
|
+
this.clearPopupError();
|
|
315
|
+
this.setIsActionLoading("login");
|
|
316
|
+
try {
|
|
317
|
+
if (password.length > 128) {
|
|
318
|
+
this.setPopupError("login", "Your password cannot exceed 128 characters");
|
|
319
|
+
this.setIsActionLoading(void 0);
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
await loginUser(email, password);
|
|
323
|
+
await getUser();
|
|
324
|
+
this.setOpenModalStatus("login", false);
|
|
325
|
+
setIsLoginModalOpen?.(false);
|
|
326
|
+
this.clearPopupError();
|
|
327
|
+
this.setIsActionLoading(void 0);
|
|
328
|
+
} catch (error) {
|
|
329
|
+
const errorMessage = error?.message;
|
|
330
|
+
if (error?.code === "auth/multi-factor-auth-required") {
|
|
331
|
+
this.switchOpenModal("login", "enter2fa");
|
|
332
|
+
this.clearPopupError();
|
|
333
|
+
this.setIsActionLoading(void 0);
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
if (errorMessage) {
|
|
337
|
+
this.setPopupError("login", errorMessage);
|
|
338
|
+
} else {
|
|
339
|
+
this.setPopupError("login", "Oops. Something's not right there. Try again?");
|
|
340
|
+
}
|
|
341
|
+
this.setIsActionLoading(void 0);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
),
|
|
346
|
+
waitingFor2fa && /* @__PURE__ */ jsx(
|
|
347
|
+
stdin_default$2,
|
|
348
|
+
{
|
|
349
|
+
isModal: true,
|
|
350
|
+
popupError: this.state.popupError,
|
|
351
|
+
isActionLoading,
|
|
352
|
+
isModalOpen: isModalOpen.enter2fa,
|
|
353
|
+
onModalClose: () => {
|
|
354
|
+
this.setOpenModalStatus("enter2fa", false);
|
|
355
|
+
this.clearPopupError();
|
|
356
|
+
this.setIsActionLoading(void 0);
|
|
357
|
+
},
|
|
358
|
+
onModalSwitch: () => {
|
|
359
|
+
this.switchOpenModal("enter2fa", "resetCode");
|
|
360
|
+
this.clearPopupError();
|
|
361
|
+
this.setIsActionLoading(void 0);
|
|
362
|
+
},
|
|
363
|
+
onFormSend: async ({ otpInput }) => {
|
|
364
|
+
this.setIsActionLoading("enter2fa");
|
|
365
|
+
try {
|
|
366
|
+
await loginUserWithTotp(otpInput, firebaseError);
|
|
367
|
+
await getUser();
|
|
368
|
+
this.setOpenModalStatus("enter2fa", false);
|
|
369
|
+
this.clearPopupError();
|
|
370
|
+
this.setIsActionLoading(void 0);
|
|
371
|
+
} catch (error) {
|
|
372
|
+
console.log("🚀 ~ file: HeaderHo.jsx:364 ~ error:", error);
|
|
373
|
+
if (error?.code === "auth/invalid-verification-code") {
|
|
374
|
+
this.setPopupError("enter2fa", "That’s not the right 2FA code. Try again");
|
|
375
|
+
} else if (error?.code === "auth/code-expired") {
|
|
376
|
+
this.setPopupError("enter2fa", "Time out. Please restart the flow and log in again");
|
|
377
|
+
} else {
|
|
378
|
+
this.setPopupError("enter2fa", error?.message);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
this.setIsActionLoading(void 0);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
),
|
|
385
|
+
/* @__PURE__ */ jsx(
|
|
386
|
+
stdin_default$3,
|
|
387
|
+
{
|
|
388
|
+
isModalOpen: isModalOpen.resetCode,
|
|
389
|
+
onModalClose: () => {
|
|
390
|
+
this.setOpenModalStatus("resetCode", false);
|
|
391
|
+
this.clearPopupError();
|
|
392
|
+
this.setIsActionLoading(void 0);
|
|
393
|
+
},
|
|
394
|
+
onModalSwitch: () => {
|
|
395
|
+
this.clearPopupError();
|
|
396
|
+
this.setIsActionLoading(void 0);
|
|
397
|
+
this.switchOpenModal("resetCode", "enter2fa");
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
),
|
|
401
|
+
/* @__PURE__ */ jsx(
|
|
402
|
+
stdin_default$4,
|
|
403
|
+
{
|
|
404
|
+
isActionLoading,
|
|
405
|
+
popupError: this.state.popupError,
|
|
406
|
+
clearPopupError: this.clearPopupError,
|
|
407
|
+
setPopupError: this.setPopupError,
|
|
408
|
+
isModalOpen: isModalOpen.signUp,
|
|
409
|
+
onModalClose: () => {
|
|
410
|
+
const { location, navigate, onSignupModalClose } = this.props;
|
|
411
|
+
var body = document.getElementsByTagName("body")[0];
|
|
412
|
+
body.style.overflow = "unset";
|
|
413
|
+
this.setOpenModalStatus("signUp", false);
|
|
414
|
+
this.clearPopupError();
|
|
415
|
+
this.setIsActionLoading(void 0);
|
|
416
|
+
onSignupModalClose?.();
|
|
417
|
+
if (location?.state?.isHowStokrWorksRedirect) {
|
|
418
|
+
navigate("/how-stokr-works/for-investors");
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
onTermsClicked: (_termsData) => {
|
|
422
|
+
this.setState((prevState) => ({
|
|
423
|
+
...prevState,
|
|
424
|
+
termsData: _termsData
|
|
425
|
+
}));
|
|
426
|
+
this.switchOpenModal("signUp", "terms");
|
|
427
|
+
this.clearPopupError();
|
|
428
|
+
this.setIsActionLoading(void 0);
|
|
429
|
+
},
|
|
430
|
+
onModalSwitch: () => {
|
|
431
|
+
this.switchOpenModal("signUp", "login");
|
|
432
|
+
this.clearPopupError();
|
|
433
|
+
this.setIsActionLoading(void 0);
|
|
434
|
+
const { onSignupModalClose } = this.props;
|
|
435
|
+
onSignupModalClose?.();
|
|
436
|
+
},
|
|
437
|
+
onFormSend: async (_userInfo) => {
|
|
438
|
+
this.clearPopupError();
|
|
439
|
+
this.setIsActionLoading("signUp");
|
|
440
|
+
try {
|
|
441
|
+
if (_userInfo.password.length > 128) {
|
|
442
|
+
this.setPopupError("register", "Your password cannot exceed 128 characters", "password");
|
|
443
|
+
this.setIsActionLoading(void 0);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
await createUser(_userInfo.email, _userInfo.password);
|
|
447
|
+
cooldown?.startCooldown();
|
|
448
|
+
if (_userInfo.newsletter) {
|
|
449
|
+
await fetchDataPublic("emails/subscribe", {
|
|
450
|
+
email: _userInfo.email,
|
|
451
|
+
listName: "newsletter"
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
this.setUserInfo(_userInfo);
|
|
455
|
+
this.switchOpenModal("signUp", "confirm");
|
|
456
|
+
this.setIsActionLoading(void 0);
|
|
457
|
+
} catch (error) {
|
|
458
|
+
console.log(error);
|
|
459
|
+
let errorMessage = "Oops, something went wrong";
|
|
460
|
+
if (error?.response?.status === 429) {
|
|
461
|
+
errorMessage = error.response.data?.message;
|
|
462
|
+
}
|
|
463
|
+
this.setIsActionLoading(void 0);
|
|
464
|
+
if (error?.code === "auth/email-already-in-use") {
|
|
465
|
+
this.setPopupError("register", "This email address is already taken", "email");
|
|
466
|
+
} else if (error?.code === "auth/weak-password") {
|
|
467
|
+
this.setPopupError("register", "The password is too weak. Please try again.", "password");
|
|
468
|
+
} else if (error?.code === "auth/error-code:-47") {
|
|
469
|
+
this.setPopupError("register", "Too many signup attempts. Please try again later.");
|
|
470
|
+
} else {
|
|
471
|
+
this.setPopupError("register", errorMessage);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
),
|
|
477
|
+
/* @__PURE__ */ jsx(
|
|
478
|
+
stdin_default$5,
|
|
479
|
+
{
|
|
480
|
+
isModalOpen: isModalOpen.terms,
|
|
481
|
+
termsData,
|
|
482
|
+
onModalClose: () => {
|
|
483
|
+
this.setOpenModalStatus("terms", false);
|
|
484
|
+
},
|
|
485
|
+
onModalSwitch: () => {
|
|
486
|
+
this.switchOpenModal("terms", "signUp");
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
),
|
|
490
|
+
/* @__PURE__ */ jsx(
|
|
491
|
+
stdin_default$6,
|
|
492
|
+
{
|
|
493
|
+
id: "form-submitted-popup",
|
|
494
|
+
isActionLoading,
|
|
495
|
+
userInfo,
|
|
496
|
+
cooldown,
|
|
497
|
+
popupError: this.state.popupError,
|
|
498
|
+
popupSuccess: this.state.popupSuccess,
|
|
499
|
+
isModalOpen: isModalOpen.confirm,
|
|
500
|
+
onModalClose: () => {
|
|
501
|
+
this.setOpenModalStatus("confirm", false);
|
|
502
|
+
this.clearPopupSuccess();
|
|
503
|
+
this.clearPopupError();
|
|
504
|
+
this.setIsActionLoading(void 0);
|
|
505
|
+
},
|
|
506
|
+
onResend: async () => {
|
|
507
|
+
this.clearPopupSuccess();
|
|
508
|
+
this.clearPopupError();
|
|
509
|
+
this.setIsActionLoading("resend");
|
|
510
|
+
try {
|
|
511
|
+
const email = this.state.userInfo.email;
|
|
512
|
+
await resendActivationEmail(email);
|
|
513
|
+
cooldown?.startCooldown();
|
|
514
|
+
this.setPopupSuccess("resend", "Email sent.");
|
|
515
|
+
this.setIsActionLoading(void 0);
|
|
516
|
+
} catch (error) {
|
|
517
|
+
console.log(error);
|
|
518
|
+
this.setPopupError("resend", "Something went wrong.");
|
|
519
|
+
this.setIsActionLoading(void 0);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
),
|
|
524
|
+
/* @__PURE__ */ jsx(
|
|
525
|
+
stdin_default$7,
|
|
526
|
+
{
|
|
527
|
+
isActionLoading,
|
|
528
|
+
popupError: this.state.popupError,
|
|
529
|
+
popupSuccess: this.state.popupSuccess,
|
|
530
|
+
isModalOpen: isModalOpen.forgot,
|
|
531
|
+
isResettingExpiredToken,
|
|
532
|
+
onModalClose: () => {
|
|
533
|
+
this.setOpenModalStatus("forgot", false);
|
|
534
|
+
this.clearPopupError();
|
|
535
|
+
this.clearPopupSuccess();
|
|
536
|
+
this.setIsActionLoading(void 0);
|
|
537
|
+
if (isResettingExpiredToken) {
|
|
538
|
+
this.setOpenModalStatus("resetPassword", false);
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
onModalSwitch: () => {
|
|
542
|
+
this.switchOpenModal("forgot", "login");
|
|
543
|
+
this.clearPopupError();
|
|
544
|
+
this.clearPopupSuccess();
|
|
545
|
+
this.setIsActionLoading(void 0);
|
|
546
|
+
},
|
|
547
|
+
onFormSend: async ({ email }) => {
|
|
548
|
+
this.clearPopupError();
|
|
549
|
+
this.setIsActionLoading("forgot");
|
|
550
|
+
const payload = { email };
|
|
551
|
+
if (isResettingExpiredToken) {
|
|
552
|
+
console.log("isResettingExpiredToken: ", isResettingExpiredToken);
|
|
553
|
+
payload.ventureInvite = true;
|
|
554
|
+
}
|
|
555
|
+
try {
|
|
556
|
+
await authAPI("forgotPass", payload);
|
|
557
|
+
this.setPopupSuccess(
|
|
558
|
+
"forgot",
|
|
559
|
+
`We sent a message to ${email} (you might need to check your junk or spam folder) — tap the link inside to create a new password.`
|
|
560
|
+
);
|
|
561
|
+
this.setIsActionLoading(void 0);
|
|
562
|
+
} catch (error) {
|
|
563
|
+
console.log(error);
|
|
564
|
+
let errorMessage = `Too many requests. Please try again later.`;
|
|
565
|
+
console.log(error?.response);
|
|
566
|
+
if (error?.response?.status === 429 || error?.includes("429")) {
|
|
567
|
+
errorMessage = error.response.data?.message;
|
|
568
|
+
}
|
|
569
|
+
this.setPopupError("forgot", errorMessage);
|
|
570
|
+
this.setIsActionLoading(void 0);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
),
|
|
575
|
+
/* @__PURE__ */ jsx(
|
|
576
|
+
stdin_default$8,
|
|
577
|
+
{
|
|
578
|
+
isActionLoading,
|
|
579
|
+
popupError: this.state.popupError,
|
|
580
|
+
isModalOpen: isModalOpen.resetPassword,
|
|
581
|
+
onModalClose: () => {
|
|
582
|
+
const url = new URL(window.location);
|
|
583
|
+
url.searchParams.delete("oobCode");
|
|
584
|
+
url.searchParams.delete("mode");
|
|
585
|
+
window.history.replaceState({}, "", url.toString());
|
|
586
|
+
this.setOpenModalStatus("resetPassword", false);
|
|
587
|
+
this.clearPopupError();
|
|
588
|
+
this.setIsActionLoading(void 0);
|
|
589
|
+
},
|
|
590
|
+
onModalSwitch: () => {
|
|
591
|
+
window.history.pushState({}, null, "/login");
|
|
592
|
+
this.switchOpenModal("resetPassword", "login");
|
|
593
|
+
this.clearPopupError();
|
|
594
|
+
this.setIsActionLoading(void 0);
|
|
595
|
+
},
|
|
596
|
+
onFormSend: async ({ password }) => {
|
|
597
|
+
this.clearPopupError();
|
|
598
|
+
this.setIsActionLoading("resetPassword");
|
|
599
|
+
try {
|
|
600
|
+
await handleResetPassword(password);
|
|
601
|
+
this.switchOpenModal("resetPassword", "confirmReset");
|
|
602
|
+
this.setIsActionLoading(void 0);
|
|
603
|
+
} catch (error) {
|
|
604
|
+
console.log(error);
|
|
605
|
+
this.setPopupError("resetPassword", error?.message || "Something went wrong.");
|
|
606
|
+
this.setIsActionLoading(void 0);
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
onLoad: async () => {
|
|
610
|
+
const { location } = this.props;
|
|
611
|
+
const query = new URLSearchParams(location?.search);
|
|
612
|
+
const oobCode = query.get("oobCode");
|
|
613
|
+
if (oobCode && oobCode !== "") {
|
|
614
|
+
this.setIsActionLoading("resetPassword");
|
|
615
|
+
try {
|
|
616
|
+
await checkActionCode(auth, oobCode);
|
|
617
|
+
this.setIsActionLoading(void 0);
|
|
618
|
+
} catch (error) {
|
|
619
|
+
console.log("Password reset code error:", error);
|
|
620
|
+
if (error?.code === "auth/expired-action-code") {
|
|
621
|
+
this.setState((prevState) => ({
|
|
622
|
+
...prevState,
|
|
623
|
+
isResettingExpiredToken: true
|
|
624
|
+
}));
|
|
625
|
+
const url = new URL(window.location);
|
|
626
|
+
url.searchParams.delete("oobCode");
|
|
627
|
+
url.searchParams.delete("mode");
|
|
628
|
+
window.history.replaceState({}, "", url.toString());
|
|
629
|
+
this.switchOpenModal("resetPassword", "forgot");
|
|
630
|
+
} else {
|
|
631
|
+
this.setPopupError(
|
|
632
|
+
"resetPassword",
|
|
633
|
+
"Something went wrong with the password reset link. Please try again."
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
this.setIsActionLoading(void 0);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
),
|
|
642
|
+
/* @__PURE__ */ jsx(
|
|
643
|
+
stdin_default$9,
|
|
644
|
+
{
|
|
645
|
+
isModalOpen: isModalOpen.confirmReset,
|
|
646
|
+
onModalClose: () => {
|
|
647
|
+
this.setOpenModalStatus("confirmReset", false);
|
|
648
|
+
},
|
|
649
|
+
onModalSwitch: () => {
|
|
650
|
+
const { location } = this.props;
|
|
651
|
+
const query = new URLSearchParams(location?.search);
|
|
652
|
+
let userType = query.get("user_type");
|
|
653
|
+
if (userType && userType === "sa") {
|
|
654
|
+
window.open(`https://backoffice.${"stokr.info"}`);
|
|
655
|
+
} else {
|
|
656
|
+
this.switchOpenModal("confirmReset", "login");
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
),
|
|
661
|
+
!isVerifyingEmail && /* @__PURE__ */ jsx(
|
|
662
|
+
stdin_default$a,
|
|
663
|
+
{
|
|
664
|
+
id: "verify-email-popup",
|
|
665
|
+
isActionLoading,
|
|
666
|
+
popupError: this.state.popupError,
|
|
667
|
+
popupSuccess: this.state.popupSuccess,
|
|
668
|
+
isModalOpen: isModalOpen.verifyEmail,
|
|
669
|
+
continueUrl: `https://signup.${"stokr.info"}/welcome`,
|
|
670
|
+
error: verifyEmailError,
|
|
671
|
+
isSuccess: !verifyEmailError,
|
|
672
|
+
onModalSwitch: () => {
|
|
673
|
+
this.switchOpenModal("verifyEmail", "login");
|
|
674
|
+
this.clearPopupError();
|
|
675
|
+
this.setIsActionLoading(void 0);
|
|
676
|
+
},
|
|
677
|
+
onModalClose: () => {
|
|
678
|
+
this.setOpenModalStatus("verifyEmail", false);
|
|
679
|
+
this.clearPopupSuccess();
|
|
680
|
+
this.clearPopupError();
|
|
681
|
+
this.setIsActionLoading(void 0);
|
|
682
|
+
},
|
|
683
|
+
onResend: async (values) => {
|
|
684
|
+
this.clearPopupSuccess();
|
|
685
|
+
this.clearPopupError();
|
|
686
|
+
this.setIsActionLoading("resend");
|
|
687
|
+
try {
|
|
688
|
+
const email = values?.email;
|
|
689
|
+
await resendActivationEmail(email);
|
|
690
|
+
this.setPopupSuccess("resend", "Email sent.");
|
|
691
|
+
this.setIsActionLoading(void 0);
|
|
692
|
+
} catch (error) {
|
|
693
|
+
console.log(error);
|
|
694
|
+
this.setPopupError("resend", error?.message || "Something went wrong.");
|
|
695
|
+
this.setIsActionLoading(void 0);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
)
|
|
700
|
+
] });
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
_HeaderHoClass.propTypes = {};
|
|
704
|
+
_HeaderHoClass.contextType = AuthContext;
|
|
705
|
+
let HeaderHoClass = _HeaderHoClass;
|
|
706
|
+
const HeaderHo = withRouter(cooldownHOC(HeaderHoClass, 90));
|
|
707
|
+
export {
|
|
708
|
+
HeaderHo
|
|
709
|
+
};
|