-
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(protocol-designer): refactor PD labware components for reada…
…bility (#2390)
- Loading branch information
Showing
10 changed files
with
245 additions
and
237 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
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
33 changes: 16 additions & 17 deletions
33
protocol-designer/src/components/labware/DisabledSelectSlotOverlay.js
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 |
---|---|---|
@@ -1,26 +1,25 @@ | ||
// @flow | ||
import React from 'react' | ||
import cx from 'classnames' | ||
import {HandleKeypress, type DeckSlot} from '@opentrons/components' | ||
import {HandleKeypress} from '@opentrons/components' | ||
import styles from './labware.css' | ||
|
||
type DisabledSelectSlotOverlayProps = {setMoveLabwareMode: (slot: ?DeckSlot) => void} | ||
class DisabledSelectSlotOverlay extends React.Component<DisabledSelectSlotOverlayProps> { | ||
cancelMove = () => { | ||
this.props.setMoveLabwareMode() | ||
} | ||
render () { | ||
return ( | ||
<HandleKeypress preventDefault handlers={[{key: 'Escape', onPress: this.cancelMove}]}> | ||
<g className={cx(styles.slot_overlay, styles.disabled)}> | ||
<rect className={styles.overlay_panel} /> | ||
<g className={styles.clickable_text}> | ||
<text x="0" y="40%">Select a slot</text> | ||
</g> | ||
type Props = { | ||
cancelMove: () => mixed, | ||
} | ||
|
||
function DisabledSelectSlotOverlay (props: Props) { | ||
const {cancelMove} = props | ||
return ( | ||
<HandleKeypress preventDefault handlers={[{key: 'Escape', onPress: cancelMove}]}> | ||
<g className={cx(styles.slot_overlay, styles.disabled)}> | ||
<rect className={styles.overlay_panel} /> | ||
<g className={styles.clickable_text}> | ||
<text x="0" y="40%">Select a slot</text> | ||
</g> | ||
</HandleKeypress> | ||
) | ||
} | ||
</g> | ||
</HandleKeypress> | ||
) | ||
} | ||
|
||
export default DisabledSelectSlotOverlay |
Oops, something went wrong.