@@ -1,6 +1,6 @@
1import React, { useState } from 'react';
1import React, { useState } from 'react';
2import * as ob from 'urbit-ob';
2import * as ob from 'urbit-ob';
3−import { Icon, Row } from '@tlon/indigo-react';
3+import { Icon, Row, Box } from '@tlon/indigo-react';
4import { Just } from 'folktale/maybe';
4import { Just } from 'folktale/maybe';
6import Sigil from 'components/Sigil';
6import Sigil from 'components/Sigil';
@@ -14,6 +14,7 @@ import CopiableAddressWrap from 'components/copiable/CopiableAddressWrap';
14import Dropdown from './Dropdown';
14import Dropdown from './Dropdown';
16import './AccountsDropdown.scss';
16import './AccountsDropdown.scss';
17+import { abbreviateAddress } from 'lib/utils/address';
18const AccountsDropdown = () => {
19const AccountsDropdown = () => {
19 const [open, setOpen] = useState<boolean>(false);
20 const [open, setOpen] = useState<boolean>(false);
@@ -30,8 +31,7 @@ const AccountsDropdown = () => {
32 const currentAddress = walletInfo?.wallet?.value?.address || '';
33 const currentAddress = walletInfo?.wallet?.value?.address || '';
33− const addressLeadingFive = currentAddress.slice(0, 5);
34+ const displayAddress = abbreviateAddress(currentAddress);
34− const displayAddress = `${addressLeadingFive}...${currentAddress.slice(-4)}`;
36 const selectPoint = (point: number) => () => {
36 const selectPoint = (point: number) => () => {
37 setPointCursor(Just(point));
37 setPointCursor(Just(point));
@@ -49,13 +49,13 @@ const AccountsDropdown = () => {
50 className="accounts-dropdown"
50 className="accounts-dropdown"
51 open={open}
51 open={open}
52− value={addressLeadingFive}
52+ value={displayAddress}
53 toggleOpen={() => setOpen(!open)}>
53 toggleOpen={() => setOpen(!open)}>
54 <CopiableAddressWrap className="current-address">
54 <CopiableAddressWrap className="current-address">
55 {displayAddress}
55 {displayAddress}
56 </CopiableAddressWrap>
56 </CopiableAddressWrap>
57− <div className="divider" />
57+ <Box className="divider" />
58− <div className="points">
58+ <Box className="points">
59 {points.map((point: number) => {
59 {points.map((point: number) => {
60 const patp = ob.patp(point);
60 const patp = ob.patp(point);
@@ -64,20 +64,20 @@ const AccountsDropdown = () => {
64 className="entry"
64 className="entry"
65 onClick={selectPoint(point)}
65 onClick={selectPoint(point)}
66 key={`point-${point}`}>
66 key={`point-${point}`}>
67− <div>{patp}</div>
67+ <Box>{patp}</Box>
69 <LayerIndicator layer={1} size="md" />
69 <LayerIndicator layer={1} size="md" />
70− <div className="sigil">
70+ <Box className="sigil">
71 <Sigil patp={patp} size={1} colors={['#000000', '#FFFFFF']} />
71 <Sigil patp={patp} size={1} colors={['#000000', '#FFFFFF']} />
78− <div className="divider" />
78+ <Box className="divider" />
79 <Row className="entry" onClick={goToMigrate}>
79 <Row className="entry" onClick={goToMigrate}>
80− <div>Migrate</div>
80+ <Box>Migrate</Box>
81 <Row className="layer-migration">
81 <Row className="layer-migration">
82 <LayerIndicator layer={1} size="sm" />
82 <LayerIndicator layer={1} size="sm" />
83 <Icon icon="ArrowEast" />
83 <Icon icon="ArrowEast" />
@@ -86,12 +86,12 @@ const AccountsDropdown = () => {
87 {canBitcoin && (
87 {canBitcoin && (
88 <Row className="entry" onClick={goToBitcoin}>
88 <Row className="entry" onClick={goToBitcoin}>
89− <div>Bitcoin</div>
89+ <Box>Bitcoin</Box>
90 <Icon icon="Bitcoin" />
90 <Icon icon="Bitcoin" />
93 <Row className="entry" onClick={onLogout}>
93 <Row className="entry" onClick={onLogout}>
94− <div>Logout</div>
94+ <Box>Logout</Box>
95 <Icon icon="LogOut" />
95 <Icon icon="LogOut" />
97 </Dropdown>
97 </Dropdown>