Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhace unlock contracts dialog #3091

Merged
merged 3 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@

<v-dialog width="800" v-model="contractStateDialog">
<v-card>
<v-toolbar color="primary" class="custom-toolbar">
<p class="mb-5">Contract lock Details</p>
</v-toolbar>
<v-card-title class="bg-primary">
<p class="pl-2">Contract lock Details</p>
</v-card-title>
<v-card-text class="mt-4">
<v-row class="d-flex justify-center">
Amount Locked:
Expand Down Expand Up @@ -235,7 +235,8 @@
<v-card-text v-else>
<v-alert class="my-4" type="warning" variant="tonal">
<div v-if="selectedLockedAmount < freeBalance">
You have enough balance to unlock your contract<span v-if="selectedContracts.length > 1">s</span>!
You have enough balance to unlock your contract<span v-if="selectedContracts.length > 1">s</span>; this will
cost you around {{ Math.ceil(selectedLockedAmount) }} TFTs.
</div>
<div v-else-if="selectedLockedAmount > 0">
You need to fund your account with
Expand Down Expand Up @@ -375,7 +376,7 @@ const selectedContracts = ref<NormalizedContract[]>([]);
const selectedItem = ref();
const profileManagerController = useProfileManagerController();
const balance = profileManagerController.balance;
const freeBalance = computed(() => balance.value?.free ?? 0 - (balance.value?.locked ?? 0));
const freeBalance = computed(() => (balance.value?.free ?? 0) - (balance.value?.locked ?? 0));
const unlockContractLoading = ref(false);
const unlockDialog = ref(false);
const selectedLockedContracts = computed(() => {
Expand Down
5 changes: 3 additions & 2 deletions packages/playground/src/weblets/tf_contracts_list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
<v-row class="d-flex" v-else>
<v-alert class="ma-4" type="warning" variant="tonal">
<div v-if="lockedContracts?.totalAmountLocked < freeBalance" class="font-weigh-black">
You have enough balance to unlock your contracts!
You have enough balance to unlock your contracts; this will cost you around
{{ Math.ceil(lockedContracts?.totalAmountLocked) }} TFTs.
</div>
<div v-else>
You need to fund your account with
Expand Down Expand Up @@ -201,7 +202,7 @@ import { useGrid } from "../stores";

const profileManagerController = useProfileManagerController();
const balance = profileManagerController.balance;
const freeBalance = computed(() => balance.value?.free ?? 0 - (balance.value?.locked ?? 0));
const freeBalance = computed(() => (balance.value?.free ?? 0) - (balance.value?.locked ?? 0));
const isLoading = ref<boolean>(false);

const profileManager = useProfileManager();
Expand Down