Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
feat: add icon indicator for multisig wallets (#1877)
Browse files Browse the repository at this point in the history
  • Loading branch information
brenopolanski authored Apr 9, 2020
1 parent 5069a12 commit 4834c55
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 32 deletions.
11 changes: 11 additions & 0 deletions src/renderer/assets/svg/multi-signature.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 41 additions & 31 deletions src/renderer/components/Wallet/WalletGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,41 +69,51 @@
</div>
</div>

<MenuDropdown
:ref="`dropdown-${wallet.id}`"
:items="contextMenuOptions(wallet)"
:is-highlighting="false"
:position="{ x: '100%', y: '-0.5rem' }"
:container-classes="'hidden group-hover:block'"
@select="onSelectDropdown(wallet, $event)"
>
<span
slot="handler"
class="WalletGrid__wallet__select p-2 text-theme-page-text-light hover:text-theme-page-text opacity-75"
>
<SvgIcon
name="more"
view-box="0 0 5 15"
class="text-inherit"
/>
</span>
<div class="flex items-center">
<SvgIcon
v-if="wallet.multiSignature"
v-tooltip="$t('PAGES.WALLET.MULTI_SIGNATURE_WALLET')"
class="w-5 h-5 text-theme-heading-text mr-2"
name="multi-signature"
view-box="0 0 16 16"
/>

<template
slot="item"
slot-scope="itemScope"
<MenuDropdown
:ref="`dropdown-${wallet.id}`"
:items="contextMenuOptions(wallet)"
:is-highlighting="false"
:position="{ x: '100%', y: '-0.5rem' }"
:container-classes="'hidden group-hover:block'"
@select="onSelectDropdown(wallet, $event)"
>
<div class="flex items-center hidden">
<span
slot="handler"
class="WalletGrid__wallet__select p-2 text-theme-page-text-light hover:text-theme-page-text opacity-75"
>
<SvgIcon
:name="itemScope.item.icon"
view-box="0 0 16 16"
class="text-inherit flex-none mr-2"
name="more"
view-box="0 0 5 15"
class="text-inherit"
/>
<span class="font-semibold">
{{ itemScope.item.value }}
</span>
</div>
</template>
</MenuDropdown>
</span>

<template
slot="item"
slot-scope="itemScope"
>
<div class="flex items-center hidden">
<SvgIcon
:name="itemScope.item.icon"
view-box="0 0 16 16"
class="text-inherit flex-none mr-2"
/>
<span class="font-semibold">
{{ itemScope.item.value }}
</span>
</div>
</template>
</MenuDropdown>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
key="PrimaryActions"
class="WalletHeading__PrimaryActions flex items-center"
>
<SvgIcon
v-if="currentWallet.multiSignature"
v-tooltip="$t('PAGES.WALLET.MULTI_SIGNATURE_WALLET')"
class="w-5 h-5 text-theme-heading-text opacity-50"
name="multi-signature"
view-box="0 0 16 16"
/>

<button
v-tooltip="{
content: isVoting ? $t('PAGES.WALLET_SHOW.VOTING_FOR', { delegate: walletVote.username }) : $t('PAGES.WALLET_SHOW.NO_VOTE'),
Expand Down Expand Up @@ -106,6 +114,7 @@ import { ButtonDropdown, ButtonModal, ButtonReload } from '@/components/Button'
import { ModalQrCode } from '@/components/Modal'
import { TransactionModal } from '@/components/Transaction'
import { ContactRenameModal } from '@/components/Contact'
import SvgIcon from '@/components/SvgIcon'
export default {
name: 'WalletHeadingPrimaryActions',
Expand All @@ -118,7 +127,8 @@ export default {
ButtonReload,
ModalQrCode,
TransactionModal,
ContactRenameModal
ContactRenameModal,
SvgIcon
},
data () {
Expand Down
22 changes: 22 additions & 0 deletions src/renderer/components/Wallet/WalletTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@
</span>
</div>

<div
v-else-if="data.column.field === 'multisignature'"
class="flex items-center justify-center"
>
<span>
<SvgIcon
v-if="data.row.multiSignature"
v-tooltip="$t('PAGES.WALLET.MULTI_SIGNATURE_WALLET')"
class="w-5 h-5 text-theme-heading-text"
name="multi-signature"
view-box="0 0 16 16"
/>
</span>
</div>

<div
v-else-if="data.column.field === 'vote'"
>
Expand Down Expand Up @@ -176,6 +191,13 @@ export default {
thClass: !this.showVotedDelegates ? 'w-full' : '',
tdClass: !this.showVotedDelegates ? 'w-full' : ''
},
{
label: '',
field: 'multisignature',
sortable: false,
thClass: 'text-center not-sortable',
tdClass: 'text-center'
},
{
label: this.$t('PAGES.WALLET_ALL.VOTING_FOR'),
field: 'vote',
Expand Down
1 change: 1 addition & 0 deletions src/renderer/i18n/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ export default {
DELEGATES: 'Delegates',
IPFS: 'IPFS',
MULTI_SIGNATURE: 'Multisignature',
MULTI_SIGNATURE_WALLET: 'Multisignature wallet',
STATISTICS: 'Statistics',
SIGN_VERIFY: 'Sign',
PURCHASE: 'Purchase {ticker}'
Expand Down

0 comments on commit 4834c55

Please sign in to comment.