1
1
<script setup lang="ts">
2
- import { Ref , computed , ref , watch } from ' vue'
2
+ import { ConnectOptions , ConnectorName , isMobileBrowser , useAutoConnect , useVueDapp } from ' @vue-dapp/core'
3
+ import { Ref , computed , watch } from ' vue'
3
4
import Modal from ' ./components/Modal.vue'
4
5
import WalletConnectIcon from ' ./components/logos/WalletConnectIcon.vue'
5
- import { useVueDapp , useAutoConnect , ConnectorName , ConnectOptions , isMobileBrowser } from ' @vue-dapp/core'
6
6
import { useVueDappModal } from ' ./store'
7
7
8
8
const props = withDefaults (
@@ -115,36 +115,24 @@ const vClickOutside = {
115
115
},
116
116
}
117
117
118
- const columnAmount = computed (() => {
119
- let total = providerDetails .value .length
120
- if (hasConnector (' WalletConnect' )) total ++
121
- if (hasConnector (' CoinbaseWallet' )) total ++
122
- if (total < 2 ) return 1
123
- return 2
124
- })
118
+ // const columnAmount = computed(() => {
119
+ // let total = providerDetails.value.length
120
+ // if (hasConnector('WalletConnect')) total++
121
+ // if (hasConnector('CoinbaseWallet')) total++
122
+ // if (total < 2) return 1
123
+ // return 2
124
+ // })
125
125
126
- const isOneColumn = computed (() => columnAmount .value === 1 )
126
+ // const isOneColumn = computed(() => columnAmount.value === 1)
127
127
const isNoWalletFound = computed (
128
128
() => providerDetails .value .length === 0 && ! hasConnector (' WalletConnect' ) && ! hasConnector (' CoinbaseWallet' ),
129
129
)
130
-
131
- const vdModalPadding = computed (() => {
132
- if (isOneColumn .value ) return ' 10px 10px'
133
- return ' 15px 15px'
134
- })
135
130
</script >
136
131
137
132
<template >
138
133
<div >
139
134
<Modal :modalOpen =" modalOpen" @close =" closeModal" :dark =" dark" >
140
- <div
141
- id =" vd-modal"
142
- class =" vd-modal-column"
143
- :style =" {
144
- padding: vdModalPadding,
145
- }"
146
- v-click-outside =" closeModal"
147
- >
135
+ <div id =" vd-modal" class =" vd-modal-column" v-click-outside =" closeModal" >
148
136
<div
149
137
v-for =" detail in providerDetails"
150
138
:key =" detail.info.uuid"
@@ -193,7 +181,7 @@ const vdModalPadding = computed(() => {
193
181
</div >
194
182
195
183
<slot v-if =" isNoWalletFound && $slots['no-wallet-found']" name =" no-wallet-found" ></slot >
196
- <div id =" vd-no-wallet-found" v-else-if =" isNoWalletFound" >No wallet provider found 😔 </div >
184
+ <div id =" vd-no-wallet-found" v-else-if =" isNoWalletFound" >No wallet provider found. </div >
197
185
</div >
198
186
</Modal >
199
187
@@ -218,20 +206,21 @@ const vdModalPadding = computed(() => {
218
206
219
207
<style scoped>
220
208
#vd-modal {
221
- display : grid ;
222
- gap : 5px ;
209
+ display : flex ;
210
+ flex-direction : column ;
211
+ gap : 0px ;
223
212
height : auto ;
213
+ min-height : 150px ;
214
+ padding : 20px 15px ;
224
215
}
225
216
226
217
#vd-modal .vd-modal-column {
227
- grid-template-columns : repeat (2 , minmax (0 , 1fr ));
228
- width : 450px ;
218
+ width : 320px ;
229
219
}
230
220
231
- @media (max-width : 550 px ) {
221
+ @media (max-width : 320 px ) {
232
222
#vd-modal .vd-modal-column {
233
- grid-template-columns : repeat (1 , minmax (0 , 1fr ));
234
- width : 100% ;
223
+ width : 80vw ;
235
224
}
236
225
}
237
226
0 commit comments