-
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(protocol-designer): update mix form design (#3247)
Closes #3141
- Loading branch information
Showing
8 changed files
with
147 additions
and
105 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
37 changes: 37 additions & 0 deletions
37
protocol-designer/src/components/StepEditForm/forms/AspDispSection.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// @flow | ||
import * as React from 'react' | ||
import {IconButton, HoverTooltip} from '@opentrons/components' | ||
import i18n from '../../../localization' | ||
import styles from '../StepEditForm.css' | ||
|
||
type Props = { | ||
className?: ?string, | ||
collapsed?: ?boolean, | ||
toggleCollapsed: () => mixed, | ||
prefix: 'aspirate' | 'dispense', | ||
children?: React.Node, | ||
} | ||
|
||
function AspDispSection (props: Props) { | ||
const {children, className, collapsed, toggleCollapsed, prefix} = props | ||
|
||
return ( | ||
<div className={className}> | ||
<div className={styles.section_header}> | ||
<span className={styles.section_header_text}>{prefix}</span> | ||
<HoverTooltip | ||
key={collapsed ? 'collapsed' : 'expanded'} // NOTE: without this key, the IconButton will not re-render unless clicked | ||
tooltipComponent={i18n.t('tooltip.advanced_settings')}> | ||
{(hoverTooltipHandlers) => ( | ||
<div {...hoverTooltipHandlers} onClick={toggleCollapsed} className={styles.advanced_settings_button_wrapper}> | ||
<IconButton className={styles.advanced_settings_button} name="settings" hover={!collapsed} /> | ||
</div> | ||
)} | ||
</HoverTooltip> | ||
</div> | ||
{children} | ||
</div> | ||
) | ||
} | ||
|
||
export default AspDispSection |
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