-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): Show connect modules modal when session modules detected (#…
- Loading branch information
Showing
21 changed files
with
306 additions
and
100 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,48 @@ | ||
// @flow | ||
// prompt for ReviewModulesModal of labware calibration page | ||
import * as React from 'react' | ||
|
||
import {OutlineButton, AlertItem} from '@opentrons/components' | ||
|
||
import styles from './styles.css' | ||
|
||
type Props = { | ||
modulesMissing: boolean, | ||
onClick: () => mixed, | ||
} | ||
|
||
const missingAlertProps = { | ||
type: 'warning', | ||
title: 'Module Missing', | ||
className: styles.alert | ||
} | ||
|
||
const connectedAlertProps = { | ||
type: 'success', | ||
title: 'Module succesfully detected.', | ||
className: styles.alert | ||
} | ||
|
||
export default function Prompt (props: Props) { | ||
const {modulesMissing, onClick} = props | ||
const alert = modulesMissing | ||
? <AlertItem {...missingAlertProps}/> | ||
: <AlertItem {...connectedAlertProps}/> | ||
const message = modulesMissing | ||
? 'Plug in and power up the required module via USB to your robot.' | ||
: 'Module succesfully detected.' | ||
const buttonText = modulesMissing | ||
? 'try searching for missing module' | ||
: 'continue to labware setup' | ||
return ( | ||
<div className={styles.prompt}> | ||
{alert} | ||
<p className={styles.prompt_text}> | ||
{message} | ||
</p> | ||
<OutlineButton className={styles.prompt_button} onClick={onClick} inverted> | ||
{buttonText} | ||
</OutlineButton> | ||
</div> | ||
) | ||
} |
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,17 @@ | ||
// @flow | ||
import * as React from 'react' | ||
import {Modal} from '../modals' | ||
import Prompt from './Prompt' | ||
|
||
type Props = { | ||
modulesMissing: boolean, | ||
onClick: () => mixed, | ||
} | ||
|
||
export default function ConnectModulesModal (props: Props) { | ||
return ( | ||
<Modal> | ||
<Prompt {...props}/> | ||
</Modal> | ||
) | ||
} |
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,28 @@ | ||
@import '@opentrons/components'; | ||
|
||
.alert { | ||
position: absolute; | ||
top: 3rem; | ||
left: 0; | ||
right: 0; | ||
} | ||
|
||
.prompt { | ||
padding-top: 2rem; | ||
} | ||
|
||
.prompt_text { | ||
@apply --font-header-light; | ||
|
||
font-weight: normal; | ||
margin-bottom: 1rem; | ||
text-align: center; | ||
} | ||
|
||
.prompt_button { | ||
display: block; | ||
width: auto; | ||
margin: 1rem auto; | ||
padding-left: 3rem; | ||
padding-right: 3rem; | ||
} |
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
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,6 +1,6 @@ | ||
// @flow | ||
// app specific modals | ||
|
||
import Modal from './Modal' | ||
import ErrorModal from './ErrorModal' | ||
|
||
export {ErrorModal} | ||
export {Modal, ErrorModal} |
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,3 +1,24 @@ | ||
@import '@opentrons/components'; | ||
|
||
.modal { | ||
@apply --modal; | ||
|
||
flex-direction: column; | ||
justify-content: flex-start; | ||
padding: 4rem 2rem 2rem; | ||
} | ||
|
||
.modal * { | ||
z-index: 1; | ||
} | ||
|
||
.error_modal_message { | ||
font-style: italic; | ||
} | ||
|
||
.title_bar { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
} |
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
Oops, something went wrong.