@stokr/components-library 3.0.16 → 3.0.17
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 +187 -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/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 +89 -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 +224 -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/index.js +628 -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/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 +56 -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 +146 -146
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useState, useEffect } from "react";
|
|
3
|
+
import { Modal } from "../Modal/Modal.js";
|
|
4
|
+
import stdin_default$2 from "../StepController/StepController.js";
|
|
5
|
+
import { StepControllerProvider, StepControllerConsumer } from "../StepController/StepControllerContext.js";
|
|
6
|
+
import stdin_default$3 from "./InstallAuthApp.js";
|
|
7
|
+
import stdin_default$4 from "./Connect2FA.js";
|
|
8
|
+
import stdin_default$5 from "./EnterCode.js";
|
|
9
|
+
import { AuthContext } from "../../context/AuthContext.js";
|
|
10
|
+
import stdin_default$1 from "./Sucess2FA.js";
|
|
11
|
+
import fetchData from "../../api/fetchData.js";
|
|
12
|
+
import { ModalInner, ModalBack } from "../Modal/Modal.styles.js";
|
|
13
|
+
const stepsNames = ["app", "connect", "enter-code"];
|
|
14
|
+
const Enable2FAFlow = ({ showFlow, setShowFlow, onSuccess, totpData, onRequiresRecentLoginError }) => {
|
|
15
|
+
const { user, enrollUserToTotp, refreshIdToken } = useContext(AuthContext);
|
|
16
|
+
const [showSuccess, setshowSuccess] = useState(false);
|
|
17
|
+
const [popupError, setpopupError] = useState({
|
|
18
|
+
popup: void 0,
|
|
19
|
+
message: void 0
|
|
20
|
+
});
|
|
21
|
+
const refreshToken = async () => {
|
|
22
|
+
try {
|
|
23
|
+
refreshIdToken();
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.log("🚀 ~ error in refreshToken:", error);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (user) {
|
|
30
|
+
refreshToken();
|
|
31
|
+
}
|
|
32
|
+
}, [user]);
|
|
33
|
+
const onSubmit = async (data) => {
|
|
34
|
+
if (!user || !data) return console.log("not enough data");
|
|
35
|
+
try {
|
|
36
|
+
await enrollUserToTotp(user, totpData.totpSecret, data.otpInput, user.displayName);
|
|
37
|
+
setshowSuccess(true);
|
|
38
|
+
try {
|
|
39
|
+
await fetchData("auth/enable-2fa-email");
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.log("🚀 ~ error while sending email:", error);
|
|
42
|
+
}
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.log("🚀 ~ file: enable-2fa-flow.js:60 ~ error:", error);
|
|
45
|
+
if (error.code === "auth/invalid-verification-code") {
|
|
46
|
+
setpopupError({
|
|
47
|
+
popup: "enter2fa",
|
|
48
|
+
message: "That’s not the right 2FA code. Try again"
|
|
49
|
+
});
|
|
50
|
+
return { otpInput: "Invalid code" };
|
|
51
|
+
} else if (error.code === "auth/requires-recent-login") {
|
|
52
|
+
onRequiresRecentLoginError?.();
|
|
53
|
+
} else {
|
|
54
|
+
setpopupError({
|
|
55
|
+
popup: "enter2fa",
|
|
56
|
+
message: `${error?.message ? error?.message : "Something went wrong. Try again?"}`
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const onBackButtonClick = (stepController, prevStepIndex) => {
|
|
62
|
+
stepController.changeStep(stepsNames[prevStepIndex], prevStepIndex);
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ jsx(Modal, { isOpen: showFlow, onClose: () => setShowFlow(false), children: /* @__PURE__ */ jsx(ModalInner, { noPadding: true, children: showSuccess ? /* @__PURE__ */ jsx(
|
|
65
|
+
stdin_default$1,
|
|
66
|
+
{
|
|
67
|
+
onClick: () => {
|
|
68
|
+
if (onSuccess) onSuccess();
|
|
69
|
+
setshowSuccess(false);
|
|
70
|
+
setShowFlow(false);
|
|
71
|
+
},
|
|
72
|
+
subTitleLeft: "Your log in 2FA authentication is now set",
|
|
73
|
+
textRight: "You will now be asked for your 2FA code next time you log in."
|
|
74
|
+
}
|
|
75
|
+
) : /* @__PURE__ */ jsx(StepControllerProvider, { children: /* @__PURE__ */ jsx(StepControllerConsumer, { children: (stepController) => {
|
|
76
|
+
const prevStepIndex = stepController.activeStepIndex - 1;
|
|
77
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
ModalBack,
|
|
80
|
+
{
|
|
81
|
+
onClick: () => onBackButtonClick(stepController, prevStepIndex),
|
|
82
|
+
hide: stepController.activeStepIndex === 0
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ jsxs(
|
|
86
|
+
stdin_default$2,
|
|
87
|
+
{
|
|
88
|
+
stepsProgressList: [
|
|
89
|
+
{
|
|
90
|
+
id: "app",
|
|
91
|
+
handleClick: () => {
|
|
92
|
+
stepController.changeStep("app", 0);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "connect",
|
|
97
|
+
handleClick: () => {
|
|
98
|
+
stepController.changeStep("connect", 1);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "enter-code",
|
|
103
|
+
handleClick: () => stepController.changeStep("enter-code", 2)
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
...stepController,
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx(stdin_default$3, { id: "app", changeStep: () => stepController.changeStep("connect", 1, 0) }),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
stdin_default$4,
|
|
111
|
+
{
|
|
112
|
+
id: "connect",
|
|
113
|
+
changeStep: () => stepController.changeStep("enter-code", 2, 1),
|
|
114
|
+
totpData,
|
|
115
|
+
user
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ jsx(
|
|
119
|
+
stdin_default$5,
|
|
120
|
+
{
|
|
121
|
+
id: "enter-code",
|
|
122
|
+
changeStep: () => {
|
|
123
|
+
},
|
|
124
|
+
popupError,
|
|
125
|
+
onFormSend: onSubmit
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
] });
|
|
132
|
+
} }) }) }) });
|
|
133
|
+
};
|
|
134
|
+
var stdin_default = Enable2FAFlow;
|
|
135
|
+
export {
|
|
136
|
+
stdin_default as default
|
|
137
|
+
};
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useState, useEffect } from "react";
|
|
3
|
+
import { AuthContext } from "../../context/AuthContext.js";
|
|
4
|
+
import { Layout } from "../Layout/Layout.js";
|
|
5
|
+
import stdin_default$1 from "../LoginModal/LoginModal.js";
|
|
6
|
+
import stdin_default$4 from "../ForgotPasswordModal/ForgotPasswordModal.js";
|
|
7
|
+
import stdin_default$2 from "./EnterCode.js";
|
|
8
|
+
import background from "../../static/images/background3.png.js";
|
|
9
|
+
import stdin_default$3 from "./ResetCode.js";
|
|
10
|
+
import { authAPI } from "../../api/auth.js";
|
|
11
|
+
const LoginWithOTP = ({ withBackground }) => {
|
|
12
|
+
const { loginUser, waitingFor2fa, firebaseError, loginUserWithTotp, reset2faFlow } = useContext(AuthContext);
|
|
13
|
+
const [isModalOpen, setIsModalOpen] = useState({
|
|
14
|
+
login: true,
|
|
15
|
+
enter2fa: false,
|
|
16
|
+
forgot: false,
|
|
17
|
+
resetCode: false
|
|
18
|
+
});
|
|
19
|
+
const [isActionLoading, setIsActionLoading] = useState();
|
|
20
|
+
const [popupError, setPopupError] = useState({
|
|
21
|
+
popup: void 0,
|
|
22
|
+
message: void 0
|
|
23
|
+
});
|
|
24
|
+
const [popupSuccess, setPopupSuccess] = useState({
|
|
25
|
+
popup: void 0,
|
|
26
|
+
message: void 0
|
|
27
|
+
});
|
|
28
|
+
const switchOpenModal = (prevModalId, nextModalId) => {
|
|
29
|
+
setIsModalOpen({
|
|
30
|
+
...isModalOpen,
|
|
31
|
+
[prevModalId]: false,
|
|
32
|
+
[nextModalId]: true
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (waitingFor2fa) {
|
|
37
|
+
switchOpenModal("login", "enter2fa");
|
|
38
|
+
}
|
|
39
|
+
}, [waitingFor2fa]);
|
|
40
|
+
const handleSetPopupSuccess = (popup, message) => {
|
|
41
|
+
setPopupSuccess({ popup, message });
|
|
42
|
+
};
|
|
43
|
+
const clearPopupSuccess = () => {
|
|
44
|
+
setPopupSuccess({
|
|
45
|
+
popup: void 0,
|
|
46
|
+
message: void 0
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const handleSetPopupError = (popup, message) => {
|
|
50
|
+
setPopupError({ popup, message });
|
|
51
|
+
};
|
|
52
|
+
const clearPopupError = () => {
|
|
53
|
+
setPopupError({
|
|
54
|
+
popup: void 0,
|
|
55
|
+
message: void 0
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
const backgroundProp = `url(${background}) left top no-repeat`;
|
|
59
|
+
return /* @__PURE__ */ jsxs(Layout, { noHeader: true, noFooter: true, children: [
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
stdin_default$1,
|
|
62
|
+
{
|
|
63
|
+
isActionLoading,
|
|
64
|
+
popupError,
|
|
65
|
+
background: withBackground && backgroundProp,
|
|
66
|
+
isModalOpen: isModalOpen.login,
|
|
67
|
+
onModalClose: () => {
|
|
68
|
+
window.location.href = `https://${"stokr.info"}`;
|
|
69
|
+
},
|
|
70
|
+
onModalSwitch: () => {
|
|
71
|
+
window.location.href = `https://${"stokr.info"}/signup`;
|
|
72
|
+
},
|
|
73
|
+
onForgotPassword: () => {
|
|
74
|
+
switchOpenModal("login", "forgot");
|
|
75
|
+
clearPopupError();
|
|
76
|
+
setIsActionLoading(void 0);
|
|
77
|
+
},
|
|
78
|
+
onFormSend: async ({ email, password }) => {
|
|
79
|
+
clearPopupError();
|
|
80
|
+
setIsActionLoading("login");
|
|
81
|
+
try {
|
|
82
|
+
if (password.length > 128) {
|
|
83
|
+
handleSetPopupError("login", "Your password cannot exceed 128 characters");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
await loginUser(email, password);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
const errorMessage = error?.message;
|
|
89
|
+
if (error?.code === "auth/multi-factor-auth-required") {
|
|
90
|
+
clearPopupError();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (errorMessage) {
|
|
94
|
+
handleSetPopupError("login", errorMessage);
|
|
95
|
+
} else {
|
|
96
|
+
handleSetPopupError("login", "Oops. Something's not right there. Try again?");
|
|
97
|
+
}
|
|
98
|
+
} finally {
|
|
99
|
+
setIsActionLoading(void 0);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
stdin_default$2,
|
|
106
|
+
{
|
|
107
|
+
isModal: true,
|
|
108
|
+
isActionLoading,
|
|
109
|
+
popupError,
|
|
110
|
+
isModalOpen: isModalOpen.enter2fa,
|
|
111
|
+
background: withBackground && backgroundProp,
|
|
112
|
+
onModalClose: () => {
|
|
113
|
+
reset2faFlow();
|
|
114
|
+
switchOpenModal("enter2fa", "login");
|
|
115
|
+
clearPopupError();
|
|
116
|
+
setIsActionLoading(void 0);
|
|
117
|
+
},
|
|
118
|
+
onModalSwitch: () => {
|
|
119
|
+
switchOpenModal("enter2fa", "resetCode");
|
|
120
|
+
clearPopupError();
|
|
121
|
+
setIsActionLoading(void 0);
|
|
122
|
+
},
|
|
123
|
+
onFormSend: async ({ otpInput }) => {
|
|
124
|
+
setIsActionLoading("enter2fa");
|
|
125
|
+
try {
|
|
126
|
+
await loginUserWithTotp(otpInput, firebaseError);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
if (error?.code === "auth/invalid-verification-code") {
|
|
129
|
+
handleSetPopupError("enter2fa", "The verification code is not correct. Try again?");
|
|
130
|
+
} else if (error?.code === "auth/code-expired") {
|
|
131
|
+
handleSetPopupError("enter2fa", "Time out. Please restart the flow and log in again");
|
|
132
|
+
} else {
|
|
133
|
+
handleSetPopupError("enter2fa", error?.message);
|
|
134
|
+
}
|
|
135
|
+
} finally {
|
|
136
|
+
setIsActionLoading(void 0);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ jsx(
|
|
142
|
+
stdin_default$3,
|
|
143
|
+
{
|
|
144
|
+
isModalOpen: isModalOpen.resetCode,
|
|
145
|
+
background: withBackground && backgroundProp,
|
|
146
|
+
onModalClose: () => {
|
|
147
|
+
switchOpenModal("resetCode", "login");
|
|
148
|
+
clearPopupError();
|
|
149
|
+
setIsActionLoading(void 0);
|
|
150
|
+
},
|
|
151
|
+
onModalSwitch: () => {
|
|
152
|
+
switchOpenModal("resetCode", "enter2fa");
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ jsx(
|
|
157
|
+
stdin_default$4,
|
|
158
|
+
{
|
|
159
|
+
isActionLoading,
|
|
160
|
+
popupError,
|
|
161
|
+
background: withBackground && backgroundProp,
|
|
162
|
+
popupSuccess,
|
|
163
|
+
isModalOpen: isModalOpen.forgot,
|
|
164
|
+
onModalClose: () => {
|
|
165
|
+
switchOpenModal("forgot", "login");
|
|
166
|
+
clearPopupError();
|
|
167
|
+
clearPopupSuccess();
|
|
168
|
+
setIsActionLoading(void 0);
|
|
169
|
+
},
|
|
170
|
+
onModalSwitch: () => {
|
|
171
|
+
switchOpenModal("forgot", "login");
|
|
172
|
+
clearPopupError();
|
|
173
|
+
clearPopupSuccess();
|
|
174
|
+
setIsActionLoading(void 0);
|
|
175
|
+
},
|
|
176
|
+
onFormSend: async ({ email }) => {
|
|
177
|
+
clearPopupError();
|
|
178
|
+
setIsActionLoading("forgot");
|
|
179
|
+
try {
|
|
180
|
+
await authAPI("forgotPass", {
|
|
181
|
+
email
|
|
182
|
+
});
|
|
183
|
+
handleSetPopupSuccess(
|
|
184
|
+
"forgot",
|
|
185
|
+
`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.`
|
|
186
|
+
);
|
|
187
|
+
setIsActionLoading(void 0);
|
|
188
|
+
} catch (error) {
|
|
189
|
+
let errorMessage = `Too many requests. Please try again later.`;
|
|
190
|
+
console.log(error?.response);
|
|
191
|
+
if (error?.response?.status === 429) {
|
|
192
|
+
errorMessage = error.response.data?.message;
|
|
193
|
+
}
|
|
194
|
+
handleSetPopupError("forgot", errorMessage);
|
|
195
|
+
setIsActionLoading(void 0);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
] });
|
|
201
|
+
};
|
|
202
|
+
var stdin_default = LoginWithOTP;
|
|
203
|
+
export {
|
|
204
|
+
LoginWithOTP,
|
|
205
|
+
stdin_default as default
|
|
206
|
+
};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useContext, useState, useRef, useEffect } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { AuthContext } from "../../context/AuthContext.js";
|
|
5
|
+
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
6
|
+
import stdin_default$1 from "../Switch/Switch.js";
|
|
7
|
+
import { Text } from "../Text/Text.styles.js";
|
|
8
|
+
import stdin_default$5 from "./login-with-otp-flow.js";
|
|
9
|
+
import stdin_default$2 from "./enable-2fa-flow.js";
|
|
10
|
+
import stdin_default$3 from "./disable-2fa-flow.js";
|
|
11
|
+
import { colors } from "../../styles/colors.js";
|
|
12
|
+
import { InfoIcon } from "../InfoIcon/InfoIcon.js";
|
|
13
|
+
import { Modal } from "../Modal/Modal.js";
|
|
14
|
+
import stdin_default$4 from "./Sucess2FA.js";
|
|
15
|
+
import { ModalInner } from "../Modal/Modal.styles.js";
|
|
16
|
+
const Main2FAFlow = ({
|
|
17
|
+
onRequiresRecentLoginError,
|
|
18
|
+
open2faflow,
|
|
19
|
+
onLoginAgainClick,
|
|
20
|
+
openDisable2faflow,
|
|
21
|
+
title = "SET UP YOUR LOG IN TWO FACTOR AUTHENTICATION",
|
|
22
|
+
subtitle = "Protect your account with an additional layer of security to log in",
|
|
23
|
+
showSwitch = true,
|
|
24
|
+
customComponent,
|
|
25
|
+
onFlowClose
|
|
26
|
+
}) => {
|
|
27
|
+
const { user, checkMfaEnrollment, userMfaEnrollment, generateTotpSecret } = useContext(AuthContext);
|
|
28
|
+
const [isFlowopen, setIsFlowOpen] = useState({
|
|
29
|
+
enable2fa: open2faflow || false,
|
|
30
|
+
disable2fa: openDisable2faflow || false,
|
|
31
|
+
requiresRecentLogin: false
|
|
32
|
+
});
|
|
33
|
+
const [is2FAEnabled, setis2FAEnabled] = useState(false);
|
|
34
|
+
const [successMessage, setsuccessMessage] = useState();
|
|
35
|
+
const [isLoginRequired, setisLoginRequired] = useState(false);
|
|
36
|
+
const [totpData, settotpData] = useState();
|
|
37
|
+
const enable2faCompletedRef = useRef(false);
|
|
38
|
+
const disable2faCompletedRef = useRef(false);
|
|
39
|
+
const onRequiresRecentLoginErrorHandler = () => {
|
|
40
|
+
setIsFlowOpen({
|
|
41
|
+
requiresRecentLogin: true,
|
|
42
|
+
enable2fa: false,
|
|
43
|
+
disable2fa: false
|
|
44
|
+
});
|
|
45
|
+
onRequiresRecentLoginError?.();
|
|
46
|
+
};
|
|
47
|
+
const generateTotp = async () => {
|
|
48
|
+
try {
|
|
49
|
+
const response = await generateTotpSecret();
|
|
50
|
+
settotpData(response);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
if (error.code === "auth/requires-recent-login" || error.code === "auth/unsupported-first-factor") {
|
|
53
|
+
setisLoginRequired(true);
|
|
54
|
+
if (isFlowopen.enable2fa && !isFlowopen.requiresRecentLogin) {
|
|
55
|
+
onRequiresRecentLoginErrorHandler();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (userMfaEnrollment?.length > 0) {
|
|
62
|
+
setis2FAEnabled(true);
|
|
63
|
+
} else if (user) {
|
|
64
|
+
checkMfaEnrollment();
|
|
65
|
+
generateTotp();
|
|
66
|
+
}
|
|
67
|
+
}, [user, userMfaEnrollment]);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
let timeoutId;
|
|
70
|
+
if (successMessage) {
|
|
71
|
+
timeoutId = setTimeout(setsuccessMessage, 400);
|
|
72
|
+
}
|
|
73
|
+
return () => {
|
|
74
|
+
if (timeoutId != null) clearTimeout(timeoutId);
|
|
75
|
+
};
|
|
76
|
+
}, [successMessage]);
|
|
77
|
+
const switchOpenFlow = (prevFlowId, nextFlowId) => {
|
|
78
|
+
setIsFlowOpen((prev) => ({
|
|
79
|
+
...prev,
|
|
80
|
+
[prevFlowId]: false,
|
|
81
|
+
[nextFlowId]: true
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
const handleFlowClose = (flowId, completed = false) => {
|
|
85
|
+
setIsFlowOpen((prev) => ({ ...prev, [flowId]: false }));
|
|
86
|
+
if (onFlowClose) onFlowClose({ flow: flowId, completed });
|
|
87
|
+
};
|
|
88
|
+
const onEnable2FASuccess = async () => {
|
|
89
|
+
enable2faCompletedRef.current = true;
|
|
90
|
+
setis2FAEnabled(true);
|
|
91
|
+
checkMfaEnrollment();
|
|
92
|
+
setsuccessMessage("Your log in 2FA authentication is now set");
|
|
93
|
+
};
|
|
94
|
+
const onDisable2FASuccess = async () => {
|
|
95
|
+
disable2faCompletedRef.current = true;
|
|
96
|
+
setis2FAEnabled(false);
|
|
97
|
+
checkMfaEnrollment();
|
|
98
|
+
setsuccessMessage("Your log in 2FA authentication is removed");
|
|
99
|
+
};
|
|
100
|
+
const flowActions = {
|
|
101
|
+
openEnable2FA: () => switchOpenFlow("disable2fa", "enable2fa"),
|
|
102
|
+
openDisable2FA: () => switchOpenFlow("enable2fa", "disable2fa"),
|
|
103
|
+
closeFlows: () => {
|
|
104
|
+
const wasOpen = Object.keys(isFlowopen).find((key) => isFlowopen[key]);
|
|
105
|
+
setIsFlowOpen({
|
|
106
|
+
enable2fa: false,
|
|
107
|
+
disable2fa: false,
|
|
108
|
+
requiresRecentLogin: false
|
|
109
|
+
});
|
|
110
|
+
if (wasOpen) {
|
|
111
|
+
onFlowClose?.(wasOpen);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
is2FAEnabled,
|
|
115
|
+
isFlowOpen: isFlowopen
|
|
116
|
+
};
|
|
117
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
118
|
+
/* @__PURE__ */ jsx(ComponentWrapper, { alignVertically: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx("h5", { children: title }) }) }),
|
|
119
|
+
/* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx("p", { children: subtitle }) }),
|
|
120
|
+
showSwitch && /* @__PURE__ */ jsxs(ComponentWrapper, { noPaddingHorizontal: true, children: [
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
122
|
+
InfoIcon,
|
|
123
|
+
{
|
|
124
|
+
position: "top",
|
|
125
|
+
html: is2FAEnabled ? "Enabled" : "Disabled",
|
|
126
|
+
noIcon: true,
|
|
127
|
+
noMarginLeft: true,
|
|
128
|
+
disabled: isFlowopen.enable2fa || isFlowopen.disable2fa,
|
|
129
|
+
children: /* @__PURE__ */ jsx(
|
|
130
|
+
stdin_default$1,
|
|
131
|
+
{
|
|
132
|
+
value1: "disabled",
|
|
133
|
+
value2: "enabled",
|
|
134
|
+
value1Color: colors.orangishRed,
|
|
135
|
+
value2Color: colors.freshGreen,
|
|
136
|
+
value: is2FAEnabled ? "enabled" : "disabled",
|
|
137
|
+
revertToPrevious: true,
|
|
138
|
+
hideValues: true,
|
|
139
|
+
indicatorStyle: { margin: 0 },
|
|
140
|
+
handleChange: (value) => {
|
|
141
|
+
if (isLoginRequired && value === "enabled") {
|
|
142
|
+
setIsFlowOpen({
|
|
143
|
+
requiresRecentLogin: true,
|
|
144
|
+
enable2fa: false,
|
|
145
|
+
disable2fa: false
|
|
146
|
+
});
|
|
147
|
+
} else if (value === "enabled") {
|
|
148
|
+
switchOpenFlow("disable2fa", "enable2fa");
|
|
149
|
+
} else if (value === "disabled") {
|
|
150
|
+
switchOpenFlow("enable2fa", "disable2fa");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
successMessage && /* @__PURE__ */ jsx(Text, { small: true, success: true, style: { position: "absolute", bottom: 0, left: 0 }, children: /* @__PURE__ */ jsx("p", { children: successMessage }) })
|
|
158
|
+
] }),
|
|
159
|
+
customComponent && (typeof customComponent === "function" ? customComponent(flowActions) : React__default.isValidElement(customComponent) ? React__default.createElement(customComponent.type, {
|
|
160
|
+
...customComponent.props,
|
|
161
|
+
flowActions
|
|
162
|
+
}) : customComponent),
|
|
163
|
+
isFlowopen.enable2fa && /* @__PURE__ */ jsx(
|
|
164
|
+
stdin_default$2,
|
|
165
|
+
{
|
|
166
|
+
showFlow: isFlowopen.enable2fa,
|
|
167
|
+
setShowFlow: (value) => {
|
|
168
|
+
if (!value) {
|
|
169
|
+
handleFlowClose("enable2fa", enable2faCompletedRef.current);
|
|
170
|
+
} else {
|
|
171
|
+
setIsFlowOpen({ ...isFlowopen, enable2fa: value });
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
totpData,
|
|
175
|
+
onRequiresRecentLoginError: onRequiresRecentLoginErrorHandler,
|
|
176
|
+
onSuccess: onEnable2FASuccess
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
isFlowopen.disable2fa && /* @__PURE__ */ jsx(
|
|
180
|
+
stdin_default$3,
|
|
181
|
+
{
|
|
182
|
+
showFlow: isFlowopen.disable2fa,
|
|
183
|
+
setShowFlow: (value) => {
|
|
184
|
+
if (!value) {
|
|
185
|
+
handleFlowClose("disable2fa", disable2faCompletedRef.current);
|
|
186
|
+
} else {
|
|
187
|
+
setIsFlowOpen({ ...isFlowopen, disable2fa: value });
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
onRequiresRecentLoginError: onRequiresRecentLoginErrorHandler,
|
|
191
|
+
onSuccess: onDisable2FASuccess
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
isFlowopen.requiresRecentLogin && /* @__PURE__ */ jsx(Modal, { isOpen: isFlowopen.requiresRecentLogin, onClose: () => handleFlowClose("requiresRecentLogin"), children: /* @__PURE__ */ jsx(ModalInner, { noPadding: true, children: /* @__PURE__ */ jsx(
|
|
195
|
+
stdin_default$4,
|
|
196
|
+
{
|
|
197
|
+
onClick: () => {
|
|
198
|
+
onLoginAgainClick?.();
|
|
199
|
+
},
|
|
200
|
+
titleText: "LOG IN AGAIN",
|
|
201
|
+
subTitleLeft: "To enable your log in two factor authentication please log in again",
|
|
202
|
+
buttonText: "Log in again"
|
|
203
|
+
}
|
|
204
|
+
) }) }),
|
|
205
|
+
!user && /* @__PURE__ */ jsx(stdin_default$5, {})
|
|
206
|
+
] });
|
|
207
|
+
};
|
|
208
|
+
Main2FAFlow.propTypes = {
|
|
209
|
+
onRequiresRecentLoginError: PropTypes.func,
|
|
210
|
+
/** Called when any flow/modal is closed. Receives the flowId: 'enable2fa' | 'disable2fa' | 'requiresRecentLogin' */
|
|
211
|
+
onFlowClose: PropTypes.func
|
|
212
|
+
};
|
|
213
|
+
var stdin_default = Main2FAFlow;
|
|
214
|
+
export {
|
|
215
|
+
Main2FAFlow,
|
|
216
|
+
stdin_default as default
|
|
217
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { InfoIcon } from "../InfoIcon/InfoIcon.js";
|
|
5
|
+
import { Container, Head, Title, Body, Value, Equal } from "./AccountBalance.styles.js";
|
|
6
|
+
const AccountBalance = ({ title, value, unit, info = "", eqValue = "", eqUnit = "", right = false }) => /* @__PURE__ */ jsxs(Container, { right, children: [
|
|
7
|
+
/* @__PURE__ */ jsx(Head, { children: /* @__PURE__ */ jsxs(Title, { children: [
|
|
8
|
+
title,
|
|
9
|
+
info && /* @__PURE__ */ jsx(InfoIcon, { position: "top", title: info })
|
|
10
|
+
] }) }),
|
|
11
|
+
/* @__PURE__ */ jsxs(Body, { children: [
|
|
12
|
+
/* @__PURE__ */ jsxs(Value, { children: [
|
|
13
|
+
unit && `${unit} `,
|
|
14
|
+
value
|
|
15
|
+
] }),
|
|
16
|
+
eqValue && /* @__PURE__ */ jsxs(Equal, { children: [
|
|
17
|
+
"= ",
|
|
18
|
+
eqUnit && `${eqUnit}`,
|
|
19
|
+
eqValue
|
|
20
|
+
] })
|
|
21
|
+
] })
|
|
22
|
+
] });
|
|
23
|
+
AccountBalance.propTypes = {
|
|
24
|
+
title: PropTypes.string.isRequired,
|
|
25
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
26
|
+
unit: PropTypes.string.isRequired,
|
|
27
|
+
eqValue: PropTypes.string,
|
|
28
|
+
eqUnit: PropTypes.string,
|
|
29
|
+
info: PropTypes.string,
|
|
30
|
+
right: PropTypes.bool,
|
|
31
|
+
fontSizeSmall: PropTypes.bool
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
AccountBalance
|
|
35
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const Container = styled.div.withConfig({
|
|
3
|
+
shouldForwardProp: (props) => !["right"].includes(props)
|
|
4
|
+
})`
|
|
5
|
+
position: relative;
|
|
6
|
+
margin-right: -20px;
|
|
7
|
+
|
|
8
|
+
${(props) => props.right && `
|
|
9
|
+
text-align: right;
|
|
10
|
+
`}
|
|
11
|
+
`;
|
|
12
|
+
const Head = styled.div`
|
|
13
|
+
position: relative;
|
|
14
|
+
margin-bottom: 4px;
|
|
15
|
+
`;
|
|
16
|
+
const Body = styled.div`
|
|
17
|
+
position: relative;
|
|
18
|
+
`;
|
|
19
|
+
const Title = styled.div`
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
font-size: 11px;
|
|
22
|
+
line-height: 24px;
|
|
23
|
+
letter-spacing: 2.04px;
|
|
24
|
+
text-transform: uppercase;
|
|
25
|
+
`;
|
|
26
|
+
const Value = styled.div`
|
|
27
|
+
position: relative;
|
|
28
|
+
font-weight: 300;
|
|
29
|
+
font-size: 22px;
|
|
30
|
+
line-height: 28px;
|
|
31
|
+
letter-spacing: 0.8px;
|
|
32
|
+
`;
|
|
33
|
+
const Equal = styled.div`
|
|
34
|
+
position: relative;
|
|
35
|
+
line-height: 16px;
|
|
36
|
+
letter-spacing: 0.4px;
|
|
37
|
+
font-size: 11px;
|
|
38
|
+
font-style: italic;
|
|
39
|
+
margin-top: 8px;
|
|
40
|
+
`;
|
|
41
|
+
export {
|
|
42
|
+
Body,
|
|
43
|
+
Container,
|
|
44
|
+
Equal,
|
|
45
|
+
Head,
|
|
46
|
+
Title,
|
|
47
|
+
Value
|
|
48
|
+
};
|