-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[account] Add ability to use aptid.xyz profiles for explorer images
- Loading branch information
1 parent
cbc0f13
commit 25fcc26
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {useQuery} from "@tanstack/react-query"; | ||
import {ResponseError} from "../client"; | ||
import {useGlobalState} from "../../global-config/GlobalConfig"; | ||
|
||
export function useGetProfile( | ||
address: string, | ||
options?: {retry?: number | boolean}, | ||
) { | ||
const [state] = useGlobalState(); | ||
|
||
const result = useQuery< | ||
{name?: string; bio?: string; avatar_url?: string}, | ||
ResponseError | ||
>({ | ||
queryKey: ["account", {address}, state.network_value], | ||
queryFn: () => { | ||
return fetch("https://aptid.xyz/api/profile/bio?address=" + address).then( | ||
(res) => res.json(), | ||
); | ||
}, | ||
retry: options?.retry ?? false, | ||
}); | ||
|
||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters