Skip to content

Commit

Permalink
Rename SupabaseSearch to Search
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Nov 27, 2024
1 parent 29f35e5 commit 04796da
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 21 deletions.
7 changes: 2 additions & 5 deletions web/components/contract-select-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import { useState } from 'react'
import { usePrivateUser } from 'web/hooks/use-user'
import { Button } from './buttons/button'
import { Row } from './layout/row'
import {
SupabaseAdditionalFilter,
SupabaseSearch,
} from 'web/components/supabase-search'
import { SupabaseAdditionalFilter, Search } from 'web/components/search'

export function SelectMarkets(props: {
submitLabel: (length: number) => string
Expand Down Expand Up @@ -36,7 +33,7 @@ export function SelectMarkets(props: {

return (
<div className={clsx('px-1', className)}>
<SupabaseSearch
<Search
persistPrefix="contract-select-modal"
onContractClick={toggleContract}
hideActions
Expand Down
2 changes: 1 addition & 1 deletion web/components/notifications/notification-types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
NumericValueLabel,
ProbPercentLabel,
} from 'web/components/outcome-label'
import { SEARCH_TYPE_KEY } from 'web/components/supabase-search'
import { SEARCH_TYPE_KEY } from 'web/components/search'
import { Avatar } from 'web/components/widgets/avatar'
import { useReview } from 'web/hooks/use-review'
import { useUser } from 'web/hooks/use-user'
Expand Down
4 changes: 2 additions & 2 deletions web/components/portfolio/portfolio-summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useAPIGetter } from 'web/hooks/use-api-getter'
import { useIsAuthorized, usePrivateUser, useUser } from 'web/hooks/use-user'
import { LoadingContractRow } from '../contract/contracts-table'
import { Col } from '../layout/col'
import { SupabaseSearch } from '../supabase-search'
import { Search } from '../search'
import { PortfolioValueSection } from './portfolio-value-section'

export const PortfolioSummary = (props: { user: User; className?: string }) => {
Expand Down Expand Up @@ -48,7 +48,7 @@ export const PortfolioSummary = (props: { user: User; className?: string }) => {
</Col>
)}
{isAuthed && (
<SupabaseSearch
<Search
persistPrefix="recent"
additionalFilter={{
excludeContractIds: privateUser?.blockedContractIds,
Expand Down
8 changes: 2 additions & 6 deletions web/components/profile/user-contracts-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import {
getTotalPublicContractsCreated,
} from 'web/lib/supabase/users'
import { db } from 'web/lib/supabase/db'
import {
searchLocalKey,
FILTER_KEY,
SupabaseSearch,
} from 'web/components/supabase-search'
import { searchLocalKey, FILTER_KEY, Search } from 'web/components/search'
import { useUser } from 'web/hooks/use-user'
import { CreateQuestionButton } from '../buttons/create-question-button'
import { UserReviews } from '../reviews/user-reviews'
Expand Down Expand Up @@ -118,7 +114,7 @@ export function UserContractsList(props: {
}
/>
</Row>
<SupabaseSearch
<Search
defaultFilter="all"
defaultSort="newest"
additionalFilter={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export type SearchState = {
}
}

export function SupabaseSearch(props: {
export function Search(props: {
persistPrefix: string
defaultSort?: Sort
defaultFilter?: Filter
Expand Down
2 changes: 1 addition & 1 deletion web/components/search/contract-filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
Sort,
bountySorts,
predictionMarketSorts,
} from '../supabase-search'
} from '../search'
import { SweepsToggle } from '../sweeps/sweeps-toggle'
import { useSweepstakes } from '../sweepstakes-provider'
import {
Expand Down
2 changes: 1 addition & 1 deletion web/components/search/filter-pills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Filter,
SearchParams,
TOPIC_FILTER_KEY,
} from '../supabase-search'
} from '../search'
import DropdownMenu from '../comments/dropdown-menu'
import { getLabelFromValue } from './search-dropdown-helpers'
import { LiteGroup } from 'common/group'
Expand Down
4 changes: 2 additions & 2 deletions web/pages/browse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
useTrendingTopics,
useUserTrendingTopics,
} from 'web/components/search/query-topics'
import { SupabaseSearch } from 'web/components/supabase-search'
import { Search } from 'web/components/search'
import { useIsMobile } from 'web/hooks/use-is-mobile'
import { usePrivateUser, useUser } from 'web/hooks/use-user'

Expand Down Expand Up @@ -50,7 +50,7 @@ export function BrowsePageContent() {

return (
<Col className={clsx('relative col-span-8 mx-auto w-full')}>
<SupabaseSearch
<Search
persistPrefix="search"
autoFocus={autoFocus}
additionalFilter={{
Expand Down
4 changes: 2 additions & 2 deletions web/pages/topic/[topicSlug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Col } from 'web/components/layout/col'
import { Page } from 'web/components/layout/page'
import { QueryUncontrolledTabs } from 'web/components/layout/tabs'
import { RelativeTimestamp } from 'web/components/relative-timestamp'
import { SupabaseSearch } from 'web/components/supabase-search'
import { Search } from 'web/components/search'
import { QuestionsTopicTitle } from 'web/components/topics/questions-topic-title'
import { TopicSelector } from 'web/components/topics/topic-selector'
import { usePrivateUser, useUser } from 'web/hooks/use-user'
Expand Down Expand Up @@ -129,7 +129,7 @@ export default function TopicPage(props: {
{
title: 'Questions',
content: (
<SupabaseSearch
<Search
headerClassName={'bg-canvas-50'}
persistPrefix="group-search"
additionalFilter={{
Expand Down

0 comments on commit 04796da

Please sign in to comment.