Skip to content

Commit

Permalink
Remove extraneous poll sort
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Nov 14, 2024
1 parent 5ecc3c0 commit d73d0d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 3 additions & 8 deletions web/components/search/contract-filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
DEFAULT_CONTRACT_TYPES,
DEFAULT_FILTER,
DEFAULT_FILTERS,
DEFAULT_POLL_SORTS,
DEFAULT_SORT,
DEFAULT_SORTS,
DEFAULT_TIER,
Expand Down Expand Up @@ -123,12 +122,8 @@ export function ContractFilters(props: {
const sortLabel = getLabelFromValue(SORTS, sort)
const contractTypeLabel = getLabelFromValue(CONTRACT_TYPES, contractType)

const sortItems =
contractType == 'BOUNTIED_QUESTION'
? DEFAULT_BOUNTY_SORTS
: contractType == 'POLL'
? DEFAULT_POLL_SORTS
: []
const extraSortOptions =
contractType == 'BOUNTIED_QUESTION' ? DEFAULT_BOUNTY_SORTS : []

const [openFilterModal, setOpenFilterModal] = useState(false)

Expand Down Expand Up @@ -218,7 +213,7 @@ export function ContractFilters(props: {
New
</button>
</Row>
{sortItems.map((sortValue) => (
{extraSortOptions.map((sortValue) => (
<FilterPill
key={sortValue}
selected={sortValue === sort}
Expand Down
3 changes: 1 addition & 2 deletions web/components/supabase-search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ export const CONTRACT_TYPES = [

export const DEFAULT_SORT = 'score'
export const DEFAULT_SORTS = ['freshness-score', 'newest']
export const DEFAULT_BOUNTY_SORTS = ['bounty-amount', 'newest']
export const DEFAULT_POLL_SORTS = ['newest']
export const DEFAULT_BOUNTY_SORTS = ['bounty-amount']

export const DEFAULT_FILTERS = []
export const DEFAULT_FILTER = 'all'
Expand Down

0 comments on commit d73d0d8

Please sign in to comment.