complete store refactor; moved form inputs into store; refactored components out of TimedOrderEntry

This commit is contained in:
Tim Olson
2023-11-25 16:21:42 -04:00
parent c3f05deff1
commit 094108d806
13 changed files with 192 additions and 174 deletions

26
src/components/Amount.vue Normal file
View File

@@ -0,0 +1,26 @@
<template>
<v-text-field label='Amount' type="number" step="1" variant="outlined" aria-valuemin="0" min="0"
v-model="s.amount" :rules="[validateRequired,validateAmount]" v-auto-select>
<template v-slot:append-inner>
<v-btn @click="s.amountIsTokenA=!s.amountIsTokenA" variant="outlined" class="mr-2">
{{ s.amountIsTokenA ? s.tokenA.symbol : s.tokenB.symbol }}
</v-btn>
<v-btn :text="s.amountIsTotal ? 'total' : 'per tranche'" variant="outlined"
@click="s.amountIsTotal=!s.amountIsTotal" class="total"/>
</template>
</v-text-field>
</template>
<script setup>
import {useStore} from "@/store/store";
import {validateRequired, validateAmount, vAutoSelect} from "@/misc.js";
const s = useStore()
</script>
<style scoped lang="scss">
@use "src/styles/vars" as *;
</style>