Skip to content

Commit f56930f

Browse files
authored
feat: improve icon for midnight wallet (#2095)
1 parent a788d37 commit f56930f

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

v1/apps/browser-extension-wallet/src/components/MainMenu/DropdownMenuOverlay/DropdownMenuOverlay.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,7 @@
227227
.walletOptionBitcoin > div {
228228
background: var(--data-orange);
229229
}
230+
231+
.walletOptionMidnight > div {
232+
background: var(--data-bright-blue);
233+
}

v1/apps/browser-extension-wallet/src/components/MainMenu/DropdownMenuOverlay/components/UserInfo.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export const UserInfo = ({
196196
);
197197

198198
const renderLmpWallet = useCallback(
199-
({ walletIcon, walletId, walletName }: LmpBundleWallet, isLast: boolean) => (
199+
({ walletId, walletName }: LmpBundleWallet, isLast: boolean) => (
200200
<div key={walletId}>
201201
<ProfileDropdown.WalletOption
202202
style={{ textAlign: 'left' }}
@@ -206,8 +206,11 @@ export const UserInfo = ({
206206
onClick={switchToLMP}
207207
type={'hot'}
208208
profile={{
209-
fallbackText: walletName,
210-
imageSrc: walletIcon
209+
customProfileComponent: (
210+
<span className={styles.walletOptionMidnight}>
211+
<ProfileDropdown.WalletIcon type="hot" testId={'wallet-option-icon'} />
212+
</span>
213+
)
211214
}}
212215
/>
213216
{isLast ? undefined : <Separator />}

v1/apps/browser-extension-wallet/src/lib/scripts/background/services/lmpService.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ const api: BundleAppApi = {
5252
map((wallets) =>
5353
wallets.map(
5454
(wallet): LmpBundleWallet => ({
55-
// TODO: icon should be different based on wallet type (same as in v1 dropdown menu)
5655
walletIcon: isBitcoinWallet(wallet) ? bitcoinLogo : cardanoLogo,
5756
walletId: wallet.walletId,
5857
walletName: wallet.metadata.name,
59-
encryptedRecoveryPhrase: isInMemoryWallet(wallet) ? wallet.encryptedSecrets.keyMaterial : undefined
58+
encryptedRecoveryPhrase: isInMemoryWallet(wallet) ? wallet.encryptedSecrets.keyMaterial : undefined,
59+
blockchain: isBitcoinWallet(wallet) ? 'Bitcoin' : 'Cardano',
60+
walletType: wallet.type
6061
})
6162
)
6263
)

v1/apps/browser-extension-wallet/src/utils/lmp.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
// mostly duplicated in v1 and lmp module, could be a shared library
2-
import { RemoteApiProperties, RemoteApiPropertyType } from '@cardano-sdk/web-extension';
2+
import { RemoteApiProperties, RemoteApiPropertyType, WalletType } from '@cardano-sdk/web-extension';
33
import { Observable } from 'rxjs';
44
import { storage } from 'webextension-polyfill';
55
import { Language } from '@lace/translation';
66

7+
export type BlockchainName = 'Bitcoin' | 'Cardano' | 'Midnight';
8+
79
export type LmpBundleWallet = {
810
walletId: string;
911
walletName: string;
1012
walletIcon: string;
1113
encryptedRecoveryPhrase?: string;
14+
blockchain: BlockchainName;
15+
walletType: WalletType;
1216
};
1317

1418
export type BundleAppApi = {

v1/apps/browser-extension-wallet/src/views/browser-view/features/dapp/explorer/styles/themes/_shared-colors.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ $data: (
1111
'pink-10': rgba(255, 84, 112, 0.1),
1212
'orange': #ff8e3c,
1313
'green': #2cb67d,
14-
'blue': #3489f7
14+
'blue': #3489f7,
15+
'bright-blue': #0000FE
1516
);

v1/packages/common/src/ui/styles/themes/_shared-colors.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ $data: (
1212
'pink-10': rgba(255, 84, 112, 0.1),
1313
'orange': #ff8e3c,
1414
'green': #2cb67d,
15-
'blue': #3489f7
15+
'blue': #3489f7,
16+
'bright-blue': #0000FE
1617
);

0 commit comments

Comments
 (0)