@@ -6,10 +6,10 @@ import {
6
6
ALIGN_CENTER ,
7
7
COLORS ,
8
8
DIRECTION_COLUMN ,
9
- FLEX_MAX_CONTENT ,
10
9
Flex ,
11
10
JUSTIFY_CENTER ,
12
11
JUSTIFY_SPACE_BETWEEN ,
12
+ OVERFLOW_AUTO ,
13
13
POSITION_RELATIVE ,
14
14
SPACING ,
15
15
StyledText ,
@@ -58,7 +58,6 @@ export function ProtocolSteps(): JSX.Element {
58
58
const [ deckView , setDeckView ] = useState <
59
59
typeof leftString | typeof rightString
60
60
> ( leftString )
61
- // Note (02/03/25:kk) use DrraggableSidebar's initial width
62
61
const [ targetWidth , setTargetWidth ] = useState < number > ( 235 )
63
62
64
63
const currentHoveredStepId = useSelector ( getHoveredStepId )
@@ -82,54 +81,51 @@ export function ProtocolSteps(): JSX.Element {
82
81
backgroundColor = { COLORS . grey10 }
83
82
height = "calc(100vh - 4rem)"
84
83
width = "100%"
85
- minHeight = { FLEX_MAX_CONTENT }
86
- id = "container"
87
84
>
88
85
< Flex height = "100%" padding = { SPACING . spacing12 } >
89
86
< DraggableSidebar setTargetWidth = { setTargetWidth } />
90
87
</ Flex >
91
88
< Flex
92
- alignItems = { ALIGN_CENTER }
93
- flexDirection = { DIRECTION_COLUMN }
94
- gridGap = { SPACING . spacing16 }
95
89
flex = "2.85"
96
- paddingTop = { showTimelineAlerts ? '0' : SPACING . spacing24 }
90
+ flexDirection = { DIRECTION_COLUMN }
91
+ alignItems = { ALIGN_CENTER }
92
+ justifyContent = { JUSTIFY_CENTER }
97
93
height = "100%"
98
94
position = { POSITION_RELATIVE }
95
+ paddingTop = { showTimelineAlerts ? '0' : SPACING . spacing24 }
96
+ overflow = { OVERFLOW_AUTO }
99
97
>
100
98
< Flex
101
99
flexDirection = { DIRECTION_COLUMN }
102
100
gridGap = { SPACING . spacing24 }
103
101
width = { CONTENT_MAX_WIDTH }
104
- height = "100%"
105
102
justifyContent = { JUSTIFY_CENTER }
106
103
paddingY = { SPACING . spacing120 }
107
104
>
108
- { showTimelineAlerts ? (
105
+ { showTimelineAlerts && (
109
106
< TimelineAlerts
110
107
justifyContent = { JUSTIFY_CENTER }
111
108
width = "100%"
112
109
flexDirection = { DIRECTION_COLUMN }
113
110
gridGap = { SPACING . spacing4 }
114
111
/>
115
- ) : null }
112
+ ) }
116
113
< Flex
117
114
justifyContent = { JUSTIFY_SPACE_BETWEEN }
118
115
alignItems = { ALIGN_CENTER }
119
116
height = "2.25rem"
120
117
>
121
- { currentStep != null && hoveredTerminalItem == null ? (
118
+ { currentStep && hoveredTerminalItem == null && (
122
119
< StyledText desktopStyle = "headingSmallBold" >
123
120
{ i18n . format ( currentStep . stepName , 'titleCase' ) }
124
121
</ StyledText >
125
- ) : null }
122
+ ) }
126
123
{ ( hoveredTerminalItem != null || selectedTerminalItem != null ) &&
127
- currentHoveredStepId == null ? (
128
- < StyledText desktopStyle = "headingSmallBold" >
129
- { t ( hoveredTerminalItem ?? selectedTerminalItem ) }
130
- </ StyledText >
131
- ) : null }
132
-
124
+ currentHoveredStepId == null && (
125
+ < StyledText desktopStyle = "headingSmallBold" >
126
+ { t ( hoveredTerminalItem ?? selectedTerminalItem ) }
127
+ </ StyledText >
128
+ ) }
133
129
< ToggleGroup
134
130
selectedValue = { deckView }
135
131
leftText = { leftString }
@@ -152,7 +148,6 @@ export function ProtocolSteps(): JSX.Element {
152
148
) : (
153
149
< OffDeck tab = "protocolSteps" />
154
150
) }
155
- { /* avoid shifting the deck view container */ }
156
151
< Flex
157
152
height = "5.5rem"
158
153
opacity = { formData == null ? 1 : 0 }
@@ -165,18 +160,15 @@ export function ProtocolSteps(): JSX.Element {
165
160
</ Flex >
166
161
</ Flex >
167
162
</ Flex >
168
- { enableHotKeyDisplay ? (
169
- < HotKeyDisplay targetWidth = { targetWidth } />
170
- ) : null }
163
+ { enableHotKeyDisplay && < HotKeyDisplay targetWidth = { targetWidth } /> }
171
164
</ Flex >
172
- { formData == null && selectedSubstep ? (
173
- < SubStepsToolbox stepId = { selectedSubstep } />
174
- ) : null }
175
- < Flex padding = { SPACING . spacing12 } >
165
+ < Flex height = "100%" padding = { SPACING . spacing12 } >
176
166
< StepForm />
177
167
</ Flex >
178
-
179
- { isMultiSelectMode ? < BatchEditToolbox /> : null }
168
+ { isMultiSelectMode && < BatchEditToolbox /> }
169
+ { formData == null && selectedSubstep && (
170
+ < SubStepsToolbox stepId = { selectedSubstep } />
171
+ ) }
180
172
</ Flex >
181
173
)
182
174
}
0 commit comments