-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor LabwareField to not be a connect fnt
- Loading branch information
Showing
3 changed files
with
22 additions
and
23 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
protocol-designer/src/components/StepEditForm/fields/LabwareField.ts
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
protocol-designer/src/components/StepEditForm/fields/LabwareField.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from 'react' | ||
import { useSelector } from 'react-redux' | ||
import { | ||
getDisposalOptions, | ||
getLabwareOptions, | ||
} from '../../../ui/labware/selectors' | ||
import { StepFormDropdown } from './StepFormDropdownField' | ||
import type { FieldProps } from '../types' | ||
|
||
export const LabwareField = (props: FieldProps): JSX.Element => { | ||
const disposalOptions = useSelector(getDisposalOptions) | ||
const options = useSelector(getLabwareOptions) | ||
|
||
const allOptions = | ||
props.name === 'dispense_labware' | ||
? [...options, ...disposalOptions] | ||
: [...options] | ||
|
||
return <StepFormDropdown {...props} options={allOptions} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters