add an .env.example file and fix lint warnings

This commit is contained in:
RcleydsonR 2022-12-12 17:05:50 -03:00
parent dbfeb7017f
commit 5f753a62ca
6 changed files with 18 additions and 13 deletions

1
.env.example Normal file
View File

@ -0,0 +1 @@
VITE_API_URL=http://localhost:8000/

2
.gitignore vendored
View File

@ -27,3 +27,5 @@ coverage
*.sln *.sln
*.sw? *.sw?
.vercel .vercel
.env

View File

@ -32,7 +32,7 @@ const handleInputEvent = (event: any) => {
}; };
const validatePix = async (e2eid: any) => { const validatePix = async (e2eid: any) => {
if(e2eid == ''){ if (e2eid == "") {
isPixValid.value = false; isPixValid.value = false;
isCodeInputEmpty.value = true; isCodeInputEmpty.value = true;
return; return;
@ -40,7 +40,7 @@ const validatePix = async (e2eid: any) => {
var sellerPixKey = props.pixTarget; var sellerPixKey = props.pixTarget;
var transactionValue = props.tokenValue; var transactionValue = props.tokenValue;
if(sellerPixKey && transactionValue){ if (sellerPixKey && transactionValue) {
var body_req = { var body_req = {
e2e_id: e2eid, e2e_id: e2eid,
pix_key: sellerPixKey, pix_key: sellerPixKey,
@ -108,7 +108,10 @@ const validatePix = async (e2eid: any) => {
class="text-md w-full box-border p-2 h-6 mb-2 outline-none" class="text-md w-full box-border p-2 h-6 mb-2 outline-none"
/> />
<div class="custom-divide" v-if="!isCodeInputEmpty"></div> <div class="custom-divide" v-if="!isCodeInputEmpty"></div>
<div class="flex flex-col w-full" v-if="!isPixValid && !isCodeInputEmpty"> <div
class="flex flex-col w-full"
v-if="!isPixValid && !isCodeInputEmpty"
>
<div class="flex items-center h-8"> <div class="flex items-center h-8">
<img <img
alt="Invalid Icon" alt="Invalid Icon"

View File

@ -1,6 +1,4 @@
<script setup lang="ts"> <script setup lang="ts"></script>
</script>
<template> <template>
<div class="page"> <div class="page">
<div class="text-container"> <div class="text-container">

View File

@ -8,7 +8,7 @@ const defaultConfig = {
const api = axios.create({ const api = axios.create({
...defaultConfig, ...defaultConfig,
baseURL: import.meta.env.VITE_BASE_URL, baseURL: import.meta.env.VITE_API_URL,
}); });
export default api; export default api;

View File

@ -32,8 +32,6 @@ const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
await blockchain await blockchain
.mapDeposits(depositId) .mapDeposits(depositId)
.then((deposit) => (depositDetail = deposit)); .then((deposit) => (depositDetail = deposit));
console.log(tokenValue);
console.log('aqui', depositDetail);
tokens.value = tokenValue; tokens.value = tokenValue;
pixTarget.value = depositDetail?.pixTarget; pixTarget.value = depositDetail?.pixTarget;
@ -42,7 +40,7 @@ const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
flowStep.value = Step.Buy; flowStep.value = Step.Buy;
etherStore.setLoadingLock(true); etherStore.setLoadingLock(true);
await blockchain.addLock(depositId, tokenValue).catch((_error) => { await blockchain.addLock(depositId, tokenValue).catch(() => {
flowStep.value = Step.Search; flowStep.value = Step.Search;
}); });
@ -67,14 +65,17 @@ const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
</script> </script>
<template> <template>
<SearchComponent v-if="(flowStep == Step.Search)" @token-buy="confirmBuyClick" /> <SearchComponent
<div v-if="(flowStep == Step.Buy)"> v-if="flowStep == Step.Search"
@token-buy="confirmBuyClick"
/>
<div v-if="flowStep == Step.Buy">
<QrCodeComponent <QrCodeComponent
:pixTarget="pixTarget" :pixTarget="pixTarget"
:tokenValue="tokens" :tokenValue="tokens"
v-if="!loadingLock" v-if="!loadingLock"
/> />
<ValidationComponent v-if="loadingLock"/> <ValidationComponent v-if="loadingLock" />
</div> </div>
</template> </template>