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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4144 new wallet changes #4222

Merged
merged 7 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
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
49 changes: 30 additions & 19 deletions components/common/WalletModal.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="modal-card-container">
<div class="modal-card wallet">
<header class="modal-card-head">
<header class="modal-card-head pl-2">
<b-button
v-show="hasSelectedWalletProvider"
type="is-text"
Expand Down Expand Up @@ -33,26 +33,27 @@
icon-right="chevron-right"
expanded
@click="setWallet(wallet)">
<span class="pl-4">
<span>
<b-image
:src="wallet.img"
class="is-32x32 is-inline-block"
style="vertical-align: middle"></b-image>
<span class="is-size-6">{{ wallet.name }}</span>
<span class="is-size-6 ml-2">{{ wallet.name }}</span>
</span>
</b-button>
</div>

<div
v-if="hasSelectedWalletProvider && !hasWalletProviderExtension"
class="buttons">
<div
class="wallet-name subtitle is-fullwidth is-size-6 has-text-centered is-lowercase mb-0 pt-4 pb-4">
<div class="wallet-name is-fullwidth is-size-6 is-lowercase pl-5 p-2">
<b-image
:src="selectedWalletProvider.img"
class="is-32x32 is-inline-block"
style="vertical-align: middle" />
<b class="is-white">{{ selectedWalletProvider.extensionName }}</b>
<b class="is-white ml-2">{{
selectedWalletProvider.extensionName
}}</b>
</div>
<b-button
class="is-size-6 is-height-60"
Expand Down Expand Up @@ -83,15 +84,15 @@
<b-dropdown
ref="address-chooser"
v-model="account"
:mobile-modal="false"
class="wallet-chooser">
<template #trigger>
<div
class="wallet-name subtitle is-size-6 has-text-centered is-lowercase mb-0 pt-4 pb-4">
<div class="wallet-name is-size-6 is-lowercase pl-5 p-2">
<b-image
:src="selectedWalletProvider.img"
class="is-32x32 is-inline-block"
style="vertical-align: middle" />
<b class="is-white">{{
<b class="is-white ml-2">{{
selectedWalletProvider.extensionName
}}</b>
<!-- <b-icon style="color: white" icon="chevron-down"></b-icon>-->
Expand All @@ -100,6 +101,7 @@
<b-dropdown-item
v-for="option in walletAccounts"
:key="option.address"
class="p-2 pl-5 pr-5"
:value="option.address">
<span v-if="option.name"
>{{ option.name }}
Expand Down Expand Up @@ -247,6 +249,8 @@ export default class WalletModal extends mixins(UseApiMixin, ChainMixin) {
font-family: 'Work Sans';
font-style: normal;
position: relative;
border: 1px solid $k-dark;

.wallet {
max-width: 280px;
.wallet-chooser {
Expand All @@ -259,19 +263,18 @@ export default class WalletModal extends mixins(UseApiMixin, ChainMixin) {
.dropdown-content {
box-shadow: none;
padding-top: 0px;
border: none;
a {
padding: 0.375rem 1rem;
height: 29px;
&:hover {
background-color: $k-accentlight2;
}
}
}
}
}

.subtitle {
background-color: #000000;
}
&.modal-card {
background: #1f1f1f;
background: $k-dark;
backdrop-filter: $frosted-glass-light-backdrop-filter;
//position: relative;
z-index: 1;
Expand All @@ -288,7 +291,7 @@ export default class WalletModal extends mixins(UseApiMixin, ChainMixin) {
.modal-card-head {
background: unset;
border-bottom: 1px solid #000000;
//font-size: 1rem;
padding: 8px 32px;

.delete {
height: 40px;
Expand All @@ -314,18 +317,26 @@ export default class WalletModal extends mixins(UseApiMixin, ChainMixin) {
border: 0;
border-radius: 0;
justify-content: space-between;
background-color: #ffffff;
font-weight: 600;
border-bottom: 1px solid #000000;
background-color: $white;
border-bottom: 1px solid $k-dark;
margin-bottom: 0;
height: 60px;
padding: 8px 32px;

&:hover {
background-color: $k-accentlight2;
}
}

a {
border-bottom: 1px solid #000000;
margin-bottom: 0;
}
}

.wallet-name {
background: $k-dark;
}
}

.modal-card-bg {
Expand Down
10 changes: 10 additions & 0 deletions styles/themes/_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ html.dark-mode {
background: $k-dark !important;
border: 1px solid $white;
border-radius: unset;

&:hover {
background-color: $k-accentlight2dark!important;
}
}
}
.modal-card-bg {
Expand All @@ -242,6 +246,12 @@ html.dark-mode {
color: $background-dark !important;
}
}
.dropdown-content .dropdown-item {
&:hover {
background-color: $k-accentlight2dark!important;
}
}

}

.image-outline {
Expand Down
7 changes: 6 additions & 1 deletion utils/config/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@ export const SupportedWallets = () => {
}
const allWallets = createWalletInstanceList(PCWalletExtensionList)
const wallets = allWallets.filter((wallet) => wallet.installed)
return wallets.length > 0 ? wallets : allWallets
const sourceIds = new Set(wallets.map((d) => d.source))
const allWalletsUpdates = [
...wallets,
...allWallets.filter((d) => !sourceIds.has(d.source)),
]
return allWalletsUpdates
}

export function getWalletBySource(
Expand Down