Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
simodrws
committed
Aug 2, 2023
1 parent
adce4f2
commit 9696fcb
Showing
8 changed files
with
318 additions
and
179 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,42 @@ | ||
import { useMemo } from 'react'; | ||
import { useMasaClient } from '../masa-client/use-masa-client'; | ||
import { useCreditScores } from './use-credit-scores'; | ||
import { useGreen } from './use-green'; | ||
import { useIdentity } from './use-identity'; | ||
import { useSession } from './use-session'; | ||
import { useSoulNames } from './use-soulnames'; | ||
import { useWallet } from '../wallet-client/wallet/use-wallet'; | ||
|
||
export const useMasaLoading = () => { | ||
const { isLoadingSigner, isConnecting } = useWallet(); | ||
const { isLoadingSession } = useSession(); | ||
const { isLoadingIdentity } = useIdentity(); | ||
const { isLoadingSoulnames } = useSoulNames(); | ||
const { isLoadingCreditScores } = useCreditScores(); | ||
const { isLoadingGreens } = useGreen(); | ||
const { sdk: masa } = useMasaClient(); | ||
|
||
const isLoading = useMemo( | ||
() => | ||
isLoadingSession || | ||
isLoadingIdentity || | ||
isLoadingSoulnames || | ||
isLoadingCreditScores || | ||
isLoadingGreens || | ||
isLoadingSigner || | ||
isConnecting || | ||
!masa, | ||
[ | ||
isLoadingSession, | ||
isLoadingIdentity, | ||
isLoadingSoulnames, | ||
isLoadingCreditScores, | ||
isLoadingGreens, | ||
masa, | ||
isLoadingSigner, | ||
isConnecting, | ||
] | ||
); | ||
|
||
return isLoading; | ||
}; |
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
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,11 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { Spinner } from '../spinner'; | ||
|
||
export const ModalLoading = ({ titleText }: { titleText?: ReactNode }) => ( | ||
<section className="interface-connected"> | ||
<section> | ||
<h3 className="title">{titleText}</h3> | ||
<Spinner /> | ||
</section> | ||
</section> | ||
); |
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
Oops, something went wrong.