From e454f941fd58102cc6f57dff50c402daaa8b31b7 Mon Sep 17 00:00:00 2001 From: daiagi Date: Wed, 13 Dec 2023 19:19:18 +0700 Subject: [PATCH 1/3] teleport ED modal + bug fix --- components/teleport/EDWarningModal.vue | 86 +++++++++++++++++++ components/teleport/Teleport.vue | 113 ++++++++++++++++++------- locales/en.json | 10 ++- 3 files changed, 176 insertions(+), 33 deletions(-) create mode 100644 components/teleport/EDWarningModal.vue diff --git a/components/teleport/EDWarningModal.vue b/components/teleport/EDWarningModal.vue new file mode 100644 index 0000000000..15e7840edc --- /dev/null +++ b/components/teleport/EDWarningModal.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/components/teleport/Teleport.vue b/components/teleport/Teleport.vue index 11054e7f3f..a8f4fcfb7e 100644 --- a/components/teleport/Teleport.vue +++ b/components/teleport/Teleport.vue @@ -1,5 +1,7 @@ diff --git a/components/teleport/Teleport.vue b/components/teleport/Teleport.vue index a8f4fcfb7e..c6dd51c1f7 100644 --- a/components/teleport/Teleport.vue +++ b/components/teleport/Teleport.vue @@ -83,42 +83,10 @@
-
+ - - {{ $t('teleport.fundsAtRisk') }} -  - - {{ $t('teleport.why') }} - - -
+ :target-existential-deposit-amount="targetExistentialDepositAmount" />
{{ $t('general.balance') }}: - @import '@/assets/styles/abstracts/variables'; +$xs-breakpoint: 400px; + +.flex-direction { + @include until($xs-breakpoint) { + flex-direction: column; + gap: 0.25rem; + } +} +.align-items { + align-items: center; + @include until($xs-breakpoint) { + align-items: flex-start; + } +} .teleport-container { @include tablet { @@ -500,6 +475,13 @@ onBeforeUnmount(() => { } } +.justify-content { + justify-content: space-between; + @include until($xs-breakpoint) { + justify-content: flex-end; + } +} + .is-absolute-right { position: absolute; right: 2rem; From dce616ec079be2612896ec19e2f43ca8df0bd063 Mon Sep 17 00:00:00 2001 From: daiagi Date: Fri, 15 Dec 2023 10:00:41 +0700 Subject: [PATCH 3/3] add currency to EDWarningModal --- components/teleport/EDWarningModal.vue | 6 +++++- components/teleport/Teleport.vue | 1 + locales/en.json | 2 +- utils/teleport.ts | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/components/teleport/EDWarningModal.vue b/components/teleport/EDWarningModal.vue index 15e7840edc..b979cb2ed4 100644 --- a/components/teleport/EDWarningModal.vue +++ b/components/teleport/EDWarningModal.vue @@ -20,7 +20,10 @@ class="is-flex is-flex-direction-column px-4 bakground-warning-red border border-color-k-red"> {{ - $t('teleport.insufficientExistentialDeposit', [existentialDeposit]) + $t('teleport.insufficientExistentialDeposit', [ + existentialDeposit, + currency, + ]) }} {{ $t('teleport.lossOfFunds') }} @@ -55,6 +58,7 @@ import { NeoButton, NeoCheckbox, NeoIcon, NeoModal } from '@kodadot1/brick' const props = defineProps<{ modelValue: boolean existentialDeposit: number + currency: Currency }>() const isModalActive = useVModel(props, 'modelValue') diff --git a/components/teleport/Teleport.vue b/components/teleport/Teleport.vue index c6dd51c1f7..7cf5a7af65 100644 --- a/components/teleport/Teleport.vue +++ b/components/teleport/Teleport.vue @@ -134,6 +134,7 @@ { +export type Currency = 'KSM' | 'DOT' + +export const getChainCurrency = (chain: Chain): Currency => { switch (chain) { case Chain.KUSAMA: case Chain.BASILISK: