Skip to content

Commit f56be7d

Browse files
committed
feat: new transaction detail page, reuse the DetailCard and
`DetailRow` components across the transaction detail and send review, new send details design
1 parent d0494ce commit f56be7d

File tree

21 files changed

+572
-522
lines changed

21 files changed

+572
-522
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"fast-deep-equal": "3.1.3",
114114
"file-loader": "6.0.0",
115115
"fontfaceobserver": "2.1.0",
116-
"framer-motion": "^12.9.2",
116+
"framer-motion": "^12.35.2",
117117
"fuse.js": "6.4.6",
118118
"i18next": "^23.11.5",
119119
"i18next-browser-languagedetector": "^8.0.0",

public/_locales/en/en.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,5 +600,13 @@
600600
"fungible": "Fungible",
601601
"network": "Network",
602602
"recentActivity": "Recent Activity",
603-
"type": "Type"
603+
"type": "Type",
604+
"txIdLabel": "Tx ID",
605+
"notesSection": "Notes",
606+
"created": "Created",
607+
"confirmed": "Confirmed",
608+
"date": "Date",
609+
"details": "Details",
610+
"addANote": "Add a note",
611+
"advancedOptions": "Advanced Options"
604612
}

src/app/ConfirmPage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,12 @@ const ConfirmDAppForm: FC = () => {
839839
<div className="flex-1" />
840840

841841
<div
842-
className={classNames('sticky bottom-0 w-full', 'bg-surface-solid shadow-md', 'flex items-stretch', 'px-4 pt-2 pb-6')}
842+
className={classNames(
843+
'sticky bottom-0 w-full',
844+
'bg-surface-solid shadow-md',
845+
'flex items-stretch',
846+
'px-4 pt-2 pb-6'
847+
)}
843848
>
844849
<div className="w-1/2 pr-2">
845850
<Button

src/app/layouts/PageLayout/ChangelogOverlay/ChangelogOverlay.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const ChangelogOverlay: FC = () => {
3535

3636
return lastShownVersion !== currentVersion ? (
3737
<>
38-
<div className={'fixed inset-0 bg-pure-white/10 dark:bg-pure-black/50 backdrop-blur-xl backdrop-saturate-150 z-50'}></div>
38+
<div
39+
className={'fixed inset-0 bg-pure-white/10 dark:bg-pure-black/50 backdrop-blur-xl backdrop-saturate-150 z-50'}
40+
></div>
3941
<ContentContainer className={classNames('fixed z-50', 'max-h-full', popupClassName)} padding={!popup}>
4042
<div
4143
className={classNames(

src/app/pages/Faucet.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ const Faucet: FC = () => {
7272
</div>
7373
<div className="flex flex-col gap-y-4">
7474
<Button onClick={openFaucet}>
75-
<span className="text-base font-medium text-pure-white">{copied ? t('copiedAddress') : t('goToFaucet')}</span>
75+
<span className="text-base font-medium text-pure-white">
76+
{copied ? t('copiedAddress') : t('goToFaucet')}
77+
</span>
7678
</Button>
7779
</div>
7880
</div>

src/app/templates/AddressChip.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Icon, IconName } from 'app/icons/v2';
77
type AddressChipProps = HTMLAttributes<HTMLButtonElement> &
88
ComponentProps<typeof AddressShortView> &
99
Pick<ComponentProps<typeof Icon>, 'size' | 'fill' | 'className'> &
10-
Pick<CopyButtonProps, 'small' | 'type' | 'bgShade' | 'rounded' | 'textShade'>;
10+
Pick<CopyButtonProps, 'small' | 'type' | 'bgShade' | 'rounded' | 'textShade'> & { copyIcon?: boolean };
1111

1212
const AddressChip: FC<AddressChipProps> = ({
1313
address,
@@ -16,14 +16,15 @@ const AddressChip: FC<AddressChipProps> = ({
1616
type = 'button',
1717
size = 'xs',
1818
className = 'ml-4',
19+
copyIcon = true,
1920
...rest
2021
}) => (
2122
<CopyButton text={address} type={type} {...rest} className="p-0!">
2223
<span className="flex flex-row items-center">
2324
<span className="mr-1 break-all text-heading-gray text-xs leading-none font-medium opacity-64">
2425
<AddressShortView address={address} displayName={displayName} trim={trim} />
2526
</span>
26-
<Icon name={IconName.Copy} size={size} className={className} />
27+
{copyIcon && <Icon name={IconName.Copy} size={size} className={className} />}
2728
</span>
2829
</CopyButton>
2930
);

src/app/templates/HashChip.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Icon, IconName } from 'app/icons/v2';
77
type HashChipProps = HTMLAttributes<HTMLButtonElement> &
88
ComponentProps<typeof HashShortView> &
99
Pick<ComponentProps<typeof Icon>, 'size' | 'fill' | 'className'> &
10-
Pick<CopyButtonProps, 'small' | 'type' | 'bgShade' | 'rounded' | 'textShade'>;
10+
Pick<CopyButtonProps, 'small' | 'type' | 'bgShade' | 'rounded' | 'textShade'> & { copyIcon?: boolean };
1111

1212
const HashChip: FC<HashChipProps> = ({
1313
hash,
@@ -19,6 +19,7 @@ const HashChip: FC<HashChipProps> = ({
1919
type = 'button',
2020
size = 'xs',
2121
fill = 'black',
22+
copyIcon = true,
2223
...rest
2324
}) => (
2425
<CopyButton text={hash} type={type} {...rest}>
@@ -31,7 +32,7 @@ const HashChip: FC<HashChipProps> = ({
3132
lastCharsCount={lastCharsCount}
3233
displayName={displayName}
3334
/>
34-
<Icon name={IconName.Copy} size={size} fill={fill} />
35+
{copyIcon && <Icon name={IconName.Copy} size={size} fill={fill} />}
3536
</span>
3637
</CopyButton>
3738
);
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React, { FC, memo } from 'react';
2+
3+
import classNames from 'clsx';
4+
import { useTranslation } from 'react-i18next';
5+
6+
import { Icon, IconName } from 'app/icons/v2';
7+
8+
import { isCompletedTransaction } from './transactionUtils';
9+
10+
export { DetailCard, DetailRow } from 'lib/ui/DetailCard';
11+
12+
export const ExternalLinkValue: FC<{
13+
displayValue: React.ReactNode;
14+
href: string;
15+
}> = ({ displayValue, href }) => (
16+
<div className="flex items-center gap-1 text-sm text-heading-gray font-medium">
17+
{displayValue}
18+
<a href={href} target="_blank" rel="noreferrer">
19+
<Icon name={IconName.ArrowRightUp} size="xs" fill="#9E9E9E" />
20+
</a>
21+
</div>
22+
);
23+
24+
export const StatusPill: FC<{ message: string }> = memo(({ message }) => {
25+
const { t } = useTranslation();
26+
const isCompleted = isCompletedTransaction(message);
27+
28+
const dotColor = isCompleted ? 'bg-[#1A9C52]' : 'bg-blue-500';
29+
const textColor = isCompleted ? 'text-[#1A9C52]' : 'text-blue-500';
30+
const label = isCompleted ? t('confirmed') : t('inProgress');
31+
32+
return (
33+
<div className="flex items-center gap-1 px-4 py-2 rounded-5 bg-white">
34+
<div className={classNames('w-2 h-2 rounded-full', dotColor)} />
35+
<span className={classNames('text-[10px] font-medium text-heading-gray', textColor)}>{label}</span>
36+
</div>
37+
);
38+
});

src/app/templates/history/History.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,13 @@ async function fetchTransactionsAsHistoryEntries(
137137
message: updateMessageForFailed,
138138
type: HistoryEntryType.CompletedTransaction,
139139
transactionIcon: icon,
140-
amount: tx.amount ? formatAmount(tx.amount, tx.type, tokenMetadata?.decimals) : undefined,
140+
amount: tx.amount ? formatAmount(tx.amount, tokenMetadata?.decimals) : undefined,
141141
token: tokenMetadata ? tokenMetadata.symbol : undefined,
142142
secondaryAddress: tx.secondaryAccountId,
143143
txId: tx.id,
144144
noteType: tx.noteType,
145-
faucetId: tx.faucetId
145+
faucetId: tx.faucetId,
146+
txType: tx.type
146147
} as IHistoryEntry;
147148

148149
return entry;
@@ -166,13 +167,14 @@ async function fetchPendingTransactionsAsHistoryEntries(address: string, tokenId
166167
secondaryMessage: formatTransactionStatus(tx.status),
167168
timestamp: tx.initiatedAt,
168169
message: tx.displayMessage || 'Generating transaction',
169-
amount: tx.amount ? formatAmount(tx.amount, tx.type, tokenMetadata?.decimals) : undefined,
170+
amount: tx.amount ? formatAmount(tx.amount, tokenMetadata?.decimals) : undefined,
170171
token: tokenMetadata ? tokenMetadata.symbol : undefined,
171172
secondaryAddress: tx.secondaryAccountId,
172173
txId: tx.id,
173174
type: entryType,
174175
noteType: tx.noteType,
175-
faucetId: tx.faucetId
176+
faucetId: tx.faucetId,
177+
txType: tx.type
176178
} as IHistoryEntry;
177179
});
178180
const entries = await Promise.all(entryPromises);

0 commit comments

Comments
 (0)