Skip to content

Commit

Permalink
Allow disabling addresses in AddressList
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed May 19, 2022
1 parent afdf59c commit b1c3ad0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/AddressList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
:addressInfo="addressInfo"
:class="{ 'active': activeAddress === addressInfo.address && activeCurrency === CryptoCurrency.NIM }"
@click="selectAddress(addressInfo.address);"
:ref="`address-button-${addressInfo.address}`"/>
:ref="`address-button-${addressInfo.address}`"
:disabled="requiredBalance > (addressInfo.balance || 0)"/>
<button
v-if="showAddAddressButton"
class="address-button add-address-button reset flex-row"
Expand Down Expand Up @@ -61,6 +62,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
requiredBalance: {
type: Number,
default: 0, // enables all addresses
},
},
setup(props, context) {
const { addressInfos, activeAddress, selectAddress } = useAddressStore();
Expand Down
4 changes: 4 additions & 0 deletions src/components/AddressListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export default defineComponent({
align-items: center;
padding: 2rem;
border-radius: 0.75rem;
&:disabled {
opacity: 0.4;
}
}
.identicon,
Expand Down

0 comments on commit b1c3ad0

Please sign in to comment.