Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: address selector showing invalid identicon when address is empty #311

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: address selector showing invlid identicon when address is empty
hsurf22 committed Sep 29, 2022
commit e53c161ea2e433b9cd1948aaf1763094856e8e05
27 changes: 17 additions & 10 deletions src/components/MewAddressSelect/MewAddressSelect.vue
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
<!-- ===================================================================================== -->
<template #prepend-inner>
<div
v-if="!isValidAddress"
v-if="!isValidAddress || !blockieHash"
class="blockie-placeholder mr-1 selectHover"
/>
<mew-blockie
@@ -87,9 +87,7 @@
class="dropdown-icon-container d-flex align-center justify-center cursor-pointer full-height"
@click="toggle"
>
<v-icon class="mew-heading-1 mx-5">
mdi-chevron-down
</v-icon>
<v-icon class="mew-heading-1 mx-5"> mdi-chevron-down </v-icon>
</div>
</template>

@@ -115,10 +113,7 @@
v-if="!item.resolvedAddr || item.resolvedAddr === ''"
:hash="item.address"
/>
<span
v-else
class="mew-address"
>{{ item.address }}</span>
<span v-else class="mew-address">{{ item.address }}</span>
</div>
<div class="overline primary--text font-weight-medium ml-3">
{{ item.nickname }}
@@ -255,6 +250,13 @@ export default {
errorMessages: {
type: [String, Array],
default: ''
},
/**
* Clear address
*/
clearAddress: {
type: Boolean,
default: false
}
},
data() {
@@ -287,10 +289,15 @@ export default {
: this.addressValue.address || this.addressValue;
}
},
watch: {
clearAddress() {
this.clear();
}
},
methods: {
/**
* Clears the v-model value.
*/
* Clears the v-model value.
*/
clear() {
this.addressValue = '';
},
15 changes: 4 additions & 11 deletions src/components/MewBlockie/MewBlockie.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div>
<div
v-show="address"
style="position: relative"
:style="`width: ${width}; height: ${height}`"
>
@@ -9,24 +10,16 @@
:src="blockieImg"
alt="Blockie Image"
style="display: block; border-radius: 50%"
>
/>

<!--
=====================================================================
Inset shadow on edge of blockie image
=====================================================================
-->
<div
v-if="!flat"
class="inset-shadow"
/>
<div v-if="!flat" class="inset-shadow" />
</div>
<img
v-if="currency"
alt="icon"
class="currency-icon"
:src="currency"
>
<img v-if="currency" alt="icon" class="currency-icon" :src="currency" />
</div>
</template>