Skip to content

Commit

Permalink
feat: updated the text
Browse files Browse the repository at this point in the history
  • Loading branch information
BLuEScioN committed Jan 23, 2025
1 parent 123ae37 commit c1af031
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
20 changes: 2 additions & 18 deletions src/app/_components/NavBar/NetworkLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Badge, Spinner } from '@chakra-ui/react';
import { Flex, Icon, Stack } from '@chakra-ui/react';
import { Badge, Flex, Icon, Spinner, Stack } from '@chakra-ui/react';
import { Check, Trash } from '@phosphor-icons/react';
import { FC, useMemo } from 'react';

Expand Down Expand Up @@ -77,29 +76,14 @@ export const NetworkLabel: FC<{ network: Network }> = ({ network }) => {
>
{network.label}
</Title>
{network.isSubnet ? (
{network.isSubnet && (
<Badge
bg={'navbar.networkLabelBadgeBackground'}
ml={2}
color={'navbar.networkLabelBadge'}
>
subnet
</Badge>
) : (
<Badge
color={'navbar.networkLabelBadge'}
bg={'navbar.networkLabelBadgeBackground'}
px={2}
py={1}
fontSize={'xs'}
rounded={'full'}
border="normal"
borderColor={'navbar.networkLabelBadgeBorder'}
fontWeight={'medium'}
ml={2}
>
Nakamoto 3.0
</Badge>
)}
</Flex>
<Caption
Expand Down
10 changes: 4 additions & 6 deletions src/app/txid/[txId]/TxAlerts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ import { MempoolTransaction, Transaction } from '@stacks/stacks-blockchain-api-t
import { TransactionStatus } from '../../../common/constants/constants';
import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { getTransactionStatus } from '../../../common/utils/transactions';
import { ListItem } from '../../../ui/ListItem';
import { Text } from '../../../ui/Text';
import { UnorderedList } from '../../../ui/UnorderedList';
import { ExplorerErrorBoundary } from '../../_components/ErrorBoundary';
import { AlertBase } from './Alert';
import { useWhyDidMyTxFail } from './useWhyDidMyTxFail';

interface TxAlertsBaseProps {
tx: Transaction | MempoolTransaction;
Expand All @@ -36,13 +32,15 @@ function TxAlertsBase({ tx }: TxAlertsBaseProps) {
// data?.results?.map((result: { message?: string }) => result.message) || []
// )?.filter((message: string) => !!message);

const failedMessage =
const reasonForFailure =
tx.tx_status === 'abort_by_response'
? 'This transaction did not succeed because the transaction was aborted during its execution'
: 'This transaction would have succeeded, but was rolled back by a supplied post-condition';

const failedMessage = `${reasonForFailure}. A failed transaction is included in a block (mining fees are paid to the miner and are non-refundable), but failed because it violated the rules of the Stacks protocol or of the smart contract it interacted with. See the error code and/or the contract to learn more about the specific cause of failure.`;

const longPendingMessage =
'Transactions that cannot be confirmed within 256 blocks are eventually canceled automatically';
'A dropped transaction is a transaction that cannot be mined. Dropped transactions do not incur mining fees and will expire after 256 tenures (~42 hours). While these transactions do not become part of chain history, some indexers may still show data for these transactions for a period of time after expiration.';

const nonCanonicalMessage =
'This transaction is in a non-canonical fork. It is not in the canonical Stacks chain';
Expand Down
2 changes: 1 addition & 1 deletion src/app/txid/[txId]/TxPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const txStatusIconMap: Record<string, React.ReactNode> = {
const txStatusLabelMap = {
pending: 'In mempool',
success: 'Confirmed',
success_anchor_block: 'Confirmed in anchor block',
success_anchor_block: 'Confirmed in block',
success_microblock: 'Included in microblock',
non_canonical: 'Non-canonical (orphaned)',
failed: 'Failed',
Expand Down

0 comments on commit c1af031

Please sign in to comment.