-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: disable manage allocations button
- Loading branch information
1 parent
dae6b11
commit 0eb88d9
Showing
5 changed files
with
30 additions
and
3 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export * from './useBackerTotalAllocation' | ||
export * from './useGetVotingPower' | ||
export * from './useActivatedBuildersWithGauge' | ||
export * from './useBuildersWithBackerRewardPercentage' | ||
export * from './useValidateBackerAllocations' |
13 changes: 13 additions & 0 deletions
13
src/app/collective-rewards/allocations/hooks/useValidateBackerAllocations.ts
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,13 @@ | ||
import { useContext } from 'react' | ||
import { AllocationsContext } from '@/app/collective-rewards/allocations/context' | ||
|
||
export const useValidateBackerAllocations = () => { | ||
const { | ||
state: { selections, allocations }, | ||
} = useContext(AllocationsContext) | ||
|
||
const isSelectionsEmpty = Object.values(selections).every(value => !value) | ||
const isAllocationsEmpty = !Object.keys(allocations).length | ||
|
||
return isSelectionsEmpty && isAllocationsEmpty | ||
} |
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