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

fix: format #227

Merged
merged 1 commit into from
Mar 6, 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 .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';
Loading