Skip to content

Commit 9f57b5c

Browse files
committed
fix: be able to set slippage
1 parent d05e366 commit 9f57b5c

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

src/components/ActionsMenu.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<template>
2-
<div
3-
class="actions-menu"
4-
:class="{ active: showMenu }"
5-
@click="showMenu = true"
6-
@keydown="showMenu = true"
7-
>
2+
<div class="actions-menu" :class="{ active: showMenu }" @click="handleOpen" @keydown="handleOpen">
83
<slot name="display" />
94
<SmallModal v-if="showMenu" @close="showMenu = false">
105
<slot />
@@ -19,11 +14,18 @@ export default {
1914
components: {
2015
SmallModal,
2116
},
17+
emits: ['open'],
2218
data() {
2319
return {
2420
showMenu: false,
2521
};
2622
},
23+
methods: {
24+
handleOpen() {
25+
if (!this.showMenu) this.$emit('open');
26+
this.showMenu = true;
27+
},
28+
},
2729
};
2830
</script>
2931

src/components/InputAmount.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<template>
22
<div class="input-amount">
33
<slot name="left" />
4-
<InputField type="number" v-bind="$attrs" @input="$emit('input', $event)" />
4+
<InputField
5+
type="number"
6+
:value="value"
7+
v-bind="$attrs"
8+
@update:value="$emit('update:value', $event)"
9+
/>
510
<slot name="right" />
611
</div>
712
</template>
@@ -13,7 +18,10 @@ export default {
1318
components: {
1419
InputField,
1520
},
16-
emits: ['input'],
21+
props: {
22+
value: { type: [String, Number], default: '' },
23+
},
24+
emits: ['update:value'],
1725
};
1826
</script>
1927

src/components/MainWrapper.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<div class="title">
1010
{{ title }}
1111
</div>
12-
<div class="right" @click="settingsClickHandler" @keydown="settingsClickHandler">
13-
<ActionsMenu v-if="settings">
12+
<div class="right">
13+
<ActionsMenu v-if="settings" @open="settingsClickHandler">
1414
<template #display>
1515
<Cog />
1616
</template>

0 commit comments

Comments
 (0)