Skip to content

Commit 8653132

Browse files
authored
Merge pull request #2029 from oasisprotocol/lw/more-adaptive
Inline copy button next to more account links using AdaptiveTrimmer
2 parents 0c8e931 + b4e5926 commit 8653132

File tree

4 files changed

+46
-30
lines changed

4 files changed

+46
-30
lines changed

.changelog/2029.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Inline copy button next to some account links using AdaptiveTrimmer

src/app/components/Account/ConsensusAccountDetailsView.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ export const ConsensusAccountDetailsView: FC<ConsensusAccountDetailsViewProps> =
6161
</Box>
6262
</StyledListTitleWithAvatar>
6363
<dd>
64-
<ConsensusAccountLink
65-
alwaysTrim={false}
66-
network={account.network}
67-
address={account.address}
68-
highlightPattern={highlightPattern}
69-
/>
70-
<CopyToClipboard value={account.address} />
64+
<Box sx={{ display: 'inline-flex', alignItems: 'center' }}>
65+
<ConsensusAccountLink
66+
alwaysTrim={false}
67+
network={account.network}
68+
address={account.address}
69+
highlightPattern={highlightPattern}
70+
/>
71+
<CopyToClipboard value={account.address} />
72+
</Box>
7173
</dd>
7274
<dt>
7375
<strong>{t('account.totalBalance')}</strong>

src/app/pages/ConsensusTransactionDetailPage/index.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { getFiatCurrencyForScope } from '../../../config'
2626
import { useWantedTransaction } from '../../hooks/useWantedTransaction'
2727
import { MultipleTransactionsWarning } from '../../components/Transactions/MultipleTransactionsWarning'
2828
import { DashboardLink } from '../ParatimeDashboardPage/DashboardLink'
29+
import Box from '@mui/material/Box'
2930

3031
const StyledDescriptionDetails = styled('dd')({
3132
'&&': { padding: 0 },
@@ -120,15 +121,27 @@ export const ConsensusTransactionDetailView: FC<{
120121
</dd>
121122
<dt>{t('common.from')}</dt>
122123
<dd>
123-
<ConsensusAccountLink network={transaction.network} address={transaction.sender} alwaysTrim={false} />
124-
<CopyToClipboard value={transaction.sender} />
124+
<Box sx={{ display: 'inline-flex', alignItems: 'center' }}>
125+
<ConsensusAccountLink
126+
network={transaction.network}
127+
address={transaction.sender}
128+
alwaysTrim={false}
129+
/>
130+
<CopyToClipboard value={transaction.sender} />
131+
</Box>
125132
</dd>
126133
{transaction.to && (
127134
<>
128135
<dt>{t('common.to')}</dt>
129136
<dd>
130-
<ConsensusAccountLink network={transaction.network} address={transaction.to} alwaysTrim={false} />
131-
<CopyToClipboard value={transaction.to} />
137+
<Box sx={{ display: 'inline-flex', alignItems: 'center' }}>
138+
<ConsensusAccountLink
139+
network={transaction.network}
140+
address={transaction.to}
141+
alwaysTrim={false}
142+
/>
143+
<CopyToClipboard value={transaction.to} />
144+
</Box>
132145
</dd>
133146
</>
134147
)}

src/app/pages/ValidatorDetailsPage/ValidatorTitleCard.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ export const ValidatorTitleCard: FC<ValidatorTitleCardProps> = ({
3434
{validator && (
3535
<Box sx={{ display: 'flex' }}>
3636
<ValidatorStatusBadge active={validator.active} inValidatorSet={validator?.in_validator_set} />
37-
<Box sx={{ paddingLeft: 4 }}>
38-
<AccountLink
39-
scope={{ network, layer: 'consensus' }}
40-
address={validator.entity_address}
41-
showOnlyAddress
42-
/>
43-
</Box>
37+
&nbsp;&nbsp;&nbsp;
38+
<AccountLink
39+
scope={{ network, layer: 'consensus' }}
40+
address={validator.entity_address}
41+
showOnlyAddress
42+
/>
4443
<CopyToClipboard value={validator.entity_address} />
4544
</Box>
4645
)}
@@ -51,29 +50,30 @@ export const ValidatorTitleCard: FC<ValidatorTitleCardProps> = ({
5150
<>
5251
{validator && (
5352
<>
54-
<Box sx={{ display: 'flex', alignItems: 'center' }} gap={4}>
53+
<Box sx={{ display: 'flex', alignItems: 'center' }}>
5554
<ValidatorImage
5655
address={validator.entity_address}
5756
name={validator.media?.name}
5857
logotype={validator.media?.logoUrl}
5958
/>
59+
&nbsp;&nbsp;
6060
{isTablet ? (
6161
<AdaptiveHighlightedText text={validator?.media?.name} pattern={highlightPattern} />
6262
) : (
6363
<HighlightedText text={validator?.media?.name} pattern={highlightPattern} />
6464
)}
65+
&nbsp;
66+
<Typography
67+
component="span"
68+
sx={{
69+
color: COLORS.grayMedium,
70+
fontSize: '24px',
71+
fontWeight: 400,
72+
}}
73+
>
74+
({validator.rank})
75+
</Typography>
6576
</Box>
66-
&nbsp;
67-
<Typography
68-
component="span"
69-
sx={{
70-
color: COLORS.grayMedium,
71-
fontSize: '24px',
72-
fontWeight: 400,
73-
}}
74-
>
75-
({validator.rank})
76-
</Typography>
7777
</>
7878
)}
7979
</>

0 commit comments

Comments
 (0)