-
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.
Merge branch 'edge' into feat_add-prompt-button
- Loading branch information
Showing
33 changed files
with
774 additions
and
477 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -3989,5 +3989,6 @@ | |
} | ||
] | ||
} | ||
] | ||
], | ||
"robotType": "OT-2 Standard" | ||
} |
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
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
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
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
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,80 @@ | ||
import * as React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { Flex, SPACING, DIRECTION_COLUMN } from '@opentrons/components' | ||
import { getAllDefinitions } from '@opentrons/shared-data' | ||
import { SmallButton, LargeButton } from '../../atoms/buttons' | ||
import { ChildNavigation } from '../ChildNavigation' | ||
|
||
import type { LabwareDefinition2 } from '@opentrons/shared-data' | ||
import type { | ||
QuickTransferSetupState, | ||
QuickTransferWizardAction, | ||
} from './types' | ||
|
||
interface SelectTipRackProps { | ||
onNext: () => void | ||
onBack: () => void | ||
exitButtonProps: React.ComponentProps<typeof SmallButton> | ||
state: QuickTransferSetupState | ||
dispatch: React.Dispatch<QuickTransferWizardAction> | ||
} | ||
|
||
export function SelectTipRack(props: SelectTipRackProps): JSX.Element { | ||
const { onNext, onBack, exitButtonProps, state, dispatch } = props | ||
const { i18n, t } = useTranslation(['quick_transfer', 'shared']) | ||
|
||
const allLabwareDefinitionsByUri = getAllDefinitions() | ||
const selectedPipetteDefaultTipracks = | ||
state.pipette?.liquids.default.defaultTipracks ?? [] | ||
|
||
const [selectedTipRack, setSelectedTipRack] = React.useState< | ||
LabwareDefinition2 | undefined | ||
>(state.tipRack) | ||
|
||
const handleClickNext = (): void => { | ||
// the button will be disabled if this values is null | ||
if (selectedTipRack != null) { | ||
dispatch({ | ||
type: 'SELECT_TIP_RACK', | ||
tipRack: selectedTipRack, | ||
}) | ||
onNext() | ||
} | ||
} | ||
return ( | ||
<Flex> | ||
<ChildNavigation | ||
header={t('select_tip_rack')} | ||
buttonText={i18n.format(t('shared:continue'), 'capitalize')} | ||
onClickBack={onBack} | ||
onClickButton={handleClickNext} | ||
secondaryButtonProps={exitButtonProps} | ||
top={SPACING.spacing8} | ||
buttonIsDisabled={selectedTipRack == null} | ||
/> | ||
<Flex | ||
marginTop={SPACING.spacing120} | ||
flexDirection={DIRECTION_COLUMN} | ||
padding={`${SPACING.spacing16} ${SPACING.spacing60} ${SPACING.spacing40} ${SPACING.spacing60}`} | ||
gridGap={SPACING.spacing4} | ||
width="100%" | ||
> | ||
{selectedPipetteDefaultTipracks.map(tipRack => { | ||
const tipRackDef = allLabwareDefinitionsByUri[tipRack] | ||
|
||
return tipRackDef != null ? ( | ||
<LargeButton | ||
buttonType={ | ||
selectedTipRack === tipRackDef ? 'primary' : 'secondary' | ||
} | ||
onClick={() => { | ||
setSelectedTipRack(tipRackDef) | ||
}} | ||
buttonText={tipRackDef.metadata.displayName} | ||
/> | ||
) : null | ||
})} | ||
</Flex> | ||
</Flex> | ||
) | ||
} |
Oops, something went wrong.