Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: filter activated builders #377

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import { BuilderStatusShown } from '@/app/collective-rewards/types'
import { BuilderStatusFilter, useWhitelistContext } from '@/app/collective-rewards/whitelist'
import { useAlertContext } from '@/app/providers'
import { Input } from '@/components/Input'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/Select'
import { Label } from '@/components/Typography'
import { useEffect } from 'react'

type SelectOption = {
value: BuilderStatusShown | 'all'
label: string
}

// TODO: are there other statuses to be considered?
const statuses: SelectOption[] = [
{ value: 'all', label: 'All' },
{ value: 'Active', label: 'Activated' },
{ value: 'In progress', label: 'In progress' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use the relevant constants perhpas?

]

export const WhitelistSearch = () => {
const { search, filterBy, error: whitelistError } = useWhitelistContext()
const { setMessage: setErrorMessage } = useAlertContext()
Expand All @@ -20,13 +33,6 @@ export const WhitelistSearch = () => {
}
}, [whitelistError, setErrorMessage])

// TODO: are there other statuses to be considered?
const statuses = [
{ value: 'all', label: 'All' },
{ value: 'Whitelisted', label: 'Whitelisted' },
{ value: 'In progress', label: 'In progress' },
]

const onValueChange = (value: string) => filterBy.onChange(value as BuilderStatusFilter)

return (
Expand Down
Loading