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
*.sw?
.vercel
.env

View File

@ -32,7 +32,7 @@ const handleInputEvent = (event: any) => {
};
const validatePix = async (e2eid: any) => {
if(e2eid == ''){
if (e2eid == "") {
isPixValid.value = false;
isCodeInputEmpty.value = true;
return;
@ -40,7 +40,7 @@ const validatePix = async (e2eid: any) => {
var sellerPixKey = props.pixTarget;
var transactionValue = props.tokenValue;
if(sellerPixKey && transactionValue){
if (sellerPixKey && transactionValue) {
var body_req = {
e2e_id: e2eid,
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"
/>
<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">
<img
alt="Invalid Icon"

View File

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

View File

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

View File

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