@redneckz/wildless-cms-uni-blocks 0.14.899 → 0.14.901
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/bin/migration-scripts/0.14.900.js +18 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +221 -28
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/bundle/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/bundle/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/bundle/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/bundle/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/bundle/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/bundle/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/bundle/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/dist/components/ApplicationLeadForm/consents.js +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +8 -7
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/dist/components/ExchangeRateTile/CurrencyProps.js +10 -0
- package/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.js +23 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/dist/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/dist/components/ExchangeRateTile/CurrentLocation.js +10 -0
- package/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +73 -0
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js +26 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
- package/dist/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/dist/components/ExchangeRateTile/calculateResult.js +11 -0
- package/dist/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.js +21 -0
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/dist/components/ExchangeRateTile/formatCurrency.js +10 -0
- package/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/dist/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/dist/components/ExchangeRateTile/renderInput.js +16 -0
- package/dist/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +13 -0
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/lib/components/ApplicationLeadForm/consents.js +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +8 -7
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/lib/components/ExchangeRateTile/CurrencyProps.js +8 -0
- package/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.js +21 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/lib/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/lib/components/ExchangeRateTile/CurrentLocation.js +8 -0
- package/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +71 -0
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.fixture.d.ts +5 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.fixture.mobile.d.ts +5 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js +24 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
- package/lib/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/lib/components/ExchangeRateTile/calculateResult.js +7 -0
- package/lib/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.js +18 -0
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/lib/components/ExchangeRateTile/formatCurrency.js +7 -0
- package/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/lib/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/lib/components/ExchangeRateTile/renderInput.js +13 -0
- package/lib/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +10 -0
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +221 -28
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/mobile/bundle/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/mobile/bundle/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/mobile/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/mobile/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/mobile/bundle/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/mobile/bundle/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/mobile/bundle/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/mobile/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/mobile/bundle/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/mobile/bundle/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/mobile/dist/components/ApplicationLeadForm/consents.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +8 -7
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js +10 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +23 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js +10 -0
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +73 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +26 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/mobile/dist/components/ExchangeRateTile/calculateResult.js +11 -0
- package/mobile/dist/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js +21 -0
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.js +10 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/mobile/dist/components/ExchangeRateTile/renderInput.js +16 -0
- package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +13 -0
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/mobile/lib/components/ApplicationLeadForm/consents.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +8 -7
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js +8 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +21 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js +8 -0
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +71 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +24 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/mobile/lib/components/ExchangeRateTile/calculateResult.js +7 -0
- package/mobile/lib/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js +18 -0
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.js +7 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/mobile/lib/components/ExchangeRateTile/renderInput.js +13 -0
- package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +10 -0
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +92 -29
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
- package/mobile/src/components/ApplicationLeadForm/consents.ts +1 -1
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +10 -7
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/ExchangeRateTile/CurrencyProps.ts +6 -0
- package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +64 -0
- package/mobile/src/components/ExchangeRateTile/CurrentLocation.tsx +28 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +155 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.example.json +12 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +60 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +8 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
- package/mobile/src/components/ExchangeRateTile/calculateResult.ts +9 -0
- package/mobile/src/components/ExchangeRateTile/callbackCurrencySelect.ts +25 -0
- package/mobile/src/components/ExchangeRateTile/formatCurrency.ts +8 -0
- package/mobile/src/components/ExchangeRateTile/renderInput.tsx +43 -0
- package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +25 -0
- package/package.json +2 -2
- package/src/components/ApplicationForm/ApplicationForm.example.json +92 -29
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +11 -11
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +11 -11
- package/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
- package/src/components/ApplicationLeadForm/consents.ts +1 -1
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +10 -7
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/ExchangeRateTile/CurrencyProps.ts +6 -0
- package/src/components/ExchangeRateTile/CurrencyTable.tsx +64 -0
- package/src/components/ExchangeRateTile/CurrentLocation.tsx +28 -0
- package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +155 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.example.json +12 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.mobile.tsx +21 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +21 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +60 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +8 -0
- package/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
- package/src/components/ExchangeRateTile/calculateResult.ts +9 -0
- package/src/components/ExchangeRateTile/callbackCurrencySelect.ts +25 -0
- package/src/components/ExchangeRateTile/formatCurrency.ts +8 -0
- package/src/components/ExchangeRateTile/renderInput.tsx +43 -0
- package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +25 -0
|
@@ -159,7 +159,7 @@ export default {
|
|
|
159
159
|
className="col-span-12"
|
|
160
160
|
title="Заполните онлайн-заявку на открытие брокерского счёта"
|
|
161
161
|
typeForm="BROK"
|
|
162
|
-
endpoint="
|
|
162
|
+
endpoint="initcorporatelead"
|
|
163
163
|
sections={[
|
|
164
164
|
{
|
|
165
165
|
columns: 2,
|
|
@@ -219,7 +219,7 @@ export default {
|
|
|
219
219
|
className="col-span-12"
|
|
220
220
|
title="Заявка на выпуск бизнес-карты"
|
|
221
221
|
typeForm="BCRD"
|
|
222
|
-
endpoint="
|
|
222
|
+
endpoint="initcorporatelead"
|
|
223
223
|
sections={[
|
|
224
224
|
{
|
|
225
225
|
inputs: [{ name: 'region', required: true }],
|
|
@@ -247,7 +247,7 @@ export default {
|
|
|
247
247
|
className="col-span-12"
|
|
248
248
|
title="Заполните заявку на консультацию"
|
|
249
249
|
typeForm="COLLECTION"
|
|
250
|
-
endpoint="
|
|
250
|
+
endpoint="initcorporatelead"
|
|
251
251
|
sections={[
|
|
252
252
|
{
|
|
253
253
|
inputs: [
|
|
@@ -285,7 +285,7 @@ export default {
|
|
|
285
285
|
className="col-span-12"
|
|
286
286
|
title="Оформите заявку на кредит прямо сейчас"
|
|
287
287
|
typeForm="CRED"
|
|
288
|
-
endpoint="
|
|
288
|
+
endpoint="initcorporatelead"
|
|
289
289
|
sections={[
|
|
290
290
|
{
|
|
291
291
|
title: 'Параметры кредита',
|
|
@@ -501,7 +501,7 @@ export default {
|
|
|
501
501
|
className="col-span-12"
|
|
502
502
|
title="Самоинкассация (ЮЛ)"
|
|
503
503
|
typeForm="SELFCOLLECTION"
|
|
504
|
-
endpoint="
|
|
504
|
+
endpoint="initcorporatelead"
|
|
505
505
|
sections={[
|
|
506
506
|
{
|
|
507
507
|
inputs: [
|
|
@@ -563,7 +563,7 @@ export default {
|
|
|
563
563
|
className="col-span-12"
|
|
564
564
|
title="Получите консультацию по обслуживанию ВЭД"
|
|
565
565
|
typeForm="KVED"
|
|
566
|
-
endpoint="
|
|
566
|
+
endpoint="initcorporatelead"
|
|
567
567
|
sections={[
|
|
568
568
|
{
|
|
569
569
|
inputs: [
|
|
@@ -663,7 +663,7 @@ export default {
|
|
|
663
663
|
className="col-span-12"
|
|
664
664
|
title="Заявка по акции 'Шеф в деле'"
|
|
665
665
|
typeForm="FCB"
|
|
666
|
-
endpoint="
|
|
666
|
+
endpoint="initcorporatelead"
|
|
667
667
|
sections={[
|
|
668
668
|
{
|
|
669
669
|
inputs: [{ name: 'name', required: true }],
|
|
@@ -689,7 +689,7 @@ export default {
|
|
|
689
689
|
className="col-span-12"
|
|
690
690
|
title="Льготное кредитование АПК"
|
|
691
691
|
typeForm="CREDL"
|
|
692
|
-
endpoint="
|
|
692
|
+
endpoint="initcorporatelead"
|
|
693
693
|
sections={[
|
|
694
694
|
{
|
|
695
695
|
inputs: [{ name: 'name', required: true }],
|
|
@@ -715,7 +715,7 @@ export default {
|
|
|
715
715
|
className="col-span-12"
|
|
716
716
|
title="Подключить расчетно-кассовое обслуживание"
|
|
717
717
|
typeForm="CONT"
|
|
718
|
-
endpoint="
|
|
718
|
+
endpoint="initcorporatelead"
|
|
719
719
|
sections={[
|
|
720
720
|
{
|
|
721
721
|
inputs: [{ name: 'name', required: true }],
|
|
@@ -855,7 +855,7 @@ export default {
|
|
|
855
855
|
className="col-span-12"
|
|
856
856
|
title="Онлайн-заявка от партнера"
|
|
857
857
|
typeForm="PF"
|
|
858
|
-
endpoint="
|
|
858
|
+
endpoint="initcorporatelead"
|
|
859
859
|
sections={[
|
|
860
860
|
{
|
|
861
861
|
title: 'Информация о партнере',
|
|
@@ -902,7 +902,7 @@ export default {
|
|
|
902
902
|
className="col-span-12"
|
|
903
903
|
title="Заявка на открытие счёта для бизнеса"
|
|
904
904
|
typeForm="UNIVERSAL"
|
|
905
|
-
endpoint="
|
|
905
|
+
endpoint="initcorporatelead"
|
|
906
906
|
sections={[
|
|
907
907
|
{
|
|
908
908
|
inputs: [{ name: 'name', required: true }],
|
|
@@ -159,7 +159,7 @@ export default {
|
|
|
159
159
|
className="col-span-12"
|
|
160
160
|
title="Заполните онлайн-заявку на открытие брокерского счёта"
|
|
161
161
|
typeForm="BROK"
|
|
162
|
-
endpoint="
|
|
162
|
+
endpoint="initcorporatelead"
|
|
163
163
|
sections={[
|
|
164
164
|
{
|
|
165
165
|
columns: 2,
|
|
@@ -215,7 +215,7 @@ export default {
|
|
|
215
215
|
className="col-span-12"
|
|
216
216
|
title="Заявка на выпуск бизнес-карты"
|
|
217
217
|
typeForm="BCRD"
|
|
218
|
-
endpoint="
|
|
218
|
+
endpoint="initcorporatelead"
|
|
219
219
|
sections={[
|
|
220
220
|
{
|
|
221
221
|
inputs: [{ name: 'region', required: true }],
|
|
@@ -243,7 +243,7 @@ export default {
|
|
|
243
243
|
className="col-span-12"
|
|
244
244
|
title="Заполните заявку на консультацию"
|
|
245
245
|
typeForm="COLLECTION"
|
|
246
|
-
endpoint="
|
|
246
|
+
endpoint="initcorporatelead"
|
|
247
247
|
sections={[
|
|
248
248
|
{
|
|
249
249
|
inputs: [
|
|
@@ -281,7 +281,7 @@ export default {
|
|
|
281
281
|
className="col-span-12"
|
|
282
282
|
title="Оформите заявку на кредит прямо сейчас"
|
|
283
283
|
typeForm="CRED"
|
|
284
|
-
endpoint="
|
|
284
|
+
endpoint="initcorporatelead"
|
|
285
285
|
sections={[
|
|
286
286
|
{
|
|
287
287
|
title: 'Параметры кредита',
|
|
@@ -496,7 +496,7 @@ export default {
|
|
|
496
496
|
className="col-span-12"
|
|
497
497
|
title="Самоинкассация (ЮЛ)"
|
|
498
498
|
typeForm="SELFCOLLECTION"
|
|
499
|
-
endpoint="
|
|
499
|
+
endpoint="initcorporatelead"
|
|
500
500
|
sections={[
|
|
501
501
|
{
|
|
502
502
|
inputs: [
|
|
@@ -557,7 +557,7 @@ export default {
|
|
|
557
557
|
className="col-span-12"
|
|
558
558
|
title="Получите консультацию по обслуживанию ВЭД"
|
|
559
559
|
typeForm="KVED"
|
|
560
|
-
endpoint="
|
|
560
|
+
endpoint="initcorporatelead"
|
|
561
561
|
sections={[
|
|
562
562
|
{
|
|
563
563
|
inputs: [
|
|
@@ -658,7 +658,7 @@ export default {
|
|
|
658
658
|
className="col-span-12"
|
|
659
659
|
title="Заявка по акции 'Шеф в деле'"
|
|
660
660
|
typeForm="FCB"
|
|
661
|
-
endpoint="
|
|
661
|
+
endpoint="initcorporatelead"
|
|
662
662
|
sections={[
|
|
663
663
|
{
|
|
664
664
|
inputs: [{ name: 'name', required: true }],
|
|
@@ -684,7 +684,7 @@ export default {
|
|
|
684
684
|
className="col-span-12"
|
|
685
685
|
title="Льготное кредитование АПК"
|
|
686
686
|
typeForm="CREDL"
|
|
687
|
-
endpoint="
|
|
687
|
+
endpoint="initcorporatelead"
|
|
688
688
|
sections={[
|
|
689
689
|
{
|
|
690
690
|
inputs: [{ name: 'name', required: true }],
|
|
@@ -710,7 +710,7 @@ export default {
|
|
|
710
710
|
className="col-span-12"
|
|
711
711
|
title="Подключить расчетно-кассовое обслуживание"
|
|
712
712
|
typeForm="CONT"
|
|
713
|
-
endpoint="
|
|
713
|
+
endpoint="initcorporatelead"
|
|
714
714
|
sections={[
|
|
715
715
|
{
|
|
716
716
|
inputs: [{ name: 'name', required: true }],
|
|
@@ -850,7 +850,7 @@ export default {
|
|
|
850
850
|
className="col-span-12"
|
|
851
851
|
title="Онлайн-заявка от партнера"
|
|
852
852
|
typeForm="PF"
|
|
853
|
-
endpoint="
|
|
853
|
+
endpoint="initcorporatelead"
|
|
854
854
|
sections={[
|
|
855
855
|
{
|
|
856
856
|
title: 'Информация о партнере',
|
|
@@ -919,7 +919,7 @@ export default {
|
|
|
919
919
|
className="col-span-12"
|
|
920
920
|
title="Заявка на открытие счёта для бизнеса"
|
|
921
921
|
typeForm="UNIVERSAL"
|
|
922
|
-
endpoint="
|
|
922
|
+
endpoint="initcorporatelead"
|
|
923
923
|
sections={[
|
|
924
924
|
{
|
|
925
925
|
inputs: [{ name: 'name', required: true }],
|
|
@@ -38,10 +38,11 @@ export type FieldDef = Required &
|
|
|
38
38
|
name?: NameFieldDef;
|
|
39
39
|
dadata?: boolean;
|
|
40
40
|
defaultValue?: string;
|
|
41
|
+
placeholder?: string;
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
/** @hidden */
|
|
44
|
-
export type EndpointType = 'lead' | '
|
|
45
|
+
export type EndpointType = 'lead' | 'initcorporatelead';
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
48
|
* @title Секция полей ввода
|
|
@@ -70,7 +70,7 @@ export const useInitApplicationLead = ({
|
|
|
70
70
|
useEffect(() => {
|
|
71
71
|
leadFormStore.productType = productType;
|
|
72
72
|
|
|
73
|
-
const {
|
|
73
|
+
const { referalCode, refererCode, productId, marketingInfo } = getLeadQueryParams(
|
|
74
74
|
queryFromStorage,
|
|
75
75
|
sessionStore,
|
|
76
76
|
);
|
|
@@ -84,6 +84,13 @@ export const useInitApplicationLead = ({
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
sessionStore.marketingInfo = marketingInfo;
|
|
87
|
+
}, [queryFromStorage]);
|
|
88
|
+
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
91
|
+
|
|
92
|
+
const code = params.get('code');
|
|
93
|
+
const state = params.get('state');
|
|
87
94
|
|
|
88
95
|
if (code && state) {
|
|
89
96
|
requestEsiaProfile(code, state);
|
|
@@ -91,7 +98,7 @@ export const useInitApplicationLead = ({
|
|
|
91
98
|
sessionStorage.removeItem('accessToken');
|
|
92
99
|
sessionStorage.removeItem('refreshToken');
|
|
93
100
|
}
|
|
94
|
-
}, [
|
|
101
|
+
}, []);
|
|
95
102
|
|
|
96
103
|
return initialFormState;
|
|
97
104
|
};
|
|
@@ -103,10 +110,8 @@ const getLeadQueryParams = (
|
|
|
103
110
|
const referalData = sessionStore.referalData;
|
|
104
111
|
const marketingInfoFromStorage = sessionStore.marketingInfo;
|
|
105
112
|
const queryStorage = new URLSearchParams(decodeURIComponent(queryFromStorage || ''));
|
|
106
|
-
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
107
113
|
|
|
108
|
-
const code =
|
|
109
|
-
const state = params.get('state');
|
|
114
|
+
const code = queryStorage.get('code');
|
|
110
115
|
const referalCode = code ? referalData?.referalCode : queryStorage.get('referalCode');
|
|
111
116
|
const refererCode = code ? referalData?.refererCode : queryStorage.get('refererCode');
|
|
112
117
|
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
@@ -123,8 +128,6 @@ const getLeadQueryParams = (
|
|
|
123
128
|
};
|
|
124
129
|
|
|
125
130
|
return {
|
|
126
|
-
code,
|
|
127
|
-
state,
|
|
128
131
|
referalCode,
|
|
129
132
|
refererCode,
|
|
130
133
|
productId,
|
|
@@ -22,6 +22,7 @@ import { CreditForm } from './CreditForm/CreditForm';
|
|
|
22
22
|
import { DebitForm } from './DebitForm/DebitForm';
|
|
23
23
|
import { DepositFiltration } from './DepositFiltration/DepositFiltration';
|
|
24
24
|
import { ErrorBlock } from './ErrorBlock/ErrorBlock';
|
|
25
|
+
import { ExchangeRateTile } from './ExchangeRateTile/ExchangeRateTile';
|
|
25
26
|
import { Footer } from './Footer/Footer';
|
|
26
27
|
import { GalleryLayout } from './GalleryLayout/GalleryLayout';
|
|
27
28
|
import { GrantSupport } from './GrantSupport/GrantSupport';
|
|
@@ -61,6 +62,7 @@ export const Blocks: BlocksRegistry = {
|
|
|
61
62
|
CarouselTariffsCard,
|
|
62
63
|
DepositFiltration,
|
|
63
64
|
ErrorBlock,
|
|
65
|
+
ExchangeRateTile,
|
|
64
66
|
Footer,
|
|
65
67
|
GalleryLayout,
|
|
66
68
|
GrantSupport,
|
package/src/components/Blocks.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { CreditForm } from './CreditForm/CreditForm';
|
|
|
23
23
|
import { DebitForm } from './DebitForm/DebitForm';
|
|
24
24
|
import { DepositFiltration } from './DepositFiltration/DepositFiltration';
|
|
25
25
|
import { ErrorBlock } from './ErrorBlock/ErrorBlock';
|
|
26
|
+
import { ExchangeRateTile } from './ExchangeRateTile/ExchangeRateTile';
|
|
26
27
|
import { Footer } from './Footer/Footer';
|
|
27
28
|
import { GalleryLayout } from './GalleryLayout/GalleryLayout';
|
|
28
29
|
import { GrantSupport } from './GrantSupport/GrantSupport';
|
|
@@ -66,6 +67,7 @@ export const Blocks: BlocksRegistry = {
|
|
|
66
67
|
ErrorBlock,
|
|
67
68
|
Footer,
|
|
68
69
|
GalleryLayout,
|
|
70
|
+
ExchangeRateTile,
|
|
69
71
|
GrantSupport,
|
|
70
72
|
Header,
|
|
71
73
|
Headline,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type ComponentType } from '../../model/ComponentType';
|
|
3
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
4
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
5
|
+
import { style } from '../../utils/style';
|
|
6
|
+
import { type ExchangeCurrencyItem } from './ExchangeCurrencyCalculator';
|
|
7
|
+
import { formatCurrency } from './formatCurrency';
|
|
8
|
+
|
|
9
|
+
const TABLE_STYLE_BASE = 'text-m font-light text-secondary-text ';
|
|
10
|
+
const TABLE_HEAD_STYLE = `${TABLE_STYLE_BASE} text-left`;
|
|
11
|
+
const TABLE_HEAD_STYLE_CENTER = `${TABLE_STYLE_BASE} pl-5xl text-center`;
|
|
12
|
+
const TABLE_HEAD_STYLE_RIGHT = `${TABLE_STYLE_BASE} pl-5xl text-right`;
|
|
13
|
+
|
|
14
|
+
const CURRENCY_ICONS_MAP = {
|
|
15
|
+
USD: 'DollarIcon',
|
|
16
|
+
EUR: 'EuroIcon',
|
|
17
|
+
CNY: 'ChineseYuanRenminbiIcon',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
interface CurrencyTableProps extends ComponentType {
|
|
21
|
+
exchangeCurrencyItems: ExchangeCurrencyItem[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const CurrencyTable = JSX<CurrencyTableProps>(({ className, exchangeCurrencyItems }) => (
|
|
25
|
+
<table className={style('h-fit w-full', className)}>
|
|
26
|
+
<thead>
|
|
27
|
+
<tr>
|
|
28
|
+
<th className={TABLE_HEAD_STYLE}>
|
|
29
|
+
<Text size="text-m">Валюта</Text>
|
|
30
|
+
</th>
|
|
31
|
+
<th className={TABLE_HEAD_STYLE_CENTER}>
|
|
32
|
+
<Text size="text-m">Купить</Text>
|
|
33
|
+
</th>
|
|
34
|
+
<th className={TABLE_HEAD_STYLE_RIGHT}>
|
|
35
|
+
<Text size="text-m">Продать</Text>
|
|
36
|
+
</th>
|
|
37
|
+
</tr>
|
|
38
|
+
</thead>
|
|
39
|
+
<tbody>{exchangeCurrencyItems.map(renderCurrencyRow)}</tbody>
|
|
40
|
+
</table>
|
|
41
|
+
));
|
|
42
|
+
|
|
43
|
+
const renderCurrencyRow = (exchangeCurrencyItem: ExchangeCurrencyItem) => {
|
|
44
|
+
const currency = exchangeCurrencyItem?.currency?.currency;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<tr key={currency} className="pb-2xs text-h6">
|
|
48
|
+
<td className="pt-m m-auto flex text-left">
|
|
49
|
+
<div className="flex items-center gap-xs">
|
|
50
|
+
{currency ? (
|
|
51
|
+
<Img image={{ icon: CURRENCY_ICONS_MAP[currency] }} width="24" height="24" />
|
|
52
|
+
) : null}
|
|
53
|
+
<Text size="text-h6">{currency}</Text>
|
|
54
|
+
</div>
|
|
55
|
+
</td>
|
|
56
|
+
<td className="pt-m pl-5xl text-center">
|
|
57
|
+
<Text size="text-h6">{formatCurrency(exchangeCurrencyItem?.saleExchangeRate)}</Text>
|
|
58
|
+
</td>
|
|
59
|
+
<td className="pt-m pl-5xl text-right">
|
|
60
|
+
<Text size="text-h6">{formatCurrency(exchangeCurrencyItem?.buyExchangeRate)}</Text>
|
|
61
|
+
</td>
|
|
62
|
+
</tr>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type ComponentType } from '../../model/ComponentType';
|
|
3
|
+
import { type Picture } from '../../model/Picture';
|
|
4
|
+
import { RoundedIcon } from '../../ui-kit/Icon/RoundedIcon';
|
|
5
|
+
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
6
|
+
import { style } from '../../utils/style';
|
|
7
|
+
|
|
8
|
+
interface CurrentLocationProps extends ComponentType {
|
|
9
|
+
address?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const icon: Picture = { icon: 'GpsIcon' };
|
|
13
|
+
|
|
14
|
+
export const CurrentLocation = JSX<CurrentLocationProps>(({ className = '', address }) => (
|
|
15
|
+
<div className={style('flex gap-s w-full justify-between @sm:justify-center', className)}>
|
|
16
|
+
<RoundedIcon {...icon} iconBgVersion="primary" className="shrink-0" />
|
|
17
|
+
<div className="space-y-2xs whitespace-pre-wrap">
|
|
18
|
+
{address ? (
|
|
19
|
+
<Paragraph size="text-l" color="text-primary-main">
|
|
20
|
+
{address}
|
|
21
|
+
</Paragraph>
|
|
22
|
+
) : null}
|
|
23
|
+
<Paragraph size="text-m" color="text-secondary-text">
|
|
24
|
+
Курс указан для заданного офиса
|
|
25
|
+
</Paragraph>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
));
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { type ComponentType } from '../../model/ComponentType';
|
|
4
|
+
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
5
|
+
import { type ButtonCommonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
6
|
+
import { calculateResult, formatValue } from './calculateResult';
|
|
7
|
+
import { callbackCurrencySelect } from './callbackCurrencySelect';
|
|
8
|
+
import { Currency } from './CurrencyProps';
|
|
9
|
+
import { renderInput } from './renderInput';
|
|
10
|
+
|
|
11
|
+
export interface ExchangeCurrencyItem {
|
|
12
|
+
currency?: {
|
|
13
|
+
id?: number;
|
|
14
|
+
code?: string;
|
|
15
|
+
currency?: Currency;
|
|
16
|
+
};
|
|
17
|
+
buyExchangeRate?: number;
|
|
18
|
+
saleExchangeRate?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ExchangeCurrencyCalculatorProps extends ComponentType {
|
|
22
|
+
currencyRatesBuy: ExchangeCurrencyItem[];
|
|
23
|
+
currencyRatesSell: ExchangeCurrencyItem[];
|
|
24
|
+
button?: ButtonCommonContent;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface CalcState {
|
|
28
|
+
inputSell: string;
|
|
29
|
+
inputBuy: string;
|
|
30
|
+
selectSell: Currency;
|
|
31
|
+
selectBuy: Currency;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const ExchangeCurrencyCalculator = JSX<ExchangeCurrencyCalculatorProps>(
|
|
35
|
+
({ className = '', currencyRatesBuy, currencyRatesSell, button }) => {
|
|
36
|
+
const [calcState, setCalcState] = useState<CalcState>({
|
|
37
|
+
inputSell: '',
|
|
38
|
+
inputBuy: '',
|
|
39
|
+
selectSell: currencyRatesBuy?.[0]?.currency?.currency || Currency.RUB,
|
|
40
|
+
selectBuy: currencyRatesSell?.[0]?.currency?.currency || Currency.USD,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const handleSetCalcState = useCallback(
|
|
44
|
+
(newState: Partial<CalcState>) => setCalcState((oldState) => ({ ...oldState, ...newState })),
|
|
45
|
+
[],
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div className={`flex flex-col gap-m pt-2xl ${className}`}>
|
|
50
|
+
{currencyRatesBuy && currencyRatesSell ? (
|
|
51
|
+
<div className="grid gap-m">
|
|
52
|
+
{renderInput({
|
|
53
|
+
placeholder: 'Хочу продать',
|
|
54
|
+
rates: currencyRatesSell,
|
|
55
|
+
selected: calcState.selectSell,
|
|
56
|
+
setSelected: handleSelectSell(calcState, handleSetCalcState, currencyRatesSell),
|
|
57
|
+
value: calcState.inputSell,
|
|
58
|
+
onChange: (value) =>
|
|
59
|
+
handleInputSell(handleSetCalcState, currencyRatesSell)(
|
|
60
|
+
value,
|
|
61
|
+
calcState.selectSell,
|
|
62
|
+
calcState.selectBuy,
|
|
63
|
+
),
|
|
64
|
+
})}
|
|
65
|
+
{renderInput({
|
|
66
|
+
placeholder: 'Получу',
|
|
67
|
+
rates: currencyRatesBuy,
|
|
68
|
+
selected: calcState.selectBuy,
|
|
69
|
+
setSelected: handleSelectBuy(calcState, handleSetCalcState, currencyRatesBuy),
|
|
70
|
+
value: calcState.inputBuy,
|
|
71
|
+
onChange: (value) =>
|
|
72
|
+
handleInputBuy(handleSetCalcState, currencyRatesBuy)(
|
|
73
|
+
value,
|
|
74
|
+
calcState.selectBuy,
|
|
75
|
+
calcState.selectSell,
|
|
76
|
+
),
|
|
77
|
+
})}
|
|
78
|
+
</div>
|
|
79
|
+
) : null}
|
|
80
|
+
{button?.text ? (
|
|
81
|
+
<LinkButton text={button.text} version={button?.version} {...button} />
|
|
82
|
+
) : null}
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
const handleSelectSell =
|
|
89
|
+
(
|
|
90
|
+
calcState: CalcState,
|
|
91
|
+
setCalcState: (state: Partial<CalcState>) => void,
|
|
92
|
+
currencyRatesSell: ExchangeCurrencyItem[],
|
|
93
|
+
) =>
|
|
94
|
+
(value: Currency) => {
|
|
95
|
+
setCalcState({ selectSell: value });
|
|
96
|
+
callbackCurrencySelect({
|
|
97
|
+
value,
|
|
98
|
+
oppositeValue: calcState.selectBuy,
|
|
99
|
+
handleConvert: (currencyFrom = calcState.selectSell, currencyTo = calcState.selectBuy) => {
|
|
100
|
+
handleInputSell(setCalcState, currencyRatesSell)(
|
|
101
|
+
calcState.inputSell,
|
|
102
|
+
currencyFrom,
|
|
103
|
+
currencyTo,
|
|
104
|
+
);
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const handleSelectBuy =
|
|
110
|
+
(
|
|
111
|
+
calcState: CalcState,
|
|
112
|
+
setCalcState: (state: Partial<CalcState>) => void,
|
|
113
|
+
currencyRatesBuy: ExchangeCurrencyItem[],
|
|
114
|
+
) =>
|
|
115
|
+
(value: Currency) => {
|
|
116
|
+
setCalcState({ selectBuy: value });
|
|
117
|
+
callbackCurrencySelect({
|
|
118
|
+
value,
|
|
119
|
+
oppositeValue: calcState.selectSell,
|
|
120
|
+
handleConvert: (currencyTo = calcState.selectBuy, currencyFrom = calcState.selectSell) =>
|
|
121
|
+
handleInputBuy(setCalcState, currencyRatesBuy)(
|
|
122
|
+
calcState.inputBuy,
|
|
123
|
+
currencyTo,
|
|
124
|
+
currencyFrom,
|
|
125
|
+
),
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const handleInputSell =
|
|
130
|
+
(setCalcState: (state: Partial<CalcState>) => void, currencyRatesSell: ExchangeCurrencyItem[]) =>
|
|
131
|
+
(value: string, currencyFrom: Currency, currencyTo: Currency) => {
|
|
132
|
+
setCalcState({ inputSell: formatValue(value), selectBuy: currencyTo });
|
|
133
|
+
const rate =
|
|
134
|
+
currencyRatesSell.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate ||
|
|
135
|
+
currencyRatesSell.find((_) => _.currency?.currency === currencyFrom)?.buyExchangeRate;
|
|
136
|
+
if (rate) {
|
|
137
|
+
setCalcState({
|
|
138
|
+
inputBuy: String(calculateResult(value, rate, currencyFrom === Currency.RUB) || ''),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const handleInputBuy =
|
|
144
|
+
(setCalcState: (state: Partial<CalcState>) => void, currencyRatesBuy: ExchangeCurrencyItem[]) =>
|
|
145
|
+
(value: string, currencyTo: Currency, currencyFrom: Currency) => {
|
|
146
|
+
setCalcState({ inputBuy: formatValue(value), selectSell: currencyFrom });
|
|
147
|
+
const rate =
|
|
148
|
+
currencyRatesBuy.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate ||
|
|
149
|
+
currencyRatesBuy.find((_) => _.currency?.currency === currencyTo)?.saleExchangeRate;
|
|
150
|
+
if (rate) {
|
|
151
|
+
setCalcState({
|
|
152
|
+
inputSell: String(calculateResult(value, rate, currencyTo === Currency.RUB) || ''),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import '../../setup-fixture';
|
|
2
|
+
|
|
3
|
+
import { type LinkButtonProps } from '../../ui-kit/LinkButton/LinkButtonProps';
|
|
4
|
+
import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
|
|
5
|
+
import { ExchangeRateTile } from './ExchangeRateTile';
|
|
6
|
+
|
|
7
|
+
const button: LinkButtonProps = {
|
|
8
|
+
href: 'https://coins.rshb.ru/exchange',
|
|
9
|
+
text: 'Купить валюту',
|
|
10
|
+
target: '_blank',
|
|
11
|
+
version: 'primary',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
default: (
|
|
16
|
+
<div className="container grid grid-cols-12">
|
|
17
|
+
<ExchangeRateTile button={button} className="col-span-12" />
|
|
18
|
+
<PopupManager />
|
|
19
|
+
</div>
|
|
20
|
+
),
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import '../../setup-fixture';
|
|
2
|
+
|
|
3
|
+
import { type LinkButtonProps } from '../../ui-kit/LinkButton/LinkButtonProps';
|
|
4
|
+
import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
|
|
5
|
+
import { ExchangeRateTile } from './ExchangeRateTile';
|
|
6
|
+
|
|
7
|
+
const button: LinkButtonProps = {
|
|
8
|
+
href: 'https://coins.rshb.ru/exchange',
|
|
9
|
+
text: 'Купить валюту',
|
|
10
|
+
target: '_blank',
|
|
11
|
+
version: 'primary',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
default: (
|
|
16
|
+
<div className="container grid grid-cols-12">
|
|
17
|
+
<ExchangeRateTile button={button} className="col-span-8" />
|
|
18
|
+
<PopupManager />
|
|
19
|
+
</div>
|
|
20
|
+
),
|
|
21
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useLocation } from '../../hooks/useLocation';
|
|
3
|
+
import { BaseTile } from '../../ui-kit/BaseTile/BaseTile';
|
|
4
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
|
+
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
7
|
+
import { style } from '../../utils/style';
|
|
8
|
+
import { Currency } from './CurrencyProps';
|
|
9
|
+
import { CurrencyTable } from './CurrencyTable';
|
|
10
|
+
import { CurrentLocation } from './CurrentLocation';
|
|
11
|
+
import {
|
|
12
|
+
ExchangeCurrencyCalculator,
|
|
13
|
+
type ExchangeCurrencyItem,
|
|
14
|
+
} from './ExchangeCurrencyCalculator';
|
|
15
|
+
import { type ExchangeRateTileContent } from './ExchangeRateTileContent';
|
|
16
|
+
import { useFetchExchangeRateData } from './useFetchExchangeRateData';
|
|
17
|
+
|
|
18
|
+
export interface ExchangeRateTileProps extends ExchangeRateTileContent, UniBlockProps {}
|
|
19
|
+
|
|
20
|
+
export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
|
|
21
|
+
({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
|
|
22
|
+
const currentLocation = useLocation();
|
|
23
|
+
const exchangeRates = useFetchExchangeRateData(currentLocation);
|
|
24
|
+
|
|
25
|
+
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
26
|
+
|
|
27
|
+
const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
|
|
28
|
+
currencyRatesBuy.unshift({ currency: { currency: Currency.RUB } });
|
|
29
|
+
|
|
30
|
+
const currencyRatesSell = currencyRates.filter((_) => _.saleExchangeRate);
|
|
31
|
+
currencyRatesSell.push({ currency: { currency: Currency.RUB } });
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<BlockWrapper className={style('box-border min-h-80', className)} {...rest}>
|
|
35
|
+
<BaseTile
|
|
36
|
+
className="h-full"
|
|
37
|
+
title={<Heading headingType="h4" title={title} className="whitespace-pre-wrap" />}
|
|
38
|
+
>
|
|
39
|
+
<div className="flex w-full gap-6xl flex-wrap @lg:flex-nowrap">
|
|
40
|
+
<div className="w-full @2xl:w-auto @5xl:w-1/2">
|
|
41
|
+
{currencyRates ? (
|
|
42
|
+
<CurrencyTable className="mb-xl" exchangeCurrencyItems={currencyRates} />
|
|
43
|
+
) : null}
|
|
44
|
+
<CurrentLocation address={exchangeRates?.address} />
|
|
45
|
+
</div>
|
|
46
|
+
<ExchangeCurrencyCalculator
|
|
47
|
+
className="grow w-1/2"
|
|
48
|
+
currencyRatesBuy={currencyRatesBuy}
|
|
49
|
+
currencyRatesSell={currencyRatesSell}
|
|
50
|
+
button={button}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</BaseTile>
|
|
54
|
+
</BlockWrapper>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const getCurrencyRates = (currencies?: ExchangeCurrencyItem[]) =>
|
|
60
|
+
currencies?.filter((_) => [1, 2, 3].includes(_?.currency?.id as number)) || [];
|