diff --git a/src/app/collective-rewards/active-builders/ActiveBuildersContent.tsx b/src/app/collective-rewards/active-builders/ActiveBuildersContent.tsx index 0f3049ca..30e01ebf 100644 --- a/src/app/collective-rewards/active-builders/ActiveBuildersContent.tsx +++ b/src/app/collective-rewards/active-builders/ActiveBuildersContent.tsx @@ -1,6 +1,6 @@ import { SearchContextProvider } from '@/app/collective-rewards/shared' import { withSpinner } from '@/components/LoadingSpinner/withLoadingSpinner' -import { useHandleErrors } from '@/app/collective-rewards/utils' +import { isBuilderDeactivated, useHandleErrors } from '@/app/collective-rewards/utils' import { useGetBuildersByState } from '@/app/collective-rewards/user/' import { ActiveBuildersGrid } from '@/app/collective-rewards/active-builders' import { Search } from '@/app/collective-rewards/shared' @@ -31,6 +31,7 @@ export const ActiveBuildersContent = () => { true, ) useHandleErrors({ error, title: 'Error loading builders' }) + const filteredBuilders = builders.filter(builder => !isBuilderDeactivated(builder)) const status = [ { label: 'All', value: 'all' }, @@ -40,7 +41,7 @@ export const ActiveBuildersContent = () => { return ( <> - + {withSpinner(ActiveBuildersGrid)({ isLoading })} diff --git a/src/app/collective-rewards/shared/components/Table/TableCells.tsx b/src/app/collective-rewards/shared/components/Table/TableCells.tsx index 9f1c90e6..775cecdc 100644 --- a/src/app/collective-rewards/shared/components/Table/TableCells.tsx +++ b/src/app/collective-rewards/shared/components/Table/TableCells.tsx @@ -102,7 +102,7 @@ export const BuilderNameCell: FC = ({
- +
{ return !!(stateFlags && stateFlags.communityApproved && stateFlags.kycApproved && !stateFlags.paused) } +export const isBuilderDeactivated = ({ gauge, stateFlags }: Builder) => + !!(gauge && stateFlags && !stateFlags.communityApproved) + export const isBuilderActive = (stateFlags?: BuilderStateFlags) => { return !!( stateFlags && diff --git a/src/components/Table/tableDocs.md b/src/components/Table/tableDocs.md index 76ce50e6..ee3c454c 100644 --- a/src/components/Table/tableDocs.md +++ b/src/components/Table/tableDocs.md @@ -30,4 +30,4 @@ const data = [ ## Styling - Use the `className` prop to apply custom styles to the table. -- The component provides a basic structure and styles. You can override or extend these styles as needed. \ No newline at end of file +- The component provides a basic structure and styles. You can override or extend these styles as needed.