Merge branch 'develop' into transaction-history
This commit is contained in:
@@ -2,27 +2,16 @@
|
||||
import { ref } from "vue";
|
||||
import CustomButton from "../../components/CustomButton.vue";
|
||||
import { debounce } from "@/utils/debounce";
|
||||
import { useEtherStore } from "@/store/ether";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
// Store reference
|
||||
const etherStore = useEtherStore();
|
||||
|
||||
const { walletAddress, depositsAddedList } = storeToRefs(etherStore);
|
||||
|
||||
// Reactive state
|
||||
const tokenValue = ref(0);
|
||||
const enableSelectButton = ref(false);
|
||||
const hasLiquidity = ref(true);
|
||||
const validDecimals = ref(true);
|
||||
const selectedDeposit = ref();
|
||||
|
||||
// Emits
|
||||
const emit = defineEmits(["tokenBuy"]);
|
||||
|
||||
// Blockchain methods
|
||||
const connectAccount = async () => {};
|
||||
|
||||
// Debounce methods
|
||||
const handleInputEvent = (event: any) => {
|
||||
const { value } = event.target;
|
||||
@@ -35,8 +24,6 @@ const handleInputEvent = (event: any) => {
|
||||
return;
|
||||
}
|
||||
validDecimals.value = true;
|
||||
|
||||
// verifyLiquidity();
|
||||
};
|
||||
|
||||
// Enable button methods
|
||||
@@ -49,31 +36,6 @@ const decimalCount = (num: Number) => {
|
||||
return 0;
|
||||
};
|
||||
|
||||
// Verify if there is a valid deposit to buy
|
||||
// const verifyLiquidity = () => {
|
||||
// enableSelectButton.value = false;
|
||||
// selectedDeposit.value = null;
|
||||
// if (!walletAddress.value || tokenValue.value <= 0) return;
|
||||
|
||||
// depositsAddedList.value.find((element) => {
|
||||
// const p2pixTokenValue = blockchain.formatBigNumber(element.args.amount);
|
||||
// if (
|
||||
// tokenValue.value!! <= Number(p2pixTokenValue) &&
|
||||
// tokenValue.value!! != 0 &&
|
||||
// element.args.seller !== walletAddress.value
|
||||
// ) {
|
||||
// enableSelectButton.value = true;
|
||||
// hasLiquidity.value = true;
|
||||
// selectedDeposit.value = element;
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// });
|
||||
|
||||
// if (!enableSelectButton.value) {
|
||||
// hasLiquidity.value = false;
|
||||
// }
|
||||
// };
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -4,9 +4,11 @@ import CustomButton from "@/components/CustomButton.vue";
|
||||
// Emits
|
||||
const emit = defineEmits(["sendNetwork"]);
|
||||
|
||||
const sendNetworkHandle = () => {
|
||||
emit("sendNetwork");
|
||||
};
|
||||
// props and store references
|
||||
const props = defineProps({
|
||||
pixKey: String,
|
||||
offer: Number,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -27,12 +29,12 @@ const sendNetworkHandle = () => {
|
||||
>
|
||||
<div>
|
||||
<p>Tokens ofertados</p>
|
||||
<p class="text-2xl text-gray-900">100 BRZ</p>
|
||||
<p class="text-2xl text-gray-900">{{ props.offer }} BRZ</p>
|
||||
</div>
|
||||
<div class="my-3">
|
||||
<p>Chave Pix</p>
|
||||
<p class="text-xl text-gray-900 break-words">
|
||||
c02942far7047f6shri5ifh371908973
|
||||
{{ props.pixKey }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
@@ -44,7 +46,7 @@ const sendNetworkHandle = () => {
|
||||
</div>
|
||||
<CustomButton
|
||||
:text="'Enviar para a rede'"
|
||||
@buttonClicked="sendNetworkHandle()"
|
||||
@buttonClicked="emit('sendNetwork')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,12 +14,6 @@ const validDecimals = ref(true);
|
||||
// Emits
|
||||
const emit = defineEmits(["approveTokens"]);
|
||||
|
||||
// Blockchain methods
|
||||
const approveTokensHandle = async () => {
|
||||
console.log(offer.value, pixKey.value);
|
||||
emit("approveTokens");
|
||||
};
|
||||
|
||||
// Debounce methods
|
||||
const handleInputEvent = (event: any) => {
|
||||
const { value } = event.target;
|
||||
@@ -106,7 +100,7 @@ const decimalCount = (num: Number) => {
|
||||
</div>
|
||||
<CustomButton
|
||||
:text="'Aprovar tokens'"
|
||||
@buttonClicked="approveTokensHandle()"
|
||||
@buttonClicked="emit('approveTokens', { offer, pixKey })"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user