Skip to content

Commit

Permalink
fix: format (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia authored Mar 6, 2024
1 parent 4090f4f commit a429311
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .changeset/gold-impalas-retire.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'@coinbase/onchainkit': minor
---

**feat**: Replace internal `useOnchainActionWithCache` with `tanstack/react-query`. This affects `useName` and `useAvatar` hooks. The return type and the input parameters also changed for these 2 hooks.
- **feat**: Replace internal `useOnchainActionWithCache` with `tanstack/react-query`. This affects `useName` and `useAvatar` hooks. The return type and the input parameters also changed for these 2 hooks.

BREAKING CHANGES

Expand Down
1 change: 0 additions & 1 deletion site/docs/pages/identity/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ pnpm add @coinbase/onchainkit react@18 react-dom@18 graphql@14 graphql-request@6

:::


## Components

If you are using any of the provided components, you will need to install and configure `@tanstack/react-query` and wrap your app in `<QueryClientProvider>`.
Expand Down
12 changes: 3 additions & 9 deletions site/docs/pages/identity/use-avatar.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `useAvatar`

The `useAvatar` hook is used to get avatar image url from an onchain identity provider for a given name.
The `useAvatar` hook is used to get avatar image url from an onchain identity
provider for a given name.

Supported providers:

Expand All @@ -11,14 +12,7 @@ Supported providers:
```tsx
import { useAvatar } from '@coinbase/onchainkit/identity';

// Return type signature is following @tanstack/react-query useQuery hook signature
const {
data: avatar,
isLoading,
isError,
error,
status,
} = useAvatar({ ensName: 'vitalik.eth' }, { enabled: true, cacheTime: 1000 * 60 * 60 * 24 });
const { data: avatar, isLoading } = useAvatar({ ensName: 'vitalik.eth' });
```

## Props
Expand Down
12 changes: 3 additions & 9 deletions site/docs/pages/identity/use-name.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `useName`

The `useName` hook is used to get name from an onchain identity provider for a given address.
The `useName` hook is used to get name from an onchain identity provider
for a given address.

Supported providers:

Expand All @@ -11,14 +12,7 @@ Supported providers:
```tsx
import { useName } from '@coinbase/onchainkit/identity';

// Return type signature is following @tanstack/react-query useQuery hook signature
const {
data: name,
isLoading,
isError,
error,
status,
} = useName({ address: '0x1234' }, { enabled: true, cacheTime: 1000 * 60 * 60 * 24 });
const { data: name, isLoading } = useName({ address: '0x1234' });
```

## Props
Expand Down
2 changes: 1 addition & 1 deletion site/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const sidebar = [
],
},
{
text: 'React Hooks',
text: 'Hooks',
items: [
{
text: 'useName',
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '0.9.12';
export const version = '0.10.0';

0 comments on commit a429311

Please sign in to comment.