From ac3bc50c8c47edaf7877253e9fed0e493a79532f Mon Sep 17 00:00:00 2001 From: Kris Urbas <605420+krzysu@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:51:34 +0200 Subject: [PATCH] react: enable useLinkHandle and useUnlinkHandle hooks --- .changeset/smooth-ties-roll.md | 8 ++++++++ examples/web/src/profiles/ProfilesPage.tsx | 6 ++---- examples/web/src/profiles/UseOwnedHandles.tsx | 6 ++---- packages/react/src/transactions/useLinkHandle.ts | 1 - packages/react/src/transactions/useUnlinkHandle.ts | 1 - 5 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 .changeset/smooth-ties-roll.md diff --git a/.changeset/smooth-ties-roll.md b/.changeset/smooth-ties-roll.md new file mode 100644 index 0000000000..606626c4cb --- /dev/null +++ b/.changeset/smooth-ties-roll.md @@ -0,0 +1,8 @@ +--- +"@lens-protocol/api-bindings": minor +"@lens-protocol/domain": minor +"@lens-protocol/react": minor +"@lens-protocol/react-web": minor +--- + +Added useLinkHandle and useUnlinkHandle hooks diff --git a/examples/web/src/profiles/ProfilesPage.tsx b/examples/web/src/profiles/ProfilesPage.tsx index eceb063b43..3a7b87b1fe 100644 --- a/examples/web/src/profiles/ProfilesPage.tsx +++ b/examples/web/src/profiles/ProfilesPage.tsx @@ -72,10 +72,8 @@ const profileHooks = [ path: '/profiles/useUpdateFollowPolicy', }, { - label: 'useOwnedHandles', - // label: 'useOwnedHandles & useLinkHandle & useUnlinkHandle', - // description: `Link and unlink handle from a profile.`, - description: `Fetch all handles owned by a wallet.`, + label: 'useOwnedHandles & useLinkHandle & useUnlinkHandle', + description: `Link and unlink handle from a profile.`, path: '/profiles/useOwnedHandles', }, ]; diff --git a/examples/web/src/profiles/UseOwnedHandles.tsx b/examples/web/src/profiles/UseOwnedHandles.tsx index 9e77f0a933..6e3b21c77f 100644 --- a/examples/web/src/profiles/UseOwnedHandles.tsx +++ b/examples/web/src/profiles/UseOwnedHandles.tsx @@ -74,7 +74,6 @@ function UseOwnedProfiles({ address }: { address: EvmAddress }) { ); } -// eslint-disable-next-line function UseOwnedHandlesInner({ address }: { address: EvmAddress }) { const { data: handleResult, @@ -118,7 +117,7 @@ function Content({ address, profile }: ContentProps) {

- {/* */} +
); @@ -128,8 +127,7 @@ export function UseOwnedHandles() { return (

- {/* useOwnedHandles & useLinkHandle & useUnlinkHandle */} - useOwnedHandles + useOwnedHandles & useLinkHandle & useUnlinkHandle

diff --git a/packages/react/src/transactions/useLinkHandle.ts b/packages/react/src/transactions/useLinkHandle.ts index 3b7e85c1ca..04215c3935 100644 --- a/packages/react/src/transactions/useLinkHandle.ts +++ b/packages/react/src/transactions/useLinkHandle.ts @@ -35,7 +35,6 @@ export type LinkHandleArgs = { * * @category Profiles * @group Hooks - * @experimental This hook is experimental and may change in future releases. */ export function useLinkHandle(): UseDeferredTask< AsyncTransactionResult, diff --git a/packages/react/src/transactions/useUnlinkHandle.ts b/packages/react/src/transactions/useUnlinkHandle.ts index a92148b1d1..4d90f43488 100644 --- a/packages/react/src/transactions/useUnlinkHandle.ts +++ b/packages/react/src/transactions/useUnlinkHandle.ts @@ -35,7 +35,6 @@ export type UnlinkHandleArgs = { * * @category Profiles * @group Hooks - * @experimental This hook is experimental and may change in future releases. */ export function useUnlinkHandle(): UseDeferredTask< AsyncTransactionResult,