Skip to content

Commit

Permalink
fix: lint (#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia authored Jul 16, 2024
1 parent 816abce commit a914d8e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 53 deletions.
1 change: 1 addition & 0 deletions .changeset/eight-buses-enjoy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"@coinbase/onchainkit": patch
---

- **feat**: added initial version of `Transaction` component. By @abcrane123 & @zizzamia #816 #787
- **feat**: updated Viem and Wagmi version. By @zizzamia #815
- **chore**: Add WalletDropdown Disconnect and Link tests. By @cpcramer #810
- **chore**: Add Identity unit tests. By @cpcramer #807
43 changes: 0 additions & 43 deletions site/docs/pages/transaction/transaction.mdx
Original file line number Diff line number Diff line change
@@ -1,51 +1,8 @@
import App from '../../components/App';
import { Avatar, Name } from '@coinbase/onchainkit/identity';
import { Transaction } from '../../../../src/transaction/components/Transaction';
import { TransactionGasFee } from '../../../../src/transaction/components/TransactionGasFee';
import { TransactionGasFeeLabel } from '../../../../src/transaction/components/TransactionGasFeeLabel';
import { TransactionGasFeeEstimate } from '../../../../src/transaction/components/TransactionGasFeeEstimate';
import { TransactionGasFeeSponsoredBy } from '../../../../src/transaction/components/TransactionGasFeeSponsoredBy';
import { TransactionButton } from '../../../../src/transaction/components/TransactionButton';
import { TransactionStatus } from '../../../../src/transaction/components/TransactionStatus';
import { TransactionStatusLabel } from '../../../../src/transaction/components/TransactionStatusLabel';
import { TransactionStatusAction } from '../../../../src/transaction/components/TransactionStatusAction';
import TransactionWrapper from '../../components/TransactionWrapper';
import { Wallet, ConnectWallet } from '../../../../src/wallet';

# `<Transaction />`

:::warning
Component is actively in development. Stay tuned for upcoming releases.
:::

<App>
<TransactionWrapper>
{({ address, contracts }) => {
if (address) {
return (
<Transaction address={address} contracts={contracts}>
<TransactionButton />
<TransactionGasFee>
<TransactionGasFeeLabel />
<TransactionGasFeeEstimate />
<TransactionGasFeeSponsoredBy />
</TransactionGasFee>
<TransactionStatus>
<TransactionStatusLabel />
<TransactionStatusAction />
</TransactionStatus>
</Transaction>
)
} else {
return (
<Wallet>
<ConnectWallet>
<Avatar className="h-6 w-6" />
<Name />
</ConnectWallet>
</Wallet>
)
}
}}
</TransactionWrapper>
</App>
File renamed without changes.
3 changes: 2 additions & 1 deletion src/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type ClassValue, clsx } from 'clsx';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import type { ClassValue } from 'clsx';

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
Expand Down
1 change: 1 addition & 0 deletions src/transaction/components/TransactionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function TransactionButton({
className,
)}
onClick={onSubmit}
type="button"
>
{isLoading ? (
<Spinner />
Expand Down
6 changes: 3 additions & 3 deletions src/transaction/core/useGetTransactionStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMemo } from 'react';
import { useTransactionContext } from '../components/TransactionProvider';
import { cn, color, text } from '../../styles/theme';
import { useOnchainKit } from '../../useOnchainKit';
import { getChainExplorer } from './getChainExplorer';
import { getChainExplorer } from '../../network/getChainExplorer';
import type { ReactNode } from 'react';

export function useGetTransactionStatus() {
Expand All @@ -13,13 +13,13 @@ export function useGetTransactionStatus() {
const chainExplorer = getChainExplorer(chain.id);

let actionElement: ReactNode = null;
let label: string = '';
let label = '';
let labelClassName: string = color.foregroundMuted;

if (isLoading) {
label = 'Transaction in progress...';
actionElement = (
<a href="">
<a href={chainExplorer}>
<span className={cn(text.label1, color.primary)}>
View on explorer
</span>
Expand Down
12 changes: 6 additions & 6 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ export default defineConfig({
'**.js',
'**.ts',
'**/**.stories.**',
'**/getMockFrameRequest.ts',
'**/index.ts',
'**/*Svg.tsx',
'**/types.ts',
'**/getMockFrameRequest.ts',
'.storybook/**',
'.yarn/**',
'esm/**',
'framegear/**',
'node_modules/**',
'onchainkit/esm/**',
'site/**',
'**/*Svg.tsx',
],
reportOnFailure: true,
thresholds: {
statements: 95.34,
branches: 97.7,
functions: 90.5,
lines: 95.34,
statements: 94.52,
branches: 97.3,
functions: 86.82,
lines: 94.52,
},
},
environment: 'jsdom',
Expand Down

0 comments on commit a914d8e

Please sign in to comment.