Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved scopes to a module and added fullfilment of scopes boolean
- Loading branch information
1 parent
002bb74
commit 4d93a78
Showing
3 changed files
with
66 additions
and
13 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
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,14 @@ | ||
import { SoulNameDetails } from '@masa-finance/masa-sdk'; | ||
import { useMemo, useState } from 'react'; | ||
|
||
export const useScopes = (soulnames: SoulNameDetails[]) => { | ||
const [scope, setScope] = useState<string[]>([]); | ||
const areScopesFullfiled = useMemo(() => { | ||
if (scope?.includes('soulname') && (soulnames?.length ?? 0) === 0) | ||
return false; | ||
|
||
return true; | ||
}, [soulnames, scope]); | ||
|
||
return { scope, setScope, areScopesFullfiled }; | ||
}; |