making list a component instead of a view

This commit is contained in:
RcleydsonR
2022-12-01 00:07:54 -03:00
parent 2de0f2ead6
commit 0c4ac70ef0
3 changed files with 58 additions and 13 deletions

View File

@@ -1,6 +1,17 @@
<script setup lang="ts">
import SearchComponent from "../components/SearchComponent.vue";
import blockchain from "../utils/blockchain";
import ListComponent from "@/components/ListComponent.vue";
import { ref } from "vue";
enum Step {
Search,
Buy,
List
}
const flowStep = ref<Step>(Step.Search)
const tokenAmmount = ref()
const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
// finish buy screen
@@ -10,12 +21,15 @@ const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
.mapDeposits(selectedDeposit["args"]["depositID"])
.then((deposit) => (depositDetail = deposit));
console.log(tokenValue);
tokenAmmount.value = tokenValue
flowStep.value = Step.List
console.log(depositDetail);
};
</script>
<template>
<SearchComponent @token-buy="confirmBuyClick" />
<SearchComponent v-if="(flowStep == Step.Search)" @token-buy="confirmBuyClick" />
<ListComponent v-if="(flowStep == Step.List)" :tokenAmmount="tokenAmmount" />
</template>
<style scoped></style>