Skip to content

Commit

Permalink
chore: more utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia committed Aug 10, 2024
1 parent 5168def commit 33135c4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/transaction/components/TransactionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Spinner } from '../../internal/components/Spinner';
import { checkmarkSvg } from '../../internal/svg/checkmarkSvg';
import { background, cn, color, pressable, text } from '../../styles/theme';
import type { TransactionButtonReact } from '../types';
import { isSpinnerDisplayed } from '../utils';
import { isSpinnerDisplayed } from '../utils/isSpinnerDisplayed';
import { useTransactionContext } from './TransactionProvider';

export function TransactionButton({
Expand Down
10 changes: 10 additions & 0 deletions src/transaction/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import type {
TransactionReceipt,
} from 'viem';

export type IsSpinnerDisplayedProps = {
errorMessage?: string;
hasReceipt?: boolean;
isLoading?: boolean;
statusWriteContract?: string;
statusWriteContracts?: string;
transactionHash?: string;
transactionId?: string;
};

/**
* Note: exported as public Type
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isSpinnerDisplayed } from './utils';
import { isSpinnerDisplayed } from './isSpinnerDisplayed';

describe('isSpinnerDisplayed', () => {
it('should return true if transaction hash exists', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
type IsSpinnerDisplayedProps = {
errorMessage?: string;
hasReceipt?: boolean;
isLoading?: boolean;
statusWriteContract?: string;
statusWriteContracts?: string;
transactionHash?: string;
transactionId?: string;
};
import type { IsSpinnerDisplayedProps } from '../types';

export function isSpinnerDisplayed({
errorMessage,
Expand Down

0 comments on commit 33135c4

Please sign in to comment.