-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into will/leather-rpc
- Loading branch information
Showing
15 changed files
with
155 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export function focusTabAndWindow(tabId: number | null) { | ||
chrome.tabs.update(tabId ?? 0, { active: true }, tab => { | ||
if (!tab) return; | ||
chrome.windows.update(tab.windowId, { focused: true }); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
src/app/features/current-account/current-account-displayer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Box } from 'leather-styles/jsx'; | ||
|
||
import { useAccountDisplayName } from '@app/common/hooks/account/use-account-names'; | ||
import { AccountTotalBalance } from '@app/components/account-total-balance'; | ||
import { AcccountAddresses } from '@app/components/account/account-addresses'; | ||
import { AccountListItemLayout } from '@app/components/account/account-list-item.layout'; | ||
import { AccountNameLayout } from '@app/components/account/account-name'; | ||
import { useCurrentAccountIndex } from '@app/store/accounts/account'; | ||
import { useNativeSegwitSigner } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks'; | ||
import { useStacksAccounts } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks'; | ||
import { AccountAvatarItem } from '@app/ui/components/account/account-avatar/account-avatar-item'; | ||
|
||
interface CurrentAccountDisplayerProps { | ||
onSelectAccount(): void; | ||
} | ||
export function CurrentAccountDisplayer({ onSelectAccount }: CurrentAccountDisplayerProps) { | ||
const index = useCurrentAccountIndex(); | ||
const stacksAccounts = useStacksAccounts(); | ||
const stxAddress = stacksAccounts[index]?.address || ''; | ||
const { data: name = '' } = useAccountDisplayName({ address: stxAddress, index }); | ||
const bitcoinSigner = useNativeSegwitSigner(index); | ||
const bitcoinAddress = bitcoinSigner?.(0).address || ''; | ||
return ( | ||
<AccountListItemLayout | ||
withChevron | ||
accountAddresses={<AcccountAddresses index={index} />} | ||
accountName={<AccountNameLayout isLoading={false}>{name}</AccountNameLayout>} | ||
avatar={ | ||
<AccountAvatarItem | ||
index={index} | ||
publicKey={stacksAccounts[index]?.stxPublicKey || ''} | ||
name={name} | ||
/> | ||
} | ||
balanceLabel={ | ||
// Hack to center element without adjusting AccountListItemLayout | ||
<Box pos="relative" top={12}> | ||
<AccountTotalBalance stxAddress={stxAddress} btcAddress={bitcoinAddress} /> | ||
</Box> | ||
} | ||
index={index} | ||
isLoading={false} | ||
isSelected={false} | ||
onSelectAccount={() => onSelectAccount()} | ||
/> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.