6
6
ALIGN_CENTER ,
7
7
BORDERS ,
8
8
Btn ,
9
+ LocationIcon ,
9
10
COLORS ,
10
11
DIRECTION_COLUMN ,
11
12
DIRECTION_ROW ,
@@ -14,10 +15,11 @@ import {
14
15
Icon ,
15
16
JUSTIFY_CENTER ,
16
17
JUSTIFY_SPACE_BETWEEN ,
18
+ MODULE_ICON_NAME_BY_TYPE ,
17
19
LabwareRender ,
18
20
SIZE_AUTO ,
19
21
SPACING ,
20
- LegacyStyledText ,
22
+ StyledText ,
21
23
TYPOGRAPHY ,
22
24
WELL_LABEL_OPTIONS ,
23
25
} from '@opentrons/components'
@@ -35,6 +37,7 @@ import {
35
37
} from '@opentrons/shared-data'
36
38
37
39
import { ToggleButton } from '../../../../atoms/buttons'
40
+ import { Divider } from '../../../../atoms/structure'
38
41
import { SecureLabwareModal } from './SecureLabwareModal'
39
42
40
43
import type {
@@ -58,7 +61,10 @@ const LabwareRow = styled.div`
58
61
border-width: 1px;
59
62
border-color: ${ COLORS . grey30 } ;
60
63
border-radius: ${ BORDERS . borderRadius4 } ;
61
- padding: ${ SPACING . spacing16 } ;
64
+ padding: ${ ( SPACING . spacing12 ,
65
+ SPACING . spacing16 ,
66
+ SPACING . spacing12 ,
67
+ SPACING . spacing24 ) } ;
62
68
`
63
69
64
70
interface LabwareListItemProps extends LabwareSetupItem {
@@ -67,6 +73,7 @@ interface LabwareListItemProps extends LabwareSetupItem {
67
73
isFlex : boolean
68
74
commands : RunTimeCommand [ ]
69
75
nestedLabwareInfo : NestedLabwareInfo | null
76
+ showLabwareSVG ?: boolean
70
77
}
71
78
72
79
export function LabwareListItem (
@@ -83,8 +90,9 @@ export function LabwareListItem(
83
90
isFlex,
84
91
commands,
85
92
nestedLabwareInfo,
93
+ showLabwareSVG,
86
94
} = props
87
- const { t } = useTranslation ( 'protocol_setup' )
95
+ const { i18n , t } = useTranslation ( 'protocol_setup' )
88
96
const [
89
97
secureLabwareModalType ,
90
98
setSecureLabwareModalType ,
@@ -103,10 +111,14 @@ export function LabwareListItem(
103
111
'addressableAreaName' in initialLocation
104
112
) {
105
113
slotInfo = initialLocation . addressableAreaName
114
+ } else if ( initialLocation === 'offDeck' ) {
115
+ slotInfo = i18n . format ( t ( 'off_deck' ) , 'upperCase' )
106
116
}
107
117
108
118
let moduleDisplayName : string | null = null
119
+ let moduleType : ModuleType | null = null
109
120
let extraAttentionText : JSX . Element | null = null
121
+ let secureLabwareInstructions : JSX . Element | null = null
110
122
let isCorrectHeaterShakerAttached : boolean = false
111
123
let isHeaterShakerInProtocol : boolean = false
112
124
let latchCommand :
@@ -144,7 +156,7 @@ export function LabwareListItem(
144
156
moduleModel != null
145
157
) {
146
158
const moduleName = getModuleDisplayName ( moduleModel )
147
- const moduleType = getModuleType ( moduleModel )
159
+ moduleType = getModuleType ( moduleModel )
148
160
const moduleTypeNeedsAttention = extraAttentionModules . find (
149
161
extraAttentionModType => extraAttentionModType === moduleType
150
162
)
@@ -158,7 +170,7 @@ export function LabwareListItem(
158
170
case MAGNETIC_MODULE_TYPE :
159
171
case THERMOCYCLER_MODULE_TYPE :
160
172
if ( moduleModel !== THERMOCYCLER_MODULE_V2 ) {
161
- extraAttentionText = (
173
+ secureLabwareInstructions = (
162
174
< Btn
163
175
css = { css `
164
176
color: ${ COLORS . grey50 } ;
@@ -171,19 +183,21 @@ export function LabwareListItem(
171
183
setSecureLabwareModalType ( moduleType )
172
184
} }
173
185
>
174
- < Flex flexDirection = { DIRECTION_ROW } >
186
+ < Flex flexDirection = { DIRECTION_ROW } width = "15rem" >
175
187
< Icon
176
188
name = "information"
177
189
size = "0.75rem"
178
190
marginTop = { SPACING . spacing4 }
191
+ color = { COLORS . grey60 }
179
192
/>
180
- < LegacyStyledText
193
+ < StyledText
181
194
marginLeft = { SPACING . spacing4 }
182
- as = "p "
195
+ desktopStyle = "bodyDefaultRegular "
183
196
textDecoration = { TYPOGRAPHY . textDecorationUnderline }
197
+ color = { COLORS . grey60 }
184
198
>
185
199
{ t ( 'secure_labware_instructions' ) }
186
- </ LegacyStyledText >
200
+ </ StyledText >
187
201
</ Flex >
188
202
</ Btn >
189
203
)
@@ -192,9 +206,9 @@ export function LabwareListItem(
192
206
case HEATERSHAKER_MODULE_TYPE :
193
207
isHeaterShakerInProtocol = true
194
208
extraAttentionText = (
195
- < LegacyStyledText as = "p " color = { COLORS . grey50 } maxWidth = "15.25rem" >
209
+ < StyledText desktopStyle = "bodyDefaultRegular " color = { COLORS . grey60 } >
196
210
{ t ( 'heater_shaker_labware_list_view' ) }
197
- </ LegacyStyledText >
211
+ </ StyledText >
198
212
)
199
213
const matchingHeaterShaker =
200
214
attachedModuleInfo != null &&
@@ -256,96 +270,128 @@ export function LabwareListItem(
256
270
257
271
return (
258
272
< LabwareRow >
259
- < Flex alignItems = { ALIGN_CENTER } >
260
- < LegacyStyledText as = "p" data-testid = { `slot_info_${ slotInfo } ` } >
261
- { slotInfo }
262
- </ LegacyStyledText >
273
+ < Flex alignItems = { ALIGN_CENTER } width = "80px" gridGap = { SPACING . spacing2 } >
274
+ { slotInfo != null && isFlex ? (
275
+ < LocationIcon slotName = { slotInfo } />
276
+ ) : (
277
+ < StyledText
278
+ css = { TYPOGRAPHY . pSemiBold }
279
+ data-testid = { `slot_info_${ slotInfo } ` }
280
+ >
281
+ { slotInfo }
282
+ </ StyledText >
283
+ ) }
284
+ { nestedLabwareInfo != null || moduleDisplayName != null ? (
285
+ < LocationIcon iconName = "stacked" />
286
+ ) : null }
263
287
</ Flex >
264
- < Flex flexDirection = { DIRECTION_COLUMN } gridGap = { SPACING . spacing16 } >
288
+ < Flex
289
+ flexDirection = { DIRECTION_COLUMN }
290
+ gridGap = { SPACING . spacing16 }
291
+ width = "45.875rem"
292
+ >
265
293
< Flex >
266
- < StandaloneLabware definition = { definition } />
294
+ { showLabwareSVG && < StandaloneLabware definition = { definition } /> }
267
295
< Flex
268
296
flexDirection = { DIRECTION_COLUMN }
269
297
justifyContent = { JUSTIFY_CENTER }
270
- marginLeft = { SPACING . spacing16 }
298
+ marginLeft = { SPACING . spacing8 }
271
299
marginRight = { SPACING . spacing24 }
272
300
>
273
- < LegacyStyledText as = "p" fontWeight = { TYPOGRAPHY . fontWeightSemiBold } >
301
+ < StyledText desktopStyle = "bodyDefaultSemiBold" >
274
302
{ labwareDisplayName }
275
- </ LegacyStyledText >
276
- < LegacyStyledText as = "p " color = { COLORS . grey50 } >
303
+ </ StyledText >
304
+ < StyledText desktopStyle = "bodyDefaultRegular " color = { COLORS . grey60 } >
277
305
{ nickName }
278
- </ LegacyStyledText >
306
+ </ StyledText >
279
307
</ Flex >
280
308
</ Flex >
281
309
{ nestedLabwareInfo != null &&
282
310
nestedLabwareInfo ?. sharedSlotId === slotInfo ? (
283
- < Flex >
284
- { nestedLabwareInfo . nestedLabwareDefinition != null ? (
285
- < StandaloneLabware
286
- definition = { nestedLabwareInfo . nestedLabwareDefinition }
287
- />
288
- ) : null }
289
- < Flex
290
- flexDirection = { DIRECTION_COLUMN }
291
- justifyContent = { JUSTIFY_CENTER }
292
- marginLeft = { SPACING . spacing16 }
293
- marginRight = { SPACING . spacing24 }
294
- >
295
- < LegacyStyledText
296
- as = "p"
297
- fontWeight = { TYPOGRAPHY . fontWeightSemiBold }
311
+ < >
312
+ < Divider />
313
+ < Flex >
314
+ < Flex
315
+ flexDirection = { DIRECTION_COLUMN }
316
+ justifyContent = { JUSTIFY_CENTER }
317
+ marginLeft = { SPACING . spacing8 }
318
+ marginRight = { SPACING . spacing24 }
298
319
>
299
- { nestedLabwareInfo . nestedLabwareDisplayName }
300
- </ LegacyStyledText >
301
- < LegacyStyledText as = "p" color = { COLORS . grey50 } >
302
- { nestedLabwareInfo . nestedLabwareNickName }
303
- </ LegacyStyledText >
320
+ < StyledText desktopStyle = "bodyDefaultSemiBold" >
321
+ { nestedLabwareInfo . nestedLabwareDisplayName }
322
+ </ StyledText >
323
+ < StyledText
324
+ desktopStyle = "bodyDefaultRegular"
325
+ color = { COLORS . grey60 }
326
+ >
327
+ { nestedLabwareInfo . nestedLabwareNickName }
328
+ </ StyledText >
329
+ </ Flex >
304
330
</ Flex >
305
- </ Flex >
331
+ </ >
306
332
) : null }
307
- </ Flex >
308
- < Flex
309
- justifyContent = { JUSTIFY_SPACE_BETWEEN }
310
- alignItems = { ALIGN_CENTER }
311
- gridGap = { SPACING . spacing8 }
312
- >
313
- < Flex flexDirection = { DIRECTION_COLUMN } justifyContent = { JUSTIFY_CENTER } >
314
- < LegacyStyledText as = "p" >
315
- { moduleDisplayName != null
316
- ? moduleDisplayName
317
- : t ( initialLocation === 'offDeck' ? 'off_deck' : 'on_deck' ) }
318
- </ LegacyStyledText >
319
- { extraAttentionText != null ? extraAttentionText : null }
320
- </ Flex >
321
-
322
- { isHeaterShakerInProtocol ? (
323
- < Flex flexDirection = { DIRECTION_COLUMN } >
324
- < LegacyStyledText as = "h6" minWidth = "6.2rem" >
325
- { t ( 'labware_latch' ) }
326
- </ LegacyStyledText >
333
+ { moduleDisplayName != null ? (
334
+ < >
335
+ < Divider />
327
336
< Flex
328
- flexDirection = { DIRECTION_ROW }
329
- alignItems = { ALIGN_CENTER }
330
337
justifyContent = { JUSTIFY_SPACE_BETWEEN }
331
- marginTop = "3px"
338
+ flexDirection = { DIRECTION_ROW }
339
+ marginLeft = { SPACING . spacing8 }
340
+ paddingRight = { SPACING . spacing24 }
341
+ gridGap = { SPACING . spacing8 }
332
342
>
333
- < ToggleButton
334
- label = { `heater_shaker_${
335
- moduleLocation ?. slotName ?? ''
336
- } _latch_toggle`}
337
- size = { SIZE_AUTO }
338
- disabled = { ! isCorrectHeaterShakerAttached || isLatchLoading }
339
- toggledOn = { isLatchClosed }
340
- onClick = { toggleLatch }
341
- display = { DISPLAY_FLEX }
342
- alignItems = { ALIGN_CENTER }
343
- />
344
- < LegacyStyledText as = "p" width = "4rem" >
345
- { hsLatchText }
346
- </ LegacyStyledText >
343
+ < Flex gridGap = { SPACING . spacing12 } alignItems = { ALIGN_CENTER } >
344
+ { moduleType != null ? (
345
+ < LocationIcon
346
+ iconName = { MODULE_ICON_NAME_BY_TYPE [ moduleType ] }
347
+ />
348
+ ) : null }
349
+ < Flex
350
+ flexDirection = { DIRECTION_COLUMN }
351
+ justifyContent = { JUSTIFY_CENTER }
352
+ >
353
+ < StyledText desktopStyle = "bodyDefaultSemiBold" >
354
+ { moduleDisplayName }
355
+ </ StyledText >
356
+ { extraAttentionText }
357
+ </ Flex >
358
+ </ Flex >
359
+ { secureLabwareInstructions }
360
+ { isHeaterShakerInProtocol ? (
361
+ < Flex flexDirection = { DIRECTION_COLUMN } width = "15rem" >
362
+ < StyledText
363
+ desktopStyle = "bodyDefaultRegular"
364
+ color = { COLORS . grey60 }
365
+ minWidth = "6.2rem"
366
+ >
367
+ { t ( 'labware_latch' ) }
368
+ </ StyledText >
369
+ < Flex
370
+ flexDirection = { DIRECTION_ROW }
371
+ gridGap = { SPACING . spacing4 }
372
+ marginTop = "3px"
373
+ >
374
+ < ToggleButton
375
+ label = { `heater_shaker_${
376
+ moduleLocation ?. slotName ?? ''
377
+ } _latch_toggle`}
378
+ size = { SIZE_AUTO }
379
+ disabled = {
380
+ ! isCorrectHeaterShakerAttached || isLatchLoading
381
+ }
382
+ toggledOn = { isLatchClosed }
383
+ onClick = { toggleLatch }
384
+ display = { DISPLAY_FLEX }
385
+ alignItems = { ALIGN_CENTER }
386
+ />
387
+ < StyledText desktopStyle = "bodyDefaultRegular" width = "4rem" >
388
+ { hsLatchText }
389
+ </ StyledText >
390
+ </ Flex >
391
+ </ Flex >
392
+ ) : null }
347
393
</ Flex >
348
- </ Flex >
394
+ </ >
349
395
) : null }
350
396
</ Flex >
351
397
{ secureLabwareModalType != null && (
0 commit comments