Skip to content

Commit bec8e23

Browse files
authored
fix(app): 6.0 overall design QA (#11081)
1 parent 1b1f84e commit bec8e23

File tree

10 files changed

+25
-51
lines changed

10 files changed

+25
-51
lines changed

app/src/App/Navbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const NavbarLink = styled(NavLink)`
3333
background-color: ${COLORS.darkBlack};
3434
3535
&:hover {
36-
background-color: ${COLORS.darkGreyHover};
36+
background-color: ${COLORS.darkBlackHover};
3737
}
3838
3939
&:focus-visible {
@@ -80,7 +80,7 @@ const NavbarIcon = styled(Icon)`
8080
background-color: ${COLORS.transparent};
8181
8282
&:hover {
83-
background-color: ${COLORS.darkGreyHover};
83+
background-color: ${COLORS.darkBlackHover};
8484
}
8585
8686
&:focus-visible {

app/src/organisms/Devices/PipettesAndModules.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { ModuleCard } from '../ModuleCard'
2525
import { useIsRobotViewable, useRunStatuses } from './hooks'
2626
import { PipetteCard } from './PipetteCard'
2727

28-
const MIN_HEIGHT_OVER_3_STYLING = css`
28+
export const MIN_HEIGHT_OVER_3_STYLING = css`
2929
max-height: 37rem;
3030
3131
@media (min-width: 700px) {
@@ -41,7 +41,7 @@ const MIN_HEIGHT_OVER_3_STYLING = css`
4141
}
4242
`
4343

44-
const MIN_HEIGHT_UNDER_3_STYLING = css`
44+
export const MIN_HEIGHT_UNDER_3_STYLING = css`
4545
max-height: 29rem;
4646
4747
@media (min-width: 700px) {

app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ export function ProtocolRunHeader({
439439
</StyledText>
440440
</Box>
441441
<Box marginLeft={SPACING_AUTO}>
442-
{showCancelButton != null && (
442+
{showCancelButton && (
443443
<SecondaryButton
444444
style={{
445445
color: `${COLORS.errorText}`,

app/src/organisms/Devices/ProtocolRun/ProtocolRunModuleControls.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import { useCreateCommandMutation } from '@opentrons/react-api-client'
1515

1616
import type { LoadModuleRunTimeCommand } from '@opentrons/shared-data/protocol/types/schemaV6/command/setup'
1717
import type { RunTimeCommand } from '@opentrons/shared-data'
18+
import {
19+
MIN_HEIGHT_OVER_3_STYLING,
20+
MIN_HEIGHT_UNDER_3_STYLING,
21+
} from '../PipettesAndModules'
1822

1923
interface ProtocolRunModuleControlsProps {
2024
robotName: string
@@ -70,15 +74,19 @@ export const ProtocolRunModuleControls = ({
7074

7175
return (
7276
<Flex
73-
width={attachedModules.length === 1 ? '100%' : '50%'}
7477
justifyContent={JUSTIFY_START}
7578
flexWrap={WRAP}
7679
flexDirection={DIRECTION_COLUMN}
77-
maxHeight="25rem"
80+
css={
81+
attachedModules.length > 3
82+
? MIN_HEIGHT_OVER_3_STYLING
83+
: MIN_HEIGHT_UNDER_3_STYLING
84+
}
7885
>
7986
{attachedModules.map((module, index) => {
8087
return (
8188
<Flex
89+
width={`calc(50% - ${SPACING.spacing3})`}
8290
marginTop={SPACING.spacing3}
8391
marginX={SPACING.spacing2}
8492
key={`moduleCard_${module.moduleDef.moduleType}_${index}`}

app/src/organisms/LabwareCard/__tests__/LabwareCard.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ describe('LabwareCard', () => {
3838

3939
it('renders correct info for opentrons labware card', () => {
4040
props.labware.definition.namespace = 'opentrons'
41-
const [{ getByText, getByRole }] = render(props)
41+
const [{ getByText }] = render(props)
4242
getByText('mock RobotWorkSpace')
4343
getByText('Well Plate')
4444
getByText('Mock Definition')
4545
getByText(`Opentrons Definition`)
4646
getByText('API Name')
47-
getByRole('button', { name: 'mock_definition' })
4847
})
4948

5049
it('renders additional info for custom labware card', () => {

app/src/organisms/LabwareCard/index.tsx

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ import * as React from 'react'
22
import { useTranslation } from 'react-i18next'
33
import startCase from 'lodash/startCase'
44
import { format } from 'date-fns'
5-
import { css } from 'styled-components'
65

76
import {
87
Box,
98
Flex,
109
Icon,
11-
Link,
1210
LabwareRender,
1311
RobotWorkSpace,
1412
SPACING,
@@ -19,27 +17,13 @@ import {
1917
DIRECTION_COLUMN,
2018
ALIGN_FLEX_END,
2119
ALIGN_CENTER,
22-
SIZE_1,
23-
POSITION_RELATIVE,
2420
} from '@opentrons/components'
2521

2622
import { StyledText } from '../../atoms/text'
2723
import { CustomLabwareOverflowMenu } from './CustomLabwareOverflowMenu'
2824

2925
import type { LabwareDefAndDate } from '../../pages/Labware/hooks'
3026

31-
const COPY_ICON_STYLE = css`
32-
color: ${COLORS.darkGreyEnabled};
33-
34-
position: ${POSITION_RELATIVE};
35-
top: ${SPACING.spacing1};
36-
left: ${SPACING.spacing2};
37-
38-
&:hover {
39-
color: ${COLORS.black};
40-
}
41-
`
42-
4327
export interface LabwareCardProps {
4428
labware: LabwareDefAndDate
4529
onClick: () => void
@@ -53,11 +37,6 @@ export function LabwareCard(props: LabwareCardProps): JSX.Element {
5337
const displayCategory = startCase(definition.metadata.displayCategory)
5438
const isCustomDefinition = definition.namespace !== 'opentrons'
5539

56-
const handleCopyClick = async (e: React.MouseEvent): Promise<void> => {
57-
e.stopPropagation()
58-
await navigator.clipboard.writeText(apiName)
59-
}
60-
6140
return (
6241
<Box
6342
role="link"
@@ -132,21 +111,9 @@ export function LabwareCard(props: LabwareCardProps): JSX.Element {
132111
>
133112
{t('api_name')}
134113
</StyledText>
135-
<Link
136-
css={TYPOGRAPHY.pRegular}
137-
onClick={handleCopyClick}
138-
role="button"
139-
>
140-
<Box overflowWrap="anywhere">
141-
{apiName}
142-
<Icon
143-
height={SIZE_1}
144-
name="copy-text"
145-
aria-label="copy-text"
146-
css={COPY_ICON_STYLE}
147-
/>
148-
</Box>
149-
</Link>
114+
<StyledText as="p">
115+
<Box overflowWrap="anywhere">{apiName}</Box>
116+
</StyledText>
150117
</Box>
151118
</Flex>
152119
</Box>

app/src/pages/Labware/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export function Labware(): JSX.Element {
179179
position={POSITION_ABSOLUTE}
180180
backgroundColor={COLORS.white}
181181
top="8.5rem"
182-
right={0}
182+
right={SPACING.spacing1}
183183
flexDirection={DIRECTION_COLUMN}
184184
ref={sortOverflowWrapperRef}
185185
>

components/src/__tests__/__snapshots__/icons.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,11 +1795,11 @@ exports[`icons ot-toggle-input-on renders correctly 1`] = `
17951795
className="sc-fznyAO c0 foo"
17961796
fill="currentColor"
17971797
version="1.1"
1798-
viewBox="0 0 22 14"
1798+
viewBox="0 0 22 13"
17991799
xmlns="http://www.w3.org/2000/svg"
18001800
>
18011801
<path
1802-
d="M15.5.5h-9C2.9.5 0 3.4 0 7s2.9 6.5 6.5 6.5h9c3.6 0 6.5-2.9 6.5-6.5S19.1.5 15.5.5zm0 11C13 11.5 11 9.5 11 7s2-4.5 4.5-4.5S20 4.5 20 7s-2 4.5-4.5 4.5z"
1802+
d="M 20,6.5 A 4.5,4.5 0 0 1 15.5,11 4.5,4.5 0 0 1 11,6.5 4.5,4.5 0 0 1 15.5,2 4.5,4.5 0 0 1 20,6.5 Z M 6.5,0 h 9 C 19.101,0 22,2.899 22,6.5 22,10.101 19.101,13 15.5,13 h -9 C 2.899,13 0,10.101 0,6.5 0,2.899 2.899,0 6.5,0 Z"
18031803
fillRule="evenodd"
18041804
/>
18051805
</svg>

components/src/icons/icon-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,9 @@ export const ICON_DATA_BY_NAME = {
440440
'M15.5 0h-9C2.9 0 0 2.9 0 6.5S2.9 13 6.5 13h9c3.6 0 6.5-2.9 6.5-6.5S19.1 0 15.5 0zm-9 11C4 11 2 9 2 6.5S4 2 6.5 2 11 4 11 6.5 9 11 6.5 11z',
441441
},
442442
'ot-toggle-input-on': {
443-
viewBox: '0 0 22 14',
443+
viewBox: '0 0 22 13',
444444
path:
445-
'M15.5.5h-9C2.9.5 0 3.4 0 7s2.9 6.5 6.5 6.5h9c3.6 0 6.5-2.9 6.5-6.5S19.1.5 15.5.5zm0 11C13 11.5 11 9.5 11 7s2-4.5 4.5-4.5S20 4.5 20 7s-2 4.5-4.5 4.5z',
445+
'M 20,6.5 A 4.5,4.5 0 0 1 15.5,11 4.5,4.5 0 0 1 11,6.5 4.5,4.5 0 0 1 15.5,2 4.5,4.5 0 0 1 20,6.5 Z M 6.5,0 h 9 C 19.101,0 22,2.899 22,6.5 22,10.101 19.101,13 15.5,13 h -9 C 2.899,13 0,10.101 0,6.5 0,2.899 2.899,0 6.5,0 Z',
446446
},
447447
gear: {
448448
viewBox: '0 0 20 20',

components/src/ui-style-constants/colors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const medBlue = '#d9e9fe'
1717
export const disabled = '#a0a0a0'
1818
export const medGreyHover = '#b8b8b8'
1919
export const darkBlack = '#16212D'
20-
export const darkBlackHover = '#24313f'
20+
export const darkBlackHover = '#24313F'
2121
export const darkBlackPressed = '#16212D'
2222
export const darkBlackSelected = '#39495B'
2323
// note: darkBlackDisabled = greyDisabled

0 commit comments

Comments
 (0)