Skip to content

Commit

Permalink
Merge branch 'main' into neoradio-tailwindcss
Browse files Browse the repository at this point in the history
  • Loading branch information
roiLeo authored Dec 13, 2023
2 parents e100c60 + 49437fb commit e703a13
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 23 deletions.
36 changes: 36 additions & 0 deletions components/teleport/Teleport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@
>
</div>

<a
v-if="insufficientExistentialDeposit"
v-safe-href="
`https://support.polkadot.network/support/solutions/articles/65000168651-what-is-the-existential-deposit`
"
target="_blank"
class="has-text-danger">
{{
$t('teleport.insufficientExistentialDeposit', [
targetExistentialDepositAmount,
currency,
])
}}
</a>

<NeoButton
:label="teleportLabel"
size="large"
Expand Down Expand Up @@ -146,6 +161,7 @@ import { NeoButton, NeoField } from '@kodadot1/brick'
import { blockExplorerOf } from '@/utils/config/chain.config'
import { simpleDivision } from '@/utils/balance'
import { useFiatStore } from '@/stores/fiat'
import { existentialDeposit } from '@kodadot1/static'
const {
chainBalances,
Expand Down Expand Up @@ -176,6 +192,12 @@ const nativeAmount = computed(() =>
Math.floor(amount.value * Math.pow(10, currentTokenDecimals.value)),
)
const targetExistentialDepositAmount = computed(() =>
Number(
targetExistentialDeposit.value / Math.pow(10, targetTokenDecimals.value),
),
)
const amountToTeleport = computed(() =>
Math.max(nativeAmount.value - teleportFee.value, 0),
)
Expand All @@ -186,6 +208,18 @@ const recieveAmount = computed(() =>
formatBalance(amountToTeleport.value, currentTokenDecimals.value, false),
)
const targetExistentialDeposit = computed(
() => existentialDeposit[chainToPrefixMap[toChain.value]],
)
const insufficientExistentialDeposit = computed(() => {
return Boolean(
targetExistentialDeposit.value &&
amountToTeleport.value &&
targetExistentialDeposit.value > amountToTeleport.value,
)
})
const teleportLabel = computed(() => {
if (insufficientBalance.value) {
return $i18n.t('teleport.insufficientBalance', [currency])
Expand Down Expand Up @@ -289,6 +323,8 @@ const currentTokenDecimals = computed(() =>
getChainTokenDecimals(fromChain.value),
)
const targetTokenDecimals = computed(() => getChainTokenDecimals(toChain.value))
const toChainLabel = computed(() =>
getChainName(chainToPrefixMap[toChain.value]),
)
Expand Down
9 changes: 9 additions & 0 deletions libs/static/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,12 @@ export const chainList = (): Option[] => {
value: prefix,
}))
}

export const existentialDeposit: Record<Prefix, number> = {
ksm: 333333333,
rmrk: 333333333,
ahk: 33333333,
dot: 10000000000,
ahp: 1000000000,
bsx: 1000000000000,
}
26 changes: 8 additions & 18 deletions libs/ui/src/components/NeoNotification/NeoNotification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,31 @@ export default {
</script>

<style lang="scss">
@import '../../scss/_theme.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_expressions.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_variables.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_animations.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_helpers.scss';
@import '@oruga-ui/oruga-next/src/scss/components/_notification.scss';
.o-notices {
top: 4.5rem;
@apply top-[4.5rem];
.o-notification {
padding: 1rem 2rem;
@apply py-4 px-8;
&--component {
padding: 0 !important;
background-color: unset;
@apply p-0 #{!important};
@apply bg-[unset];
}
}
}
.is-neo-toast {
font-size: 12px;
border-radius: 0;
padding: 0.5rem 1rem !important;
@apply text-xs rounded-none bg-background-color border-default border-border-color shadow-primary text-text-color;
@apply py-2 px-4 #{!important};
@include ktheme() {
background-color: theme('background-color');
border: 1px solid theme('border-color');
box-shadow: theme('primary-shadow');
color: theme('text-color');
-webkit-box-shadow: theme('primary-shadow');
&:hover {
background-color: theme('k-accentlight');
}
&:hover {
@apply bg-k-accent-light;
}
}
</style>
5 changes: 1 addition & 4 deletions libs/ui/src/components/NeoPagination/NeoPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ export default {
</script>

<style lang="scss">
@import '../../scss/_theme.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_expressions.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_variables.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_animations.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_helpers.scss';
@import '@oruga-ui/oruga-next/src/scss/components/_pagination.scss';
.o-pag__link--current {
@include ktheme() {
background: theme('k-primary');
}
@apply bg-k-primary;
}
</style>
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,8 @@
"congratsSupport": "Congratulations for supporting",
"tweetDonation": "Tweet about your awesome donation",
"donationSentTo": "Your donation will be sent to:",
"ownerMessage": "(You Are Owner)"
"ownerMessage": "(You Are Owner)",
"insufficientExistentialDeposit": "Sending less than the required Existential Deposit amount will result in fund loss, min value to send is [ {0} + fees ] {1}"
},
"preferences": {
"basic": "basic user interface",
Expand Down
4 changes: 4 additions & 0 deletions pages/[prefix]/drops/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ useSeoMeta({
description: 'View all drops',
ogUrl: route.path,
})
definePageMeta({
layout: 'no-footer',
})
</script>

0 comments on commit e703a13

Please sign in to comment.