@stokr/components-library 0.5.4 → 0.5.6
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/build/asset-manifest.json +9 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +1 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/build/static/js/main.31d6cfe0.js +0 -0
- package/dist/AccountBalance/AccountBalance.js +43 -0
- package/dist/AccountBalance/AccountBalance.stories.js +75 -0
- package/dist/AccountBalance/AccountBalance.styles.js +38 -0
- package/dist/AdminDashboard/Table/Table.js +120 -0
- package/dist/AdminDashboard/Table/Table.styles.js +111 -0
- package/dist/AgreementItem/AgreementItem.js +38 -0
- package/dist/AgreementItem/AgreementItem.stories.js +98 -0
- package/dist/AgreementItem/AgreementItem.styles.js +31 -0
- package/dist/AnalyticGraphs/Analytic.js +528 -0
- package/dist/AnalyticGraphs/Analytic.styles.js +49 -0
- package/dist/BackButton/BackButton.js +22 -0
- package/dist/BackButton/BackButton.stories.js +24 -0
- package/dist/BackButton/BackButton.styles.js +110 -0
- package/dist/Background/Background.js +34 -0
- package/dist/Background/Background.stories.js +50 -0
- package/dist/Background/Background.styles.js +113 -0
- package/dist/BarChart/BarChart.js +258 -0
- package/dist/BarChart/BarChart.stories.js +46 -0
- package/dist/BarChart/BarChart.styles.js +93 -0
- package/dist/BarChartLegend/BarChartLegend.js +74 -0
- package/dist/BarChartLegend/BarChartLegend.styles.js +26 -0
- package/dist/BasicTable/BasicTable.js +20 -0
- package/dist/BasicTable/BasicTable.stories.js +51 -0
- package/dist/BasicTable/BasicTable.styles.js +64 -0
- package/dist/Button/Button.stories.js +63 -0
- package/dist/Button/Button.styles.js +180 -0
- package/dist/ButtonContainer/ButtonContainer.styles.js +25 -0
- package/dist/CapitalRaisedSummary/CapitalRaisedSummery.stories.js +35 -0
- package/dist/CapitalRaisedSummary/CaptialRaisedSummary.js +23 -0
- package/dist/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +36 -0
- package/dist/ChartBox/ChartBox.js +34 -0
- package/dist/ChartBox/ChartBox.stories.js +9 -0
- package/dist/ChartBox/ChartBox.styles.js +50 -0
- package/dist/ChartBox/ChartBoxDistribution.js +20 -0
- package/dist/ChartBox/ChartBoxDistribution.stories.js +10 -0
- package/dist/ChartLegend/ChartLegend.js +37 -0
- package/dist/ChartLegend/ChartLegend.stories.js +74 -0
- package/dist/ChartLegend/ChartLegend.styles.js +67 -0
- package/dist/Checkbox/Checkbox.js +108 -0
- package/dist/Checkbox/Checkbox.stories.js +82 -0
- package/dist/Checkbox/Checkbox.styles.js +123 -0
- package/dist/Checklist/UserChecklist.js +247 -0
- package/dist/Checklist/UserChecklist.stories.js +115 -0
- package/dist/ComponentScroll/ComponentScroll.js +99 -0
- package/dist/ComponentScroll/ComponentScroll.stories.js +92 -0
- package/dist/ComponentScroll/ComponentScroll.styles.js +104 -0
- package/dist/ComponentWrapper/ComponentWrapper.styles.js +128 -0
- package/dist/CryptoAddress/ComponentWrap.js +24 -0
- package/dist/CryptoAddress/CryptoAddress.js +124 -0
- package/dist/CryptoAddress/CryptoAddress.stories.js +163 -0
- package/dist/CryptoAddress/CryptoAddress.styles.js +399 -0
- package/dist/CryptoAddress/RadioWrap.js +36 -0
- package/dist/CryptoAddressDetails/CryptoAddressDetails.js +42 -0
- package/dist/CryptoAddressDetails/CryptoAddressDetails.stories.js +65 -0
- package/dist/CryptoAddressDetails/CryptoAddressDetails.styles.js +114 -0
- package/dist/CryptoAddressWrapper/CryptoAddressWrapper.js +30 -0
- package/dist/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +98 -0
- package/dist/DonutChart/DonutChart.js +137 -0
- package/dist/DonutChart/DonutChart.stories.js +39 -0
- package/dist/DonutChart/DonutChart.styles.js +101 -0
- package/dist/DoubleButton/DoubleButton.styles.js +25 -0
- package/dist/ErrorMessage/ErrorMessage.styles.js +9 -0
- package/dist/FAQ/FAQ.js +40 -0
- package/dist/FAQ/FAQ.stories.js +63 -0
- package/dist/FAQ/FAQ.styles.js +69 -0
- package/dist/Footer/Footer.js +54 -0
- package/dist/Footer/Footer.stories.js +41 -0
- package/dist/Footer/Footer.styles.js +230 -0
- package/dist/Footer/FooterLayout.js +114 -0
- package/dist/Footer/FooterLayout.stories.js +20 -0
- package/dist/Footer/FooterMenu.js +83 -0
- package/dist/Footer/FooterMenu.stories.js +110 -0
- package/dist/Footer/FooterMenu.styles.js +274 -0
- package/dist/Footer/index.js +4 -0
- package/dist/{03f9f978feb2b015b6812ba10f689967.png → Footer/lemonway.png} +0 -0
- package/dist/Footer/sicos-logo.svg +1 -0
- package/dist/ForgotPasswordModal/ForgotPasswordModal.js +89 -0
- package/dist/ForgotPasswordModal/ForgotPasswordModal.stories.js +31 -0
- package/dist/Form/Form.js +38 -0
- package/dist/Form/Form.stories.js +23 -0
- package/dist/Form/Form.styles.js +66 -0
- package/dist/FullscreenCard/FullscreenCard.styles.js +36 -0
- package/dist/Grid/Grid.styles.js +109 -0
- package/dist/Header/Header.js +369 -0
- package/dist/Header/Header.stories.js +172 -0
- package/dist/Header/Header.styles.js +493 -0
- package/dist/Icon/Icon.style.js +75 -0
- package/dist/InfoIcon/InfoIcon.js +40 -0
- package/dist/InfoIcon/InfoIcon.stories.js +40 -0
- package/dist/InfoIcon/InfoIcon.styles.js +42 -0
- package/dist/InfoPanel/InfoPanel.js +115 -0
- package/dist/Input/DatePickerInput.js +64 -0
- package/dist/Input/DatePickerInput.stories.js +80 -0
- package/dist/Input/DatePickerInput.styles.js +67 -0
- package/dist/Input/Input.js +86 -0
- package/dist/Input/Input.stories.js +134 -0
- package/dist/Input/Input.styles.js +126 -0
- package/dist/Input/InputPassword.js +122 -0
- package/dist/Input/InputPassword.stories.js +72 -0
- package/dist/Input/InputPassword.styles.js +139 -0
- package/dist/Input/RangeInput.js +46 -0
- package/dist/Input/RangeInput.stories.js +48 -0
- package/dist/Input/RangeInput.styles.js +125 -0
- package/dist/Input/Select.js +130 -0
- package/dist/Input/Select.stories.js +129 -0
- package/dist/Input/Select.styles.js +143 -0
- package/dist/InvestCalculator/InvestCalculator.js +353 -0
- package/dist/InvestCalculator/InvestCalculator.stories.js +129 -0
- package/dist/InvestCalculator/InvestCalculator.styles.js +78 -0
- package/dist/InvestmentStat/InvestmentStat.js +33 -0
- package/dist/InvestmentStat/InvestmentStat.stories.js +44 -0
- package/dist/InvestmentStat/InvestmentStat.styles.js +53 -0
- package/dist/KYCFlow/BasicInfo.js +396 -0
- package/dist/KYCFlow/Confirmation.js +37 -0
- package/dist/KYCFlow/DocumentFileUpload.js +240 -0
- package/dist/KYCFlow/DocumentScan.js +66 -0
- package/dist/KYCFlow/DocumentScanUpload.js +228 -0
- package/dist/KYCFlow/DocumentSelect.js +101 -0
- package/dist/KYCFlow/DocumentSuccess.js +54 -0
- package/dist/KYCFlow/DocumentUpload.js +44 -0
- package/dist/KYCFlow/DocumentVerificationType.js +114 -0
- package/dist/KYCFlow/FaceScan.js +45 -0
- package/dist/KYCFlow/FaceScanRecognition.js +52 -0
- package/dist/KYCFlow/FaceScanSuccess.js +47 -0
- package/dist/KYCFlow/Terms.js +99 -0
- package/dist/KYCFlow/_styles.js +284 -0
- package/dist/KYCFlow/index.js +14 -0
- package/dist/KYCSelectBox/KYCSelectBox.styles.js +62 -0
- package/dist/LatestUpdate/LatestUpdate.js +35 -0
- package/dist/LatestUpdate/LatestUpdate.stories.js +51 -0
- package/dist/LatestUpdate/LatestUpdate.styles.js +77 -0
- package/dist/Layout/Layout-func-no-work.js +67 -0
- package/dist/Layout/Layout.js +68 -0
- package/dist/Layout/Layout.stories.js +55 -0
- package/dist/LearnMoreCarousel/LearnMoreCarousel.js +39 -0
- package/dist/LearnMoreCarousel/LearnMoreCarousel.stories.js +58 -0
- package/dist/LearnMoreCarousel/LearnMoreCarousel.styles.js +205 -0
- package/dist/LearnMorePage/LearnMore.js +199 -0
- package/dist/LearnMorePage/LearnMore.shared.styles.js +49 -0
- package/dist/LearnMorePage/LearnMore.stories.js +41 -0
- package/dist/LearnMorePage/LearnMore.styles.js +250 -0
- package/dist/LearnMorePage/LearnMoreExampleObject.js +102 -0
- package/dist/LearnMorePage/LearnMoreItem.js +73 -0
- package/dist/LearnMorePage/LearnMoreItem.stories.js +54 -0
- package/dist/LearnMorePage/LearnMoreItem.styles.js +218 -0
- package/dist/LearnMoreSection/LearnMore.js +158 -0
- package/dist/LearnMoreSection/LearnMore.stories.js +23 -0
- package/dist/LearnMoreSection/LearnMore.styles.js +134 -0
- package/dist/LearnMoreSection/LearnMoreItem.js +39 -0
- package/dist/LearnMoreSection/LearnMoreItem.stories.js +52 -0
- package/dist/LearnMoreSection/LearnMoreItem.styles.js +54 -0
- package/dist/LoginModal/LoginModal.js +125 -0
- package/dist/MainMenu/DynamicMainMenu.js +41 -0
- package/dist/MainMenu/MainMenu.js +207 -0
- package/dist/MainMenu/MainMenu.styles.js +361 -0
- package/dist/MatomoConnect/Matomo.js +221 -0
- package/dist/MatomoConnect/Matomo_fuckup.js +185 -0
- package/dist/MenuNav/MenuNav.styles.js +88 -0
- package/dist/Modal/Modal.js +71 -0
- package/dist/Modal/Modal.stories.js +67 -0
- package/dist/Modal/Modal.styles.js +407 -0
- package/dist/MultiProgressBar/MultiProgressBar.js +33 -0
- package/dist/MultiProgressBar/MultiProgressBar.stories.js +61 -0
- package/dist/MultiProgressBar/MultiProgressBar.styles.js +92 -0
- package/dist/Newsletter/Newsletter.js +106 -0
- package/dist/Newsletter/Newsletter.stories.js +8 -0
- package/dist/Newsletter/Newsletter.styles.js +173 -0
- package/dist/NotificationContext/NotificationContext.js +126 -0
- package/dist/NotificationContext/NotificationContext.stories.js +32 -0
- package/dist/NotificationCounter/NotificationCounter.styles.js +23 -0
- package/dist/Number/Number.js +25 -0
- package/dist/Number/Number.stories.js +18 -0
- package/dist/Number/Number.styles.js +21 -0
- package/dist/PageTransition/PageTransition.js +42 -0
- package/dist/Process/Process.stories.js +34 -0
- package/dist/Process/Process.styles.js +87 -0
- package/dist/ProfileBadge/ProfileBadge.js +46 -0
- package/dist/ProfileBadge/ProfileBadge.stories.js +37 -0
- package/dist/ProfileBadge/ProfileBadge.styles.js +47 -0
- package/dist/ProfileBox/ProfileBox.js +29 -0
- package/dist/ProfileBox/ProfileBox.stories.js +27 -0
- package/dist/ProfileBox/ProfileBox.styles.js +60 -0
- package/dist/ProfileHeader/ProfileHeader-CLb4.js +401 -0
- package/dist/ProfileHeader/ProfileHeader.js +268 -0
- package/dist/ProfileHeader/ProfileHeader.styles.js +114 -0
- package/dist/ProfileStat/ProfileStat.js +32 -0
- package/dist/ProfileStat/ProfileStat.stories.js +58 -0
- package/dist/ProfileStat/ProfileStat.styles.js +80 -0
- package/dist/ProofOfAddress/ProofOfAddress.styles.js +76 -0
- package/dist/ROI/ROI.js +261 -0
- package/dist/ROI/ROI.styles.js +71 -0
- package/dist/ROI/ROIChart.js +348 -0
- package/dist/ROI/ROIChart.styles.js +98 -0
- package/dist/ROI/ROIModal.js +74 -0
- package/dist/ROI/ROIScenarioBox.js +46 -0
- package/dist/ROI/ROIScenarioBox.styles.js +131 -0
- package/dist/Radio/Radio.js +58 -0
- package/dist/Radio/Radio.stories.js +65 -0
- package/dist/Radio/Radio.styles.js +93 -0
- package/dist/RefreshButton/RefreshButton.js +14 -0
- package/dist/RefreshButton/RefreshButton.stories.js +29 -0
- package/dist/RefreshButton/RefreshButton.styles.js +57 -0
- package/dist/RegisterAlgorand/AlgoAddressName.js +103 -0
- package/dist/RegisterAlgorand/AlgoAdressSelect.js +274 -0
- package/dist/RegisterAlgorand/AlgoConnectWallet.js +37 -0
- package/dist/RegisterAlgorand/AlgoSuccess.js +28 -0
- package/dist/RegisterAlgorand/Algorand.stories.js +61 -0
- package/dist/RegisterAlgorand/ChooseWallet.js +77 -0
- package/dist/RegisterAlgorand/SelectProject.js +77 -0
- package/dist/RegisterAlgorand/_styles.js +30 -0
- package/dist/RegisterAlgorand/flow.js +243 -0
- package/dist/RegisterAlgorand/flowWithMemo.js +244 -0
- package/dist/RegisterAlgorand/index.js +7 -0
- package/dist/RegisterConfirmModal/RegisterConfirmModal.js +30 -0
- package/dist/RegisterConfirmModal/RegisterConfirmModal.stories.js +22 -0
- package/dist/RegisterConfirmModal/RegisterConfirmModal.styles.js +19 -0
- package/dist/RegisterEthereum/EthAddressLedger.js +151 -0
- package/dist/RegisterEthereum/EthAddressMetamask.js +165 -0
- package/dist/RegisterEthereum/EthAddressName.js +101 -0
- package/dist/RegisterEthereum/EthConnectLedger.js +117 -0
- package/dist/RegisterEthereum/EthConnectMetamask.js +25 -0
- package/dist/RegisterEthereum/EthFinish.js +32 -0
- package/dist/RegisterEthereum/EthIntro.js +77 -0
- package/dist/RegisterEthereum/_styles.js +30 -0
- package/dist/RegisterEthereum/index.js +9 -0
- package/dist/RegisterLiquidSteps/RegisterLiquidSteps.js +75 -0
- package/dist/RegisterLiquidSteps/RegisterLiquidSteps.stories.js +65 -0
- package/dist/RegisterLiquidSteps/RegisterLiquidSteps.styles.js +69 -0
- package/dist/RegisterLiquidSteps/assets/nav_green.svg +31 -0
- package/dist/RegisterLiquidSteps/assets/video.mp4 +0 -0
- package/dist/RegisterLiquidSteps/assets/videothumbnail.jpg +0 -0
- package/dist/RegisterLiquidSteps/complete.js +29 -0
- package/dist/RegisterLiquidSteps/flow.js +141 -0
- package/dist/RegisterLiquidSteps/index.js +29 -0
- package/dist/RegisterLiquidSteps/register-liquid.js +197 -0
- package/dist/RegisterModal/RegisterModal.js +143 -0
- package/dist/RegisterModal/RegisterModal.stories.js +35 -0
- package/dist/RequestDataBox/RequestDataBox.js +21 -0
- package/dist/RequestDataBox/RequestDataBox.stories.js +29 -0
- package/dist/RequestDataBox/RequestDataBox.styles.js +40 -0
- package/dist/RiskQuestionnaire/RiskQuestionnaireContext.js +111 -0
- package/dist/RiskQuestionnaire/_styles.js +6 -0
- package/dist/SEO/SEO.js +63 -0
- package/dist/SEO/SEO.stories.js +53 -0
- package/dist/SectionTitle/SectionTitle.styles.js +23 -0
- package/dist/SideLine/SideLine.js +4 -0
- package/dist/SideLine/SideLine.stories.js +20 -0
- package/dist/SideLine/SideLine.styles.js +29 -0
- package/dist/SigningSubflow/SignSubAddressMetamask.js +105 -0
- package/dist/SigningSubflow/SignSubConnectLedger.js +114 -0
- package/dist/SigningSubflow/SignSubConnectMetamask.js +101 -0
- package/dist/SigningSubflow/SignSubIntro.js +45 -0
- package/dist/SigningSubflow/SignSubSendLedger.js +114 -0
- package/dist/SigningSubflow/SignSubSendMetamask.js +53 -0
- package/dist/SigningSubflow/SignSubTransactionLedger.js +125 -0
- package/dist/SigningSubflow/SignSubTransactionMetamask.js +130 -0
- package/dist/SigningSubflow/_styles.js +59 -0
- package/dist/SigningSubflow/index.js +9 -0
- package/dist/Slider/Slider.js +43 -0
- package/dist/Slider/Slider.stories.js +63 -0
- package/dist/Slider/Slider.styles.js +115 -0
- package/dist/SpanButton/SpanButton.styles.js +14 -0
- package/dist/StatusBadge/StatusBadge.styles.js +16 -0
- package/dist/StepController/StepController.js +73 -0
- package/dist/StepController/StepController.stories.js +52 -0
- package/dist/StepController/StepController.styles.js +27 -0
- package/dist/StepController/StepControllerContext.js +61 -0
- package/dist/StepController/StepControllerProgress.js +28 -0
- package/dist/StepController/StepControllerProgress.stories.js +41 -0
- package/dist/StepsProgress/StepsProgress.js +95 -0
- package/dist/StepsProgress/StepsProgress.stories.js +23 -0
- package/dist/StepsProgress/StepsProgress.styles.js +97 -0
- package/dist/StokrLoader/StokrLoader.js +60 -0
- package/dist/StokrLoader/media.js +22 -0
- package/dist/StokrLoader/stokr_loader_white_400x400.gif +0 -0
- package/dist/SvgIcons/AdminBadgeSvg.js +16 -0
- package/dist/SvgIcons/CameraSvg.js +26 -0
- package/dist/SvgIcons/CapsLockSvg.js +21 -0
- package/dist/SvgIcons/DocumentBackSvg.js +25 -0
- package/dist/SvgIcons/DocumentSmallSvg.js +51 -0
- package/dist/SvgIcons/DocumentSvg.js +28 -0
- package/dist/SvgIcons/Early.js +14 -0
- package/dist/SvgIcons/EthSvg.js +30 -0
- package/dist/SvgIcons/EurSvg.js +16 -0
- package/dist/SvgIcons/FaceScanIconSvg.js +21 -0
- package/dist/SvgIcons/FourSvg.js +11 -0
- package/dist/SvgIcons/Glassess.js +19 -0
- package/dist/SvgIcons/Icons_Badge.png +0 -0
- package/dist/SvgIcons/LogoSvg.js +14 -0
- package/dist/SvgIcons/OneSvg.js +13 -0
- package/dist/SvgIcons/PassportSvg.js +46 -0
- package/dist/SvgIcons/RefreshSvg.js +17 -0
- package/dist/SvgIcons/SocialFacebook.js +15 -0
- package/dist/SvgIcons/SocialInstagram.js +15 -0
- package/dist/SvgIcons/SocialLinkedIn.js +15 -0
- package/dist/SvgIcons/SocialMedium.js +15 -0
- package/dist/SvgIcons/SocialReddit.js +15 -0
- package/dist/SvgIcons/SocialTelegram.js +15 -0
- package/dist/SvgIcons/SocialTwitter.js +15 -0
- package/dist/SvgIcons/SocialYoutube.js +15 -0
- package/dist/SvgIcons/ThreeSvg.js +10 -0
- package/dist/SvgIcons/TwoSidedDocumentSvg.js +72 -0
- package/dist/SvgIcons/TwoSvg.js +13 -0
- package/dist/SvgIcons/UpdateDefaultSvg.js +19 -0
- package/dist/SvgIcons/UpdateHardSvg.js +15 -0
- package/dist/SvgIcons/UpdateSoftSvg.js +17 -0
- package/dist/SvgIcons/UploadSvg.js +24 -0
- package/dist/SvgIcons/VerifiedBadge.js +13 -0
- package/dist/SvgIcons/index.js +32 -0
- package/dist/Switch/Switch.js +45 -0
- package/dist/Switch/Switch.stories.js +73 -0
- package/dist/Switch/Switch.styles.js +105 -0
- package/dist/Tabs/Tabs.js +48 -0
- package/dist/Tabs/Tabs.stories.js +28 -0
- package/dist/Tabs/Tabs.styles.js +11 -0
- package/dist/TabsNav/TabNav.js +21 -0
- package/dist/TabsNav/TabNav.stories.js +32 -0
- package/dist/TabsNav/TabsNav.js +23 -0
- package/dist/TabsNav/TabsNav.stories.js +25 -0
- package/dist/TabsNav/TabsNav.styles.js +80 -0
- package/dist/TeamOverview/TeamOverview.js +69 -0
- package/dist/TeamOverview/TeamOverview.stories.js +68 -0
- package/dist/TeamOverview/TeamOverview.styles.js +152 -0
- package/dist/Text/Headline.js +34 -0
- package/dist/Text/Headline.stories.js +40 -0
- package/dist/Text/StyledText.js +30 -0
- package/dist/Text/Text.stories.js +59 -0
- package/dist/Text/Text.styles.js +166 -0
- package/dist/TextLink/TextLink.styles.js +50 -0
- package/dist/ToDoList/ToDoList.js +172 -0
- package/dist/ToDoList/ToDoList.stories.js +123 -0
- package/dist/ToDoList/ToDoList.styles.js +115 -0
- package/dist/ToDoList/ToDoListTask.js +96 -0
- package/dist/ToDoList/ToDoListTask.stories.js +60 -0
- package/dist/ToDoList/ToDoListTask.styles.js +104 -0
- package/dist/TransactionDetails/TransactionDetails.js +27 -0
- package/dist/TransactionDetails/TransactionDetails.stories.js +47 -0
- package/dist/TransactionDetails/TransactionDetails.styles.js +31 -0
- package/dist/TransactionInfo/TransactionInfo.js +48 -0
- package/dist/TransactionInfo/TransactionInfo.stories.js +53 -0
- package/dist/TransactionInfo/TransactionInfo.styles.js +64 -0
- package/dist/TwoFactorModal/TwoFactorModal.js +84 -0
- package/dist/breakdown/Breakdown.js +124 -0
- package/dist/breakdown/index.js +2 -0
- package/dist/context/Auth.js +133 -0
- package/dist/context/AuthContext.js +154 -0
- package/dist/icons/Arrow.js +62 -0
- package/dist/icons/Arrow.stories.js +37 -0
- package/dist/icons/ArrowSimple.js +51 -0
- package/dist/icons/ArrowSimple.stories.js +41 -0
- package/dist/icons/Check.js +29 -0
- package/dist/icons/Check.stories.js +14 -0
- package/dist/icons/Facebook.js +15 -0
- package/dist/icons/Facebook.stories.js +15 -0
- package/dist/icons/Info.js +41 -0
- package/dist/icons/Info.stories.js +8 -0
- package/dist/icons/Instagram.js +15 -0
- package/dist/icons/Instagram.stories.js +15 -0
- package/dist/icons/LinkIcon.js +23 -0
- package/dist/icons/LinkIcon.stories.js +15 -0
- package/dist/icons/LinkedIn.js +29 -0
- package/dist/icons/LinkedIn.stories.js +8 -0
- package/dist/icons/Medium.js +28 -0
- package/dist/icons/Medium.stories.js +8 -0
- package/dist/icons/Reddit.js +18 -0
- package/dist/icons/Reddit.stories.js +15 -0
- package/dist/icons/Share.js +48 -0
- package/dist/icons/Share.stories.js +8 -0
- package/dist/icons/Telegram.js +28 -0
- package/dist/icons/Telegram.stories.js +8 -0
- package/dist/icons/Twitter.js +15 -0
- package/dist/icons/Twitter.stories.js +15 -0
- package/dist/icons/X.js +15 -0
- package/dist/icons/X.stories.js +8 -0
- package/dist/icons/Youtube.js +15 -0
- package/dist/icons/Youtube.stories.js +15 -0
- package/dist/icons/index.js +15 -0
- package/dist/index.js +177 -1
- package/dist/renderToBody/index.js +2 -0
- package/dist/renderToBody/renderToBody.js +26 -0
- package/dist/taxId/TaxId.stories.js +29 -0
- package/dist/taxId/complete.js +21 -0
- package/dist/taxId/flow.js +31 -0
- package/dist/taxId/index.js +4 -0
- package/dist/taxId/register-taxid.js +156 -0
- package/dist/video/Video.js +274 -0
- package/dist/video/Video.stories.js +45 -0
- package/dist/video/img/play-btn.svg +1 -0
- package/dist/video/index.js +2 -0
- package/package.json +128 -133
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/react-scripts +0 -0
- package/dist/07233f511246c9825a0d58e5ab2641f3.svg +0 -47
- package/dist/08418fc6c324f51f7e56.svg +0 -1
- package/dist/14aa35d4e84aebef77cf00b421fc393a.gif +0 -0
- package/dist/179ef2df02cb0b68c9fd.woff2 +0 -0
- package/dist/21e493d43617de76dbc7.woff2 +0 -0
- package/dist/2640959b1f9381cde047.eot +0 -0
- package/dist/2ba2db4ff86a2663686a100e75b50ba9.png +0 -0
- package/dist/311956ded96d3fd2813d.woff2 +0 -0
- package/dist/39f5961b2d3eb4aa5bf5.woff +0 -0
- package/dist/3caa0d4f9b7d58668066.woff2 +0 -0
- package/dist/4a510354f2f82b59fced805a8e3fe2bf.svg +0 -1
- package/dist/4c3c428d0ce82f840710.woff +0 -0
- package/dist/4e528d6445ca1974c313.woff +0 -0
- package/dist/55053cc0a8e6482eca64.ttf +0 -0
- package/dist/643c37f102b41f7f90c3.woff2 +0 -0
- package/dist/76dd0ed9c3f137513fd4.svg +0 -1
- package/dist/81f3ef07b7952e249da1.woff +0 -0
- package/dist/98b7d3182f652f021bc3.ttf +0 -0
- package/dist/9bea22b57dc165ed4382.ttf +0 -0
- package/dist/9ec738fbb66068dc1ca7.woff +0 -0
- package/dist/a1d7666a48f976227722.ttf +0 -0
- package/dist/a750292d6a0b5a760679.woff +0 -0
- package/dist/b85a961d44cc55c58050cbf7c53dd505.png +0 -0
- package/dist/bcb6531cf820152b7538.ttf +0 -0
- package/dist/c6a4bc1bd034d6303053.woff +0 -0
- package/dist/cbfc24090ef8bacab132.woff2 +0 -0
- package/dist/d2b1865643b98c0e8b54.ttf +0 -0
- package/dist/d97d7385fe8771611848.ttf +0 -0
- package/dist/index.js.LICENSE.txt +0 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Select } from './Select';
|
|
3
|
+
import { ComponentWrapper } from '../ComponentWrapper/ComponentWrapper.styles';
|
|
4
|
+
import { Medium } from '../icons/Medium';
|
|
5
|
+
import { Share } from '../icons/Share';
|
|
6
|
+
import Number from 'components/Number/Number';
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components Library/Inputs/Select',
|
|
9
|
+
component: Select,
|
|
10
|
+
argTypes: {
|
|
11
|
+
id: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
name: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
label: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
defaultValue: ''
|
|
22
|
+
},
|
|
23
|
+
error: {
|
|
24
|
+
type: 'boolean',
|
|
25
|
+
defaultValue: false
|
|
26
|
+
},
|
|
27
|
+
touched: {
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
defaultValue: false
|
|
30
|
+
},
|
|
31
|
+
value: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
defaultValue: ''
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
type: 'boolean',
|
|
37
|
+
defaultValue: false
|
|
38
|
+
},
|
|
39
|
+
options: {
|
|
40
|
+
control: {
|
|
41
|
+
type: 'object'
|
|
42
|
+
},
|
|
43
|
+
defaultValue: [{
|
|
44
|
+
key: 'default option key',
|
|
45
|
+
value: 'default option value',
|
|
46
|
+
label: 'default option label, (string or node)'
|
|
47
|
+
}],
|
|
48
|
+
required: true
|
|
49
|
+
},
|
|
50
|
+
// { required: true },
|
|
51
|
+
search: {
|
|
52
|
+
type: 'boolean',
|
|
53
|
+
defaultValue: false
|
|
54
|
+
},
|
|
55
|
+
checkLabel: {
|
|
56
|
+
type: 'function'
|
|
57
|
+
},
|
|
58
|
+
onChange: {
|
|
59
|
+
action: 'change',
|
|
60
|
+
type: 'function'
|
|
61
|
+
},
|
|
62
|
+
onBlur: {
|
|
63
|
+
action: 'blur',
|
|
64
|
+
type: 'function'
|
|
65
|
+
},
|
|
66
|
+
onFocus: {
|
|
67
|
+
action: 'hasFocus',
|
|
68
|
+
type: 'function'
|
|
69
|
+
},
|
|
70
|
+
setTimeout: {
|
|
71
|
+
type: 'function'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const Template = args => /*#__PURE__*/React.createElement(ComponentWrapper, null, /*#__PURE__*/React.createElement(Select, args));
|
|
76
|
+
export const SelectOptionStrings = Template.bind({});
|
|
77
|
+
SelectOptionStrings.args = {
|
|
78
|
+
label: 'click LABEL here for options',
|
|
79
|
+
value: null,
|
|
80
|
+
options: [{
|
|
81
|
+
key: 'other option key',
|
|
82
|
+
value: 'other option value',
|
|
83
|
+
label: 'dropdown option label string 1'
|
|
84
|
+
}, {
|
|
85
|
+
key: 'other option key',
|
|
86
|
+
value: 'other option value',
|
|
87
|
+
label: 'dropdown option label string 2'
|
|
88
|
+
}, {
|
|
89
|
+
key: 'other option key',
|
|
90
|
+
value: 'other option value',
|
|
91
|
+
label: 'dropdown option label string 3'
|
|
92
|
+
}, {
|
|
93
|
+
key: 'other option key',
|
|
94
|
+
value: 'other option value',
|
|
95
|
+
label: 'dropdown option label string 4'
|
|
96
|
+
}]
|
|
97
|
+
};
|
|
98
|
+
export const SelectOptionNodes = Template.bind({});
|
|
99
|
+
SelectOptionNodes.args = {
|
|
100
|
+
label: 'click LABEL here for options',
|
|
101
|
+
value: 'your text (value)',
|
|
102
|
+
options: [{
|
|
103
|
+
key: 'other option key',
|
|
104
|
+
value: 'other option value',
|
|
105
|
+
label: 'dropdown option label 1'
|
|
106
|
+
}, {
|
|
107
|
+
key: 'other option key',
|
|
108
|
+
value: 'other option value',
|
|
109
|
+
label: 'dropdown option label 2'
|
|
110
|
+
}, {
|
|
111
|
+
key: 'other option key',
|
|
112
|
+
value: 'other option value',
|
|
113
|
+
label: /*#__PURE__*/React.createElement(Share, null)
|
|
114
|
+
}, {
|
|
115
|
+
key: 'other option key',
|
|
116
|
+
value: 'other option value',
|
|
117
|
+
label: /*#__PURE__*/React.createElement(Medium, null)
|
|
118
|
+
}, {
|
|
119
|
+
key: 'other option key',
|
|
120
|
+
value: 'other option value',
|
|
121
|
+
label: /*#__PURE__*/React.createElement(Number, null)
|
|
122
|
+
}]
|
|
123
|
+
};
|
|
124
|
+
export const SelectEmpty = Template.bind({});
|
|
125
|
+
SelectEmpty.args = {};
|
|
126
|
+
|
|
127
|
+
//doublecheck:
|
|
128
|
+
|
|
129
|
+
//why is value not showing? (it does move the label up) (label down on blur, even if field is filled)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import styled from 'styled-components/macro';
|
|
2
|
+
import { components } from 'react-select';
|
|
3
|
+
import { TrackV } from 'components/ComponentScroll/ComponentScroll.styles';
|
|
4
|
+
import ComponentScroll from 'components/ComponentScroll/ComponentScroll';
|
|
5
|
+
export const SelectControl = styled(components.Control)`
|
|
6
|
+
&&& {
|
|
7
|
+
z-index: 10 !important;
|
|
8
|
+
position: relative;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 40px;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
line-height: 18px;
|
|
16
|
+
padding: 15px 0;
|
|
17
|
+
padding-bottom: 5px;
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
box-shadow: none;
|
|
20
|
+
border: 0;
|
|
21
|
+
border-top: 1px solid transparent;
|
|
22
|
+
border-bottom: 1px solid #f0f0f0;
|
|
23
|
+
color: #202020;
|
|
24
|
+
background-color: transparent;
|
|
25
|
+
transition: border-color 0.2s;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
box-shadow: none;
|
|
30
|
+
border-top-color: transparent;
|
|
31
|
+
border-bottom-color: #0050ca;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.active {
|
|
35
|
+
z-index: 12 !important;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
export const SelectMenu = styled(components.Menu)`
|
|
40
|
+
&&& {
|
|
41
|
+
margin-top: -1px;
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
box-shadow: none;
|
|
44
|
+
border: 0;
|
|
45
|
+
border-top: 1px solid #f0f0f0 !important;
|
|
46
|
+
border-bottom: 1px solid #f0f0f0 !important;
|
|
47
|
+
background-color: #ffffff;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
export const SelectMenuList = styled(ComponentScroll)`
|
|
51
|
+
${TrackV} {
|
|
52
|
+
right: 6px;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export const SelectOption = styled(components.Option)`
|
|
56
|
+
&&& {
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
padding: 8px 0 !important;
|
|
59
|
+
padding-left: 2px !important;
|
|
60
|
+
font-size: 12px;
|
|
61
|
+
line-height: 18px;
|
|
62
|
+
border: 0;
|
|
63
|
+
background-color: transparent;
|
|
64
|
+
color: #202020;
|
|
65
|
+
|
|
66
|
+
${props => props.isFocused && `
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
`}
|
|
69
|
+
|
|
70
|
+
${props => props.isSelected && `
|
|
71
|
+
font-weight: bold;
|
|
72
|
+
`}
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
background-color: transparent;
|
|
76
|
+
font-weight: bold;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
export const SelectContainer = styled(components.SelectContainer)`
|
|
81
|
+
z-index: 100;
|
|
82
|
+
${props => props.selectProps.menuIsOpen && `
|
|
83
|
+
z-index: 150 !important;
|
|
84
|
+
`}
|
|
85
|
+
`;
|
|
86
|
+
export const SelectValueContainer = styled(components.ValueContainer)`
|
|
87
|
+
&&& {
|
|
88
|
+
font-family: 'Open sans';
|
|
89
|
+
padding: 0;
|
|
90
|
+
margin-left: -2px;
|
|
91
|
+
top: -4px;
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
export const SelectIcon = styled.i.attrs({
|
|
95
|
+
className: 'ion ion-ios-arrow-down'
|
|
96
|
+
})`
|
|
97
|
+
&&& {
|
|
98
|
+
transition: 0.3s transform;
|
|
99
|
+
transform: rotate(0);
|
|
100
|
+
|
|
101
|
+
${props => props.isMenuOpen && `
|
|
102
|
+
transform: rotate(180deg);
|
|
103
|
+
`}
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
export const SelectWrapper = styled.div`
|
|
107
|
+
display: inline-block;
|
|
108
|
+
vertical-align: middle;
|
|
109
|
+
margin-left: 24px;
|
|
110
|
+
|
|
111
|
+
${props => props.minWidth && `
|
|
112
|
+
min-width: ${props.minWidth};
|
|
113
|
+
`}
|
|
114
|
+
|
|
115
|
+
${props => props.noMargin && `
|
|
116
|
+
margin-left: 0;
|
|
117
|
+
`}
|
|
118
|
+
|
|
119
|
+
&&& ${SelectControl} {
|
|
120
|
+
height: 24px;
|
|
121
|
+
font-weight: normal;
|
|
122
|
+
font-size: 11px;
|
|
123
|
+
line-height: 18px;
|
|
124
|
+
padding: 3px 0;
|
|
125
|
+
border-top: 1px solid transparent;
|
|
126
|
+
border-bottom: 1px solid transparent;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&&& ${SelectMenu} {
|
|
130
|
+
left: 0;
|
|
131
|
+
right: 0;
|
|
132
|
+
width: auto;
|
|
133
|
+
margin: -6px -12px;
|
|
134
|
+
margin-top: 0;
|
|
135
|
+
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2);
|
|
136
|
+
border: 0;
|
|
137
|
+
padding: 6px 12px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&&& ${SelectValueContainer} {
|
|
141
|
+
top: 0;
|
|
142
|
+
}
|
|
143
|
+
`;
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { yupToFormErrors } from 'formik';
|
|
4
|
+
import * as yup from 'yup';
|
|
5
|
+
import Input from 'components/Input/Input';
|
|
6
|
+
import Select from 'components/Input/Select';
|
|
7
|
+
import { Wrapper, Container, EqualSign, Title, Caption, InputWrap, SelectWrapper, StyledFormError, Label } from './InvestCalculator.styles';
|
|
8
|
+
//import Config from 'api/StokrConfig'
|
|
9
|
+
import fixDecimals from '../../utils/fix-decimals';
|
|
10
|
+
//import { tokenDecimals } from 'constants/decimals'
|
|
11
|
+
|
|
12
|
+
export const InvestCalculatorCurrencies = {
|
|
13
|
+
ETH: 'eth',
|
|
14
|
+
EUR: 'eur',
|
|
15
|
+
GUSD: 'gusd',
|
|
16
|
+
USDT: 'usdt',
|
|
17
|
+
CRYPTO: 'crypto'
|
|
18
|
+
};
|
|
19
|
+
const BN = require('bignumber.js');
|
|
20
|
+
const getNumericPart = input => {
|
|
21
|
+
// Normalize decimal separator and
|
|
22
|
+
// find numeric part (w/o leading zeros)
|
|
23
|
+
let match = input.replace(/,/, '.').match(/[1-9]\d*(\.\d*)?|\.\d*/);
|
|
24
|
+
// Prepend leading zero if necessary
|
|
25
|
+
return match ? match[0].replace(/^\./, '0.') : '0';
|
|
26
|
+
};
|
|
27
|
+
export class InvestCalculator extends PureComponent {
|
|
28
|
+
state = {
|
|
29
|
+
tokens: 0,
|
|
30
|
+
currencyValue: 0,
|
|
31
|
+
selectedCurrencyValue: 0,
|
|
32
|
+
selectedCurrency: this.props.userSelectedCurrency === 'ether' ? InvestCalculatorCurrencies.ETH : this.props.userSelectedCurrency === 'gemini' ? InvestCalculatorCurrencies.GUSD : InvestCalculatorCurrencies.USDT,
|
|
33
|
+
// selectedCurrency: InvestCalculatorCurrencies.ETH,
|
|
34
|
+
errors: {}
|
|
35
|
+
};
|
|
36
|
+
componentDidMount() {
|
|
37
|
+
const {
|
|
38
|
+
isIban
|
|
39
|
+
} = this.props;
|
|
40
|
+
if (isIban) {
|
|
41
|
+
this.setState({
|
|
42
|
+
selectedCurrency: InvestCalculatorCurrencies.EUR
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
normalizeCurrencySelected = currencySelected => {
|
|
47
|
+
if (currencySelected === 'euro') return 'eur';
|
|
48
|
+
if (currencySelected === 'ether') return 'eth';
|
|
49
|
+
if (currencySelected === 'gemini') return 'gusd';
|
|
50
|
+
if (currencySelected === 'tether') return 'usdt';
|
|
51
|
+
};
|
|
52
|
+
onFocus = (e, field) => {
|
|
53
|
+
const {
|
|
54
|
+
onFocus
|
|
55
|
+
} = this.props;
|
|
56
|
+
onFocus && onFocus(e, field);
|
|
57
|
+
};
|
|
58
|
+
onBlur = (e, field) => {
|
|
59
|
+
const {
|
|
60
|
+
onBlur
|
|
61
|
+
} = this.props;
|
|
62
|
+
onBlur && onBlur(e, field);
|
|
63
|
+
};
|
|
64
|
+
onChange = (e, field) => {
|
|
65
|
+
const {
|
|
66
|
+
onChange
|
|
67
|
+
} = this.props;
|
|
68
|
+
onChange && onChange(e, field);
|
|
69
|
+
};
|
|
70
|
+
onErrors = (e, field) => {
|
|
71
|
+
const {
|
|
72
|
+
onErrors
|
|
73
|
+
} = this.props;
|
|
74
|
+
onErrors && onErrors(e, field);
|
|
75
|
+
};
|
|
76
|
+
changeTokens = (e, field) => {
|
|
77
|
+
const {
|
|
78
|
+
exchangeRate,
|
|
79
|
+
available,
|
|
80
|
+
name,
|
|
81
|
+
userSelectedCurrency
|
|
82
|
+
} = this.props;
|
|
83
|
+
const {
|
|
84
|
+
selectedCurrency
|
|
85
|
+
} = this.state;
|
|
86
|
+
let tokensInput = getNumericPart(e.target.value);
|
|
87
|
+
let tokens = BN(tokensInput);
|
|
88
|
+
if (tokens.gt(available)) {
|
|
89
|
+
tokens = BN(available);
|
|
90
|
+
tokensInput = tokens.toFixed(4);
|
|
91
|
+
}
|
|
92
|
+
const currencyValue = tokens.times(exchangeRate[selectedCurrency]);
|
|
93
|
+
const selectedCurrencyValue = tokens * exchangeRate[this.normalizeCurrencySelected(userSelectedCurrency)];
|
|
94
|
+
this.validate({
|
|
95
|
+
tokens: tokens.toNumber(),
|
|
96
|
+
currencyValue: currencyValue.toNumber(),
|
|
97
|
+
selectedCurrency
|
|
98
|
+
});
|
|
99
|
+
this.setState({
|
|
100
|
+
tokens: tokensInput,
|
|
101
|
+
currencyValue: currencyValue.toFixed(4),
|
|
102
|
+
selectedCurrencyValue
|
|
103
|
+
}, () => {
|
|
104
|
+
this.onChange({
|
|
105
|
+
target: {
|
|
106
|
+
name,
|
|
107
|
+
value: tokens,
|
|
108
|
+
currencyValue,
|
|
109
|
+
currencyName: selectedCurrency,
|
|
110
|
+
selectedCurrencyValue
|
|
111
|
+
}
|
|
112
|
+
}, field);
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
changeCurrency = e => {
|
|
116
|
+
const {
|
|
117
|
+
exchangeRate,
|
|
118
|
+
name,
|
|
119
|
+
userSelectedCurrency
|
|
120
|
+
} = this.props;
|
|
121
|
+
const {
|
|
122
|
+
tokens
|
|
123
|
+
} = this.state;
|
|
124
|
+
const selectedCurrency = e.value;
|
|
125
|
+
const currencyValue = tokens * exchangeRate[selectedCurrency];
|
|
126
|
+
const selectedCurrencyValue = tokens * exchangeRate[this.normalizeCurrencySelected(userSelectedCurrency)];
|
|
127
|
+
this.validate({
|
|
128
|
+
tokens,
|
|
129
|
+
currencyValue,
|
|
130
|
+
selectedCurrency
|
|
131
|
+
});
|
|
132
|
+
this.setState({
|
|
133
|
+
currencyValue,
|
|
134
|
+
selectedCurrency,
|
|
135
|
+
selectedCurrencyValue
|
|
136
|
+
}, () => {
|
|
137
|
+
this.onChange({
|
|
138
|
+
target: {
|
|
139
|
+
name,
|
|
140
|
+
value: tokens,
|
|
141
|
+
currencyValue,
|
|
142
|
+
currencyName: selectedCurrency,
|
|
143
|
+
selectedCurrencyValue
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
changeCurrencyValue = (e, field) => {
|
|
149
|
+
const {
|
|
150
|
+
exchangeRate,
|
|
151
|
+
name,
|
|
152
|
+
available,
|
|
153
|
+
userSelectedCurrency
|
|
154
|
+
} = this.props;
|
|
155
|
+
const {
|
|
156
|
+
selectedCurrency
|
|
157
|
+
} = this.state;
|
|
158
|
+
let currencyValueInput = getNumericPart(e.target.value);
|
|
159
|
+
let currencyValue = BN(currencyValueInput);
|
|
160
|
+
let tokens = currencyValue.div(exchangeRate[selectedCurrency]);
|
|
161
|
+
const selectedCurrencyValue = tokens * exchangeRate[this.normalizeCurrencySelected(userSelectedCurrency)];
|
|
162
|
+
if (tokens.gt(available)) {
|
|
163
|
+
tokens = BN(available);
|
|
164
|
+
currencyValue = tokens.times(exchangeRate[selectedCurrency]);
|
|
165
|
+
currencyValueInput = currencyValue.toFixed(4);
|
|
166
|
+
}
|
|
167
|
+
this.validate({
|
|
168
|
+
tokens: tokens.toNumber(),
|
|
169
|
+
currencyValue: currencyValue.toNumber(),
|
|
170
|
+
selectedCurrency
|
|
171
|
+
});
|
|
172
|
+
this.setState({
|
|
173
|
+
tokens: tokens.toFixed(4),
|
|
174
|
+
currencyValue: currencyValueInput,
|
|
175
|
+
selectedCurrencyValue
|
|
176
|
+
}, () => {
|
|
177
|
+
this.onChange({
|
|
178
|
+
target: {
|
|
179
|
+
name,
|
|
180
|
+
value: tokens,
|
|
181
|
+
currencyValue,
|
|
182
|
+
currencyName: selectedCurrency,
|
|
183
|
+
selectedCurrencyValue
|
|
184
|
+
}
|
|
185
|
+
}, field);
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
validate = values => {
|
|
189
|
+
const {
|
|
190
|
+
minTokensCount,
|
|
191
|
+
available,
|
|
192
|
+
maxFunds,
|
|
193
|
+
name,
|
|
194
|
+
tokenName,
|
|
195
|
+
userSelectedCurrency
|
|
196
|
+
} = this.props;
|
|
197
|
+
const validationSchema = yup.object().shape({
|
|
198
|
+
tokens: yup.number().min(minTokensCount, `Minimum investment: ${minTokensCount}`).max(available, `Unfortunately there are less ${tokenName} TOKENS available as you wish to buy. Please choose a smaller amount.`),
|
|
199
|
+
currencyValue: yup.number().when('selectedCurrency', {
|
|
200
|
+
is: InvestCalculatorCurrencies.EUR,
|
|
201
|
+
then: yup.number().max(2 // `Credit card limit of €${Config.euroLimit} reached`, // Config.euroLimit,
|
|
202
|
+
``),
|
|
203
|
+
otherwise: yup.number().max(maxFunds[InvestCalculatorCurrencies.CRYPTO], `Unfortunately there are not sufficient ${userSelectedCurrency} available on your chosen Ethereum address.`)
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
const callback = () => {
|
|
207
|
+
const {
|
|
208
|
+
errors
|
|
209
|
+
} = this.state;
|
|
210
|
+
this.onErrors({
|
|
211
|
+
target: {
|
|
212
|
+
name,
|
|
213
|
+
errors
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
try {
|
|
218
|
+
validationSchema.validateSync(values);
|
|
219
|
+
this.setState({
|
|
220
|
+
errors: {}
|
|
221
|
+
}, callback);
|
|
222
|
+
} catch (e) {
|
|
223
|
+
this.setState({
|
|
224
|
+
errors: yupToFormErrors(e)
|
|
225
|
+
}, callback);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
render() {
|
|
229
|
+
const {
|
|
230
|
+
available,
|
|
231
|
+
tokenName,
|
|
232
|
+
id,
|
|
233
|
+
name,
|
|
234
|
+
isIban,
|
|
235
|
+
userSelectedCurrency
|
|
236
|
+
} = this.props;
|
|
237
|
+
const {
|
|
238
|
+
errors,
|
|
239
|
+
tokens,
|
|
240
|
+
currencyValue,
|
|
241
|
+
selectedCurrency
|
|
242
|
+
} = this.state;
|
|
243
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Title, {
|
|
244
|
+
error: !!errors.tokens
|
|
245
|
+
}, `${tokenName} tokens`), /*#__PURE__*/React.createElement(InputWrap, null, /*#__PURE__*/React.createElement(Input, {
|
|
246
|
+
id: id,
|
|
247
|
+
name: name,
|
|
248
|
+
value: tokens.toString(),
|
|
249
|
+
onChange: this.changeTokens,
|
|
250
|
+
onBlur: this.handleBlur
|
|
251
|
+
})), /*#__PURE__*/React.createElement(Caption, null, `Still available: ${fixDecimals(available,
|
|
252
|
+
//tokenDecimals,
|
|
253
|
+
2)} ${tokenName}`), /*#__PURE__*/React.createElement(StyledFormError, {
|
|
254
|
+
show: !!errors.tokens
|
|
255
|
+
}, errors.tokens)), /*#__PURE__*/React.createElement(EqualSign, null, "="), /*#__PURE__*/React.createElement(Container, null, isIban ? /*#__PURE__*/React.createElement(Title, {
|
|
256
|
+
error: !!errors.tokens
|
|
257
|
+
}, "\u20AC value") : /*#__PURE__*/React.createElement(Title, {
|
|
258
|
+
error: selectedCurrency === InvestCalculatorCurrencies.ETH && !!errors.currencyValue || selectedCurrency === InvestCalculatorCurrencies.GUSD && !!errors.currencyValue || selectedCurrency === InvestCalculatorCurrencies.USDT && !!errors.currencyValue
|
|
259
|
+
}, userSelectedCurrency === 'ether' ? 'ETH VALUE' : userSelectedCurrency === 'gemini' ? 'GUSD VALUE' : 'USDT VALUE')
|
|
260
|
+
// <SelectWrapper>
|
|
261
|
+
// <Select
|
|
262
|
+
// id={`${id}-currencySelect`}
|
|
263
|
+
// name={`${id}-currencySelect`}
|
|
264
|
+
// value={selectedCurrency}
|
|
265
|
+
// options={[
|
|
266
|
+
// {
|
|
267
|
+
// key: '1',
|
|
268
|
+
// value: InvestCalculatorCurrencies.EUR,
|
|
269
|
+
// label: (
|
|
270
|
+
// <Label
|
|
271
|
+
// error={
|
|
272
|
+
// selectedCurrency === InvestCalculatorCurrencies.EUR &&
|
|
273
|
+
// !!errors.currencyValue
|
|
274
|
+
// }
|
|
275
|
+
// >
|
|
276
|
+
// € VALUE
|
|
277
|
+
// </Label>
|
|
278
|
+
// ),
|
|
279
|
+
// },
|
|
280
|
+
// {
|
|
281
|
+
// key: '2',
|
|
282
|
+
// value:
|
|
283
|
+
// userSelectedCurrency === 'ether'
|
|
284
|
+
// ? InvestCalculatorCurrencies.ETH
|
|
285
|
+
// : userSelectedCurrency === 'gemini'
|
|
286
|
+
// ? InvestCalculatorCurrencies.GUSD
|
|
287
|
+
// : InvestCalculatorCurrencies.USDT,
|
|
288
|
+
// label: (
|
|
289
|
+
// <Label
|
|
290
|
+
// error={
|
|
291
|
+
// (selectedCurrency ===
|
|
292
|
+
// InvestCalculatorCurrencies.ETH &&
|
|
293
|
+
// !!errors.currencyValue) ||
|
|
294
|
+
// (selectedCurrency ===
|
|
295
|
+
// InvestCalculatorCurrencies.GUSD &&
|
|
296
|
+
// !!errors.currencyValue) ||
|
|
297
|
+
// (selectedCurrency ===
|
|
298
|
+
// InvestCalculatorCurrencies.USDT &&
|
|
299
|
+
// !!errors.currencyValue)
|
|
300
|
+
// }
|
|
301
|
+
// >
|
|
302
|
+
// {userSelectedCurrency === 'ether'
|
|
303
|
+
// ? 'ETH VALUE'
|
|
304
|
+
// : userSelectedCurrency === 'gemini'
|
|
305
|
+
// ? 'GUSD VALUE'
|
|
306
|
+
// : 'USDT VALUE'}
|
|
307
|
+
// </Label>
|
|
308
|
+
// ),
|
|
309
|
+
// },
|
|
310
|
+
// ]}
|
|
311
|
+
// onChange={this.changeCurrency}
|
|
312
|
+
// onBlur={() => {}}
|
|
313
|
+
// />
|
|
314
|
+
// </SelectWrapper>
|
|
315
|
+
, /*#__PURE__*/React.createElement(InputWrap, null, /*#__PURE__*/React.createElement(Input, {
|
|
316
|
+
id: `${id}-valueInput`,
|
|
317
|
+
name: `${id}-valueInput`,
|
|
318
|
+
value: currencyValue.toString(),
|
|
319
|
+
onChange: this.changeCurrencyValue,
|
|
320
|
+
onBlur: () => {}
|
|
321
|
+
})), /*#__PURE__*/React.createElement(StyledFormError, {
|
|
322
|
+
paddingTop: true,
|
|
323
|
+
show: !!errors.currencyValue
|
|
324
|
+
}, errors.currencyValue)));
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
InvestCalculator.propTypes = {
|
|
328
|
+
exchangeRate: PropTypes.shape({
|
|
329
|
+
[InvestCalculatorCurrencies.ETH]: PropTypes.number.isRequired,
|
|
330
|
+
[InvestCalculatorCurrencies.EUR]: PropTypes.number.isRequired
|
|
331
|
+
}).isRequired,
|
|
332
|
+
maxFunds: PropTypes.shape({
|
|
333
|
+
[InvestCalculatorCurrencies.CRYPTO]: PropTypes.number,
|
|
334
|
+
[InvestCalculatorCurrencies.EUR]: PropTypes.number
|
|
335
|
+
}).isRequired,
|
|
336
|
+
minTokensCount: PropTypes.number,
|
|
337
|
+
available: PropTypes.number.isRequired,
|
|
338
|
+
tokenName: PropTypes.string.isRequired,
|
|
339
|
+
id: PropTypes.string.isRequired,
|
|
340
|
+
name: PropTypes.string.isRequired,
|
|
341
|
+
onChange: PropTypes.func,
|
|
342
|
+
onBlur: PropTypes.func,
|
|
343
|
+
onFocus: PropTypes.func,
|
|
344
|
+
onErrors: PropTypes.func
|
|
345
|
+
};
|
|
346
|
+
InvestCalculator.defaultProps = {
|
|
347
|
+
onChange: () => {},
|
|
348
|
+
onBlur: () => {},
|
|
349
|
+
onFocus: () => {},
|
|
350
|
+
onErrors: () => {},
|
|
351
|
+
minTokensCount: 0
|
|
352
|
+
};
|
|
353
|
+
export default InvestCalculator;
|