Skip to content

Commit

Permalink
10409: WIP trying to type selectsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Rogers committed Sep 23, 2024
1 parent c1a68df commit 7e4f101
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
22 changes: 22 additions & 0 deletions web-client/src/ustc-ui/Select/SelectSearch2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import ReactSelect, { GroupBase, Props } from 'react-select';
import classNames from 'classnames';

export function SelectSearch2<
Option,
IsMulti extends boolean = false,
Group extends GroupBase<Option> = GroupBase<Option>,
>(props: Props<Option, IsMulti, Group>) {
return (
<div data-testid={props['data-testid']}>
<ReactSelect
{...props}
className={classNames('select-react-element', props.className)}
classNamePrefix={'select-react-element'}
placeholder={props.placeholder || '- Select -'}
/>
</div>
);
}

SelectSearch2.displayName = 'SelectSearch2';
8 changes: 4 additions & 4 deletions web-client/src/views/TrialSessions/TrialSessions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TRIAL_SESSION_PROCEEDING_TYPES,
TrialSessionProceedingType,
} from '@shared/business/entities/EntityConstants';
import { SelectSearch } from '@web-client/ustc-ui/Select/SelectSearch';
import { SelectSearch2 } from '@web-client/ustc-ui/Select/SelectSearch2';
import { SuccessNotification } from '../SuccessNotification';
import { Tab, Tabs } from '../../ustc-ui/Tabs/Tabs';
import { TrialSessionsTable } from './TrialSessionsTable';
Expand Down Expand Up @@ -284,7 +284,7 @@ const TrialSessionFilters = connect(
Session type{' '}
<span className="optional-light-text">(optional)</span>
</label>
<SelectSearch
<SelectSearch2
id="session-type-filter"
name="sessionType"
options={trialSessionsHelper.sessionTypeOptions}
Expand Down Expand Up @@ -324,7 +324,7 @@ const TrialSessionFilters = connect(
<label className="usa-label" htmlFor="location-filter">
Location <span className="optional-light-text">(optional)</span>
</label>
<SelectSearch
<SelectSearch2
id="location-filter"
name="location"
options={trialSessionsHelper.trialCitiesByState}
Expand Down Expand Up @@ -367,7 +367,7 @@ const TrialSessionFilters = connect(
<label className="usa-label" htmlFor="judge-filter">
Judge <span className="optional-light-text">(optional)</span>
</label>
<SelectSearch
<SelectSearch2
id="judges"
name="judges"
options={trialSessionsHelper.trialSessionJudgeOptions}
Expand Down

0 comments on commit 7e4f101

Please sign in to comment.