mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-02-08 04:55:02 -05:00
* squash frontend changes * Style quest explorer * Style quest page * Dates * Dates * Typecheck * Prettier * Fix create page layout * Update only OPEN quests * Repetition info * Fix create quest errors * Quest form Textarea * Quest form Textarea * Truncate texts * Redirect if user not logged in * Tooltips * Factorize skills tags * fix username in completions * Metafam as default guild on creation * Layouts * Remove todo * cooldown * Rename to "claim quest" * squash frontend changes * Style quest explorer * Style quest page * Dates * Dates * Typecheck * Prettier * Fix create page layout * Update only OPEN quests * Repetition info * Fix create quest errors * Quest form Textarea * Quest form Textarea * Truncate texts * Redirect if user not logged in * Tooltips * Factorize skills tags * fix username in completions * Metafam as default guild on creation * Layouts * Remove todo * cooldown * Rename to "claim quest" * Move ConfirmModal in ds * Extract pSeed balance * Fix "created by me" switch * Reword complete quest * Style quest form * prettier * lint
27 lines
654 B
TypeScript
27 lines
654 B
TypeScript
import { useGetpSeedBalanceQuery } from '../../graphql/autogen/types';
|
|
import { useUser } from './index';
|
|
|
|
interface PSeedBalanceHook {
|
|
pSeedBalance: string | null;
|
|
fetching: boolean;
|
|
}
|
|
export const usePSeedBalance: () => PSeedBalanceHook = () => {
|
|
const { user } = useUser();
|
|
|
|
const [respSeedBalance] = useGetpSeedBalanceQuery({
|
|
variables: {
|
|
address: user?.ethereum_address || '',
|
|
},
|
|
pause: !user?.ethereum_address,
|
|
});
|
|
const pSeedBalance =
|
|
(user?.ethereum_address &&
|
|
respSeedBalance.data?.getTokenBalances?.pSeedBalance) ||
|
|
null;
|
|
|
|
return {
|
|
pSeedBalance,
|
|
fetching: respSeedBalance.fetching,
|
|
};
|
|
};
|