Skip to content

Commit 9213fe5

Browse files
committed
1 parent 3d7750c commit 9213fe5

File tree

2 files changed

+22
-34
lines changed

2 files changed

+22
-34
lines changed

protocol-designer/src/components/organisms/OffDeck/OffDeckDetails.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ export function OffDeckDetails(props: OffDeckDetailsProps): JSX.Element {
7979
<Flex
8080
flex="0 0 auto"
8181
width={OFF_DECK_MAP_WIDTH}
82-
height={
83-
tab === 'startingDeck'
84-
? OFF_DECK_MAP_HEIGHT
85-
: OFF_DECK_MAP_HEIGHT_FOR_STEP
86-
}
82+
height="100%"
8783
alignItems={ALIGN_CENTER}
8884
borderRadius={SPACING.spacing12}
8985
padding={`${SPACING.spacing16} ${SPACING.spacing40}`}

protocol-designer/src/pages/Designer/ProtocolSteps/index.tsx

+21-29
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import {
66
ALIGN_CENTER,
77
COLORS,
88
DIRECTION_COLUMN,
9-
FLEX_MAX_CONTENT,
109
Flex,
1110
JUSTIFY_CENTER,
1211
JUSTIFY_SPACE_BETWEEN,
12+
OVERFLOW_AUTO,
1313
POSITION_RELATIVE,
1414
SPACING,
1515
StyledText,
@@ -58,7 +58,6 @@ export function ProtocolSteps(): JSX.Element {
5858
const [deckView, setDeckView] = useState<
5959
typeof leftString | typeof rightString
6060
>(leftString)
61-
// Note (02/03/25:kk) use DrraggableSidebar's initial width
6261
const [targetWidth, setTargetWidth] = useState<number>(235)
6362

6463
const currentHoveredStepId = useSelector(getHoveredStepId)
@@ -82,54 +81,51 @@ export function ProtocolSteps(): JSX.Element {
8281
backgroundColor={COLORS.grey10}
8382
height="calc(100vh - 4rem)"
8483
width="100%"
85-
minHeight={FLEX_MAX_CONTENT}
86-
id="container"
8784
>
8885
<Flex height="100%" padding={SPACING.spacing12}>
8986
<DraggableSidebar setTargetWidth={setTargetWidth} />
9087
</Flex>
9188
<Flex
92-
alignItems={ALIGN_CENTER}
93-
flexDirection={DIRECTION_COLUMN}
94-
gridGap={SPACING.spacing16}
9589
flex="2.85"
96-
paddingTop={showTimelineAlerts ? '0' : SPACING.spacing24}
90+
flexDirection={DIRECTION_COLUMN}
91+
alignItems={ALIGN_CENTER}
92+
justifyContent={JUSTIFY_CENTER}
9793
height="100%"
9894
position={POSITION_RELATIVE}
95+
paddingTop={showTimelineAlerts ? '0' : SPACING.spacing24}
96+
overflow={OVERFLOW_AUTO}
9997
>
10098
<Flex
10199
flexDirection={DIRECTION_COLUMN}
102100
gridGap={SPACING.spacing24}
103101
width={CONTENT_MAX_WIDTH}
104-
height="100%"
105102
justifyContent={JUSTIFY_CENTER}
106103
paddingY={SPACING.spacing120}
107104
>
108-
{showTimelineAlerts ? (
105+
{showTimelineAlerts && (
109106
<TimelineAlerts
110107
justifyContent={JUSTIFY_CENTER}
111108
width="100%"
112109
flexDirection={DIRECTION_COLUMN}
113110
gridGap={SPACING.spacing4}
114111
/>
115-
) : null}
112+
)}
116113
<Flex
117114
justifyContent={JUSTIFY_SPACE_BETWEEN}
118115
alignItems={ALIGN_CENTER}
119116
height="2.25rem"
120117
>
121-
{currentStep != null && hoveredTerminalItem == null ? (
118+
{currentStep && hoveredTerminalItem == null && (
122119
<StyledText desktopStyle="headingSmallBold">
123120
{i18n.format(currentStep.stepName, 'titleCase')}
124121
</StyledText>
125-
) : null}
122+
)}
126123
{(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+
)}
133129
<ToggleGroup
134130
selectedValue={deckView}
135131
leftText={leftString}
@@ -152,7 +148,6 @@ export function ProtocolSteps(): JSX.Element {
152148
) : (
153149
<OffDeck tab="protocolSteps" />
154150
)}
155-
{/* avoid shifting the deck view container */}
156151
<Flex
157152
height="5.5rem"
158153
opacity={formData == null ? 1 : 0}
@@ -165,18 +160,15 @@ export function ProtocolSteps(): JSX.Element {
165160
</Flex>
166161
</Flex>
167162
</Flex>
168-
{enableHotKeyDisplay ? (
169-
<HotKeyDisplay targetWidth={targetWidth} />
170-
) : null}
163+
{enableHotKeyDisplay && <HotKeyDisplay targetWidth={targetWidth} />}
171164
</Flex>
172-
{formData == null && selectedSubstep ? (
173-
<SubStepsToolbox stepId={selectedSubstep} />
174-
) : null}
175-
<Flex padding={SPACING.spacing12}>
165+
<Flex height="100%" padding={SPACING.spacing12}>
176166
<StepForm />
177167
</Flex>
178-
179-
{isMultiSelectMode ? <BatchEditToolbox /> : null}
168+
{isMultiSelectMode && <BatchEditToolbox />}
169+
{formData == null && selectedSubstep && (
170+
<SubStepsToolbox stepId={selectedSubstep} />
171+
)}
180172
</Flex>
181173
)
182174
}

0 commit comments

Comments
 (0)