Skip to content

Commit

Permalink
Small fixes from PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenbf committed Oct 25, 2024
1 parent 4ec0eec commit 279bbe6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions packages/browser-wallet/src/popup/popupX/constants/routes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AccountAddress, TransactionHash } from '@concordium/web-sdk';
import { generatePath } from 'react-router-dom';

export type RouteConfig = {
hideBackArrow?: boolean;
Expand Down Expand Up @@ -228,12 +229,13 @@ const buildAbsoluteRoutes = <R extends RouteNode | RoutePath | RouteChildren>(
export const absoluteRoutes = buildAbsoluteRoutes(relativeRoutes);

export const transactionDetailsRoute = (account: AccountAddress.Type, tx: TransactionHash.Type) =>
absoluteRoutes.home.transactionLog.details.path
.replace(':account', account.address)
.replace(':transactionHash', TransactionHash.toHexString(tx));
generatePath(absoluteRoutes.home.transactionLog.details.path, {
account: account.address,
transactionHash: TransactionHash.toHexString(tx),
});

export const submittedTransactionRoute = (tx: TransactionHash.Type) =>
absoluteRoutes.home.submittedTransaction.path.replace(':transactionHash', TransactionHash.toHexString(tx));
generatePath(absoluteRoutes.home.submittedTransaction.path, { transactionHash: TransactionHash.toHexString(tx) });

/**
* Given two absolute routes, returns the relative route between them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ enum TransactionSubmitErrorType {
class TransactionSubmitError extends Error {
private constructor(public type: TransactionSubmitErrorType) {
super();
super.name = `${'TransactionSubmitError'}.type`;
super.name = `TransactionSubmitError.${type}`;
}

public static insufficientFunds(): TransactionSubmitError {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import ConcordiumLogo from '@assets/svgX/concordium-logo.svg';
import { validateAccountAddress, validateTransferAmount } from '@popup/shared/utils/transaction-helpers';
import Img, { DEFAULT_FAILED } from '@popup/shared/Img';
import { displayAsCcd } from 'wallet-common-helpers';
import Text from '@popup/popupX/shared/Text';
import { RequiredUncontrolledFieldProps } from '../common/types';
import { makeUncontrolled } from '../common/utils';
import Button from '../../Button';
import { formatTokenAmount, parseTokenAmount, removeNumberGrouping } from '../../utils/helpers';
import ErrorMessage from '../ErrorMessage';
import { TokenInfo } from './util';
import Text from '@popup/popupX/shared/Text';

type AmountInputProps = Pick<
InputHTMLAttributes<HTMLInputElement>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import i18n from '@popup/shell/i18n';
import { useAtomValue } from 'jotai';
import { selectedPendingTransactionsAtom } from '@popup/store/transactions';
import { DEFAULT_TRANSACTION_EXPIRY } from '@shared/constants/time';
import { useCallback } from 'react';
import { BrowserWalletAccountTransaction, TransactionStatus } from './transaction-history-types';
import { useBlockChainParameters } from '../BlockChainParametersProvider';
import { useCallback } from 'react';

export function buildSimpleTransferPayload(recipient: string, amount: bigint): SimpleTransferPayload {
return {
Expand Down

0 comments on commit 279bbe6

Please sign in to comment.