Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/components/common/table-columns/EXTRINSIC_COLUMNS.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { createColumnHelper } from '@tanstack/react-table';

import { Badge } from '@/components/ui/badge';
import { AccountAddressCell } from '@/components/ui/composites/account-address-cell/AccountAddressCell';
import { LinkWithCopy } from '@/components/ui/composites/link-with-copy/LinkWithCopy';
import { TimestampDisplay } from '@/components/ui/timestamp-display';
Expand Down Expand Up @@ -91,21 +90,6 @@ export const createExtrinsicColumns = () => {
enableSorting: false
}),

// Success column
columnHelper.accessor('success', {
id: 'success',
header: 'Result',
cell: (props) => {
const success = props.getValue();
return (
<Badge variant={success ? 'success' : 'error'}>
{success ? 'Success' : 'Failed'}
</Badge>
);
},
enableSorting: false
}),

// Timestamp column
columnHelper.accessor('timestamp', {
id: 'timestamp',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import { LinkWithCopy } from '@/components/ui/composites/link-with-copy/LinkWith
import { TimestampDisplay } from '@/components/ui/timestamp-display';
import { RESOURCES } from '@/constants/resources';
import type { MultisigProposal } from '@/schemas';
import {
formatBlockHeight,
formatMonetaryValue,
formatTxAddress
} from '@/utils/formatter';
import { formatTxAddress } from '@/utils/formatter';
import { getMultisigProposalHref } from '@/utils/get-multisig-proposal-href';
import { getMultisigWalletHref } from '@/utils/get-multisig-wallet-href';

Expand Down Expand Up @@ -102,24 +98,6 @@ export const MULTISIG_PROPOSAL_COLUMNS = [
},
enableSorting: false
}),
columnHelper.accessor('deposit', {
id: 'deposit',
header: 'Deposit',
cell: (props) => formatMonetaryValue(props.getValue(), 5),
enableSorting: true
}),
columnHelper.accessor('expiry_block', {
id: 'expiry_block',
header: 'Expiry Block',
cell: (props) => (
<LinkWithCopy
href={`${RESOURCES.blocks}/${props.getValue()}`}
text={formatBlockHeight(props.getValue())}
numeric
/>
),
enableSorting: true
}),
columnHelper.accessor('created_at', {
id: 'created_at',
header: 'Created',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createColumnHelper } from '@tanstack/react-table';
import type { VariantProps } from 'class-variance-authority';

import { Badge, type badgeVariants } from '@/components/ui/badge';
import { Badge, type BadgeProps } from '@/components/ui/badge';
import { AccountAddressCell } from '@/components/ui/composites/account-address-cell/AccountAddressCell';
import { LinkWithCopy } from '@/components/ui/composites/link-with-copy/LinkWithCopy';
import { TimestampDisplay } from '@/components/ui/timestamp-display';
Expand All @@ -17,11 +16,9 @@ import {
} from '@/utils/formatter';
import { getUnifiedTransactionDetailPath } from '@/utils/get-unified-transaction-detail-path';

type BadgeVariant = NonNullable<VariantProps<typeof badgeVariants>['variant']>;

const STATUS_BADGE: Record<
UnifiedListTransactionStatus,
{ label: string; variant: BadgeVariant }
{ label: string; variant: NonNullable<BadgeProps['variant']> }
> = {
SUCCESS: { label: 'Success', variant: 'success' },
ERROR: { label: 'Error', variant: 'error' },
Expand Down Expand Up @@ -83,7 +80,7 @@ export const UNIFIED_LIST_TRANSACTION_COLUMNS = [
address={id}
href={`${RESOURCES.accounts}/${id}`}
text={formatTxAddress(id)}
className="font-mono text-muted-text"
className="font-mono text-flare"
/>
);
},
Expand All @@ -100,7 +97,7 @@ export const UNIFIED_LIST_TRANSACTION_COLUMNS = [
address={id}
href={`${RESOURCES.accounts}/${id}`}
text={formatTxAddress(id)}
className="font-mono text-muted-text"
className="font-mono text-flare"
/>
);
},
Expand All @@ -117,30 +114,12 @@ export const UNIFIED_LIST_TRANSACTION_COLUMNS = [
},
enableSorting: true
}),
columnHelper.accessor('fee', {
id: 'fee',
header: 'Fee',
cell: (props) => {
const value = props.getValue();
if (value == null)
return <span className="font-mono text-muted-text">—</span>;
return (
<span className="numeric text-muted-text">
{formatMonetaryValue(value, 5)}
</span>
);
},
enableSorting: true
}),
columnHelper.accessor('status', {
id: 'status',
header: 'Status',
cell: (props) => {
const status = props.getValue();
const config = STATUS_BADGE[status] ?? {
label: status,
variant: 'miner' as const
};
const config = STATUS_BADGE[status];
return <Badge variant={config.variant}>{config.label}</Badge>;
},
enableSorting: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const CancelledReversibleTransactionInformation: React.FC<
<AccountAddressCell
address={value.id}
href={`${RESOURCES.accounts}/${value.id}`}
truncate={false}
className="break-all"
/>
)
Expand All @@ -96,6 +97,7 @@ export const CancelledReversibleTransactionInformation: React.FC<
<AccountAddressCell
address={value.from.id}
href={`${RESOURCES.accounts}/${value.from.id}`}
truncate={false}
className="break-all"
/>
)
Expand All @@ -107,6 +109,7 @@ export const CancelledReversibleTransactionInformation: React.FC<
<AccountAddressCell
address={value.to.id}
href={`${RESOURCES.accounts}/${value.to.id}`}
truncate={false}
className="break-all"
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const ExecutedReversibleTransactionInformation: React.FC<
<AccountAddressCell
address={value.from.id}
href={`${RESOURCES.accounts}/${value.from.id}`}
truncate={false}
className="break-all"
/>
)
Expand All @@ -87,6 +88,7 @@ export const ExecutedReversibleTransactionInformation: React.FC<
<AccountAddressCell
address={value.to.id}
href={`${RESOURCES.accounts}/${value.to.id}`}
truncate={false}
className="break-all"
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const HighSecuritySetInformation: React.FC<
<AccountAddressCell
address={whoId}
href={`${RESOURCES.accounts}/${whoId}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -109,6 +110,7 @@ export const HighSecuritySetInformation: React.FC<
<AccountAddressCell
address={guardianId}
href={`${RESOURCES.accounts}/${guardianId}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const MinerRewardInformation: React.FC<MinerRewardInformationProps> = ({
<AccountAddressCell
address={(value as MinerReward['miner']).id}
href={`${RESOURCES.accounts}/${(value as MinerReward['miner']).id}`}
truncate={false}
className="break-all"
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const getSharedMultisigConfigurationFields = (): MultisigCreatedField[] => [
<AccountAddressCell
address={creatorId}
href={`${RESOURCES.accounts}/${creatorId}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -67,6 +68,7 @@ const getSharedMultisigConfigurationFields = (): MultisigCreatedField[] => [
key={signer}
address={signer}
href={`${RESOURCES.accounts}/${signer}`}
truncate={false}
/>
))}
</div>
Expand Down Expand Up @@ -117,6 +119,7 @@ export const getMultisigCreatedEventFields = (): MultisigCreatedField[] => [
<AccountAddressCell
address={String(value)}
href={getMultisigWalletHref(String(value))}
truncate={false}
/>
) : (
<EmptyValue />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const MultisigDepositsClaimedInformation: React.FC<
<AccountAddressCell
address={multisigId}
href={getMultisigWalletHref(multisigId)}
truncate={false}
className="break-all"
/>
) : (
Expand All @@ -106,6 +107,7 @@ export const MultisigDepositsClaimedInformation: React.FC<
<AccountAddressCell
address={claimerId}
href={`${RESOURCES.accounts}/${claimerId}`}
truncate={false}
className="break-all"
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export const MultisigDetailDataTabs: React.FC<Props> = ({ walletId }) => {
search: {
tab: nextTab,
status: nextTab === 'proposals' ? status : 'all'
}
},
resetScroll: false
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const MultisigDetailStatusFilter: React.FC = () => {
search: {
tab: tab ?? 'proposals',
status: nextStatus
}
},
resetScroll: false
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const MultisigProposalCancelledInformation: React.FC<
<AccountAddressCell
address={multisigId}
href={getMultisigWalletHref(multisigId)}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -123,6 +124,7 @@ export const MultisigProposalCancelledInformation: React.FC<
<AccountAddressCell
address={proposerId}
href={`${RESOURCES.accounts}/${proposerId}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -140,6 +142,7 @@ export const MultisigProposalCancelledInformation: React.FC<
<AccountAddressCell
address={cancelledById}
href={`${RESOURCES.accounts}/${cancelledById}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const MultisigProposalCreatedInformation: React.FC<
<AccountAddressCell
address={multisigId}
href={getMultisigWalletHref(multisigId)}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -119,6 +120,7 @@ export const MultisigProposalCreatedInformation: React.FC<
<AccountAddressCell
address={proposerId}
href={`${RESOURCES.accounts}/${proposerId}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const accountLink = (accountId?: string | null) =>
<AccountAddressCell
address={accountId}
href={`${RESOURCES.accounts}/${accountId}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -92,6 +93,7 @@ const walletLink = (walletId?: string | null) =>
<AccountAddressCell
address={walletId}
href={getMultisigWalletHref(walletId)}
truncate={false}
/>
) : (
<EmptyValue />
Expand Down Expand Up @@ -235,6 +237,7 @@ const BASE_PROPOSAL_FIELDS: ProposalField[] = [
key={approver}
address={approver}
href={`${RESOURCES.accounts}/${approver}`}
truncate={false}
/>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const MultisigProposalExecutedInformation: React.FC<
<AccountAddressCell
address={multisigId}
href={getMultisigWalletHref(multisigId)}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -123,6 +124,7 @@ export const MultisigProposalExecutedInformation: React.FC<
<AccountAddressCell
address={proposerId}
href={`${RESOURCES.accounts}/${proposerId}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -142,6 +144,7 @@ export const MultisigProposalExecutedInformation: React.FC<
key={approver}
address={approver}
href={`${RESOURCES.accounts}/${approver}`}
truncate={false}
/>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const MultisigProposalReadyInformation: React.FC<
<AccountAddressCell
address={multisigId}
href={getMultisigWalletHref(multisigId)}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -130,6 +131,7 @@ export const MultisigProposalReadyInformation: React.FC<
<AccountAddressCell
address={proposerId}
href={`${RESOURCES.accounts}/${proposerId}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const MultisigProposalRemovedInformation: React.FC<
<AccountAddressCell
address={multisigId}
href={getMultisigWalletHref(multisigId)}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -120,6 +121,7 @@ export const MultisigProposalRemovedInformation: React.FC<
<AccountAddressCell
address={proposerId}
href={`${RESOURCES.accounts}/${proposerId}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand All @@ -136,6 +138,7 @@ export const MultisigProposalRemovedInformation: React.FC<
<AccountAddressCell
address={removedById}
href={`${RESOURCES.accounts}/${removedById}`}
truncate={false}
/>
) : (
<EmptyValue />
Expand Down
Loading
Loading