Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: more utils #1029

Merged
merged 1 commit into from
Aug 10, 2024
Merged
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
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