Skip to content

Commit

Permalink
refactor: remove de-activated builders
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscotobar committed Dec 9, 2024
1 parent b2424d3 commit ff44b79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export const isActive = (stateFlags?: BuilderStateFlags) => {
return activeFlags.every(flag => stateFlags?.[flag as keyof BuilderStateFlags])
}

const isDeactivated = ({ gauge, stateFlags }: Builder) =>
!(gauge && stateFlags && stateFlags.activated && !stateFlags.communityApproved)

const filterFunction = (builder: Builder, status: string) => {
if (status === 'all') return true
if (status === 'active') return isActive(builder.stateFlags)
Expand All @@ -31,6 +34,7 @@ export const ActiveBuildersContent = () => {
true,
)
useHandleErrors({ error, title: 'Error loading builders' })
const filteredBuilders = builders.filter(isDeactivated)

const status = [
{ label: 'All', value: 'all' },
Expand All @@ -40,7 +44,7 @@ export const ActiveBuildersContent = () => {

return (
<>
<SearchContextProvider builders={builders} filterFunction={filterFunction}>
<SearchContextProvider builders={filteredBuilders} filterFunction={filterFunction}>
<Search status={status} />
{withSpinner(ActiveBuildersGrid)({ isLoading })}
</SearchContextProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const BuilderNameCell: FC<BuilderCellProps> = ({
<TableCell className={cn(className, 'border-solid')}>
<div className="flex flex-row gap-x-1 items-center">
<BuilderStatusFlag stateFlags={stateFlags} />
<Jdenticon className="rounded-md bg-white min-w-6" value={builderName} size="24" />
<Jdenticon className="rounded-md bg-white min-w-6" value={address} size="24" />
<div className="w-32">
<Popover
content={
Expand Down

0 comments on commit ff44b79

Please sign in to comment.