-
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.
feat(app): guide the user through leveling gen2 multis (#5348)
Adds a new flow to attach pipette that guides the user through making sure their gen2 multi pipettes are level, using the extension block and manually pulling the pipettes against it. It involves four new videos and therefore also adds webpack support for .webm files. Closes #5344
- Loading branch information
Showing
11 changed files
with
200 additions
and
21 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 |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// @flow | ||
|
||
import * as React from 'react' | ||
import cx from 'classnames' | ||
|
||
import { Icon, ModalPage, PrimaryButton } from '@opentrons/components' | ||
import styles from './styles.css' | ||
|
||
import type { | ||
PipetteNameSpecs, | ||
PipetteModelSpecs, | ||
PipetteDisplayCategory, | ||
} from '@opentrons/shared-data' | ||
|
||
import type { Mount } from '../../pipettes/types' | ||
|
||
// TODO: i18n | ||
const EXIT_BUTTON_MESSAGE = 'confirm pipette is leveled' | ||
const LEVEL_MESSAGE = (displayName: string) => `Next, level the ${displayName}` | ||
const CONNECTED_MESSAGE = (displayName: string) => `${displayName} connected` | ||
|
||
type Props = {| | ||
robotName: string, | ||
mount: Mount, | ||
title: string, | ||
subtitle: string, | ||
wantedPipette: PipetteNameSpecs | null, | ||
actualPipette: PipetteModelSpecs | null, | ||
displayName: string, | ||
displayCategory: PipetteDisplayCategory | null, | ||
pipetteModelName: string, | ||
back: () => mixed, | ||
exit: () => mixed, | ||
|} | ||
|
||
function Status(props: { displayName: string }) { | ||
const iconName = 'check-circle' | ||
const iconClass = cx(styles.confirm_icon, { | ||
[styles.success]: true, | ||
[styles.failure]: false, | ||
}) | ||
|
||
return ( | ||
<div className={styles.leveling_title}> | ||
<Icon name={iconName} className={iconClass} /> | ||
{CONNECTED_MESSAGE(props.displayName)} | ||
</div> | ||
) | ||
} | ||
|
||
function ExitButton(props: { exit: () => mixed }) { | ||
return ( | ||
<PrimaryButton className={styles.confirm_button} onClick={props.exit}> | ||
{EXIT_BUTTON_MESSAGE} | ||
</PrimaryButton> | ||
) | ||
} | ||
|
||
function LevelingInstruction(props: { displayName: string }) { | ||
return ( | ||
<div className={styles.leveling_instruction}> | ||
{LEVEL_MESSAGE(props.displayName)} | ||
</div> | ||
) | ||
} | ||
|
||
function LevelingVideo(props: { pipetteName: string, mount: Mount }) { | ||
const { pipetteName, mount } = props | ||
return ( | ||
<div className={styles.leveling_video_wrapper}> | ||
<video | ||
className={styles.leveling_video} | ||
autoPlay={true} | ||
loop={true} | ||
controls={true} | ||
> | ||
<source src={require(`./videos/${pipetteName}-${mount}.webm`)} /> | ||
</video> | ||
</div> | ||
) | ||
} | ||
|
||
export function LevelPipette(props: Props) { | ||
const { | ||
title, | ||
subtitle, | ||
pipetteModelName, | ||
displayName, | ||
mount, | ||
back, | ||
exit, | ||
} = props | ||
return ( | ||
<ModalPage | ||
titleBar={{ | ||
title: title, | ||
subtitle: subtitle, | ||
back: { onClick: back, disabled: false }, | ||
}} | ||
contentsClassName={styles.leveling_modal} | ||
> | ||
<Status displayName={displayName} /> | ||
<LevelingInstruction displayName={displayName} /> | ||
<LevelingVideo pipetteName={pipetteModelName} mount={mount} /> | ||
<ExitButton exit={exit} /> | ||
</ModalPage> | ||
) | ||
} |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
|
@@ -31,6 +31,7 @@ module.exports = { | |
rules.handlebars, | ||
rules.fonts, | ||
rules.images, | ||
rules.videos, | ||
], | ||
}, | ||
|
||
|
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