@@ -23,7 +23,6 @@ import {
23
23
24
24
import { getIsOnDevice } from '/app/redux/config'
25
25
26
- import type { IconName } from '@opentrons/components'
27
26
import { ModalContentOneColSimpleButtons } from './ModalContentOneColSimpleButtons'
28
27
import { TwoColumn } from './TwoColumn'
29
28
import { OneColumn } from './OneColumn'
@@ -32,6 +31,10 @@ import { ModalContentMixed } from './ModalContentMixed'
32
31
import { DescriptionContent } from './DescriptionContent'
33
32
import { DeckMapContent } from './DeckMapContent'
34
33
import { CategorizedStepContent } from './CategorizedStepContent'
34
+
35
+ import type { FlattenSimpleInterpolation } from 'styled-components'
36
+ import type { IconName } from '@opentrons/components'
37
+
35
38
export {
36
39
ModalContentOneColSimpleButtons ,
37
40
TwoColumn ,
@@ -122,6 +125,8 @@ export interface InterventionModalProps {
122
125
type ?: ModalType
123
126
/** optional icon name */
124
127
iconName ?: IconName | null | undefined
128
+ /* Optional icon size override. */
129
+ iconSize ?: string
125
130
/** modal contents */
126
131
children : React . ReactNode
127
132
}
@@ -133,6 +138,7 @@ export function InterventionModal({
133
138
iconName,
134
139
iconHeading,
135
140
children,
141
+ iconSize,
136
142
} : InterventionModalProps ) : JSX . Element {
137
143
const modalType = type ?? 'intervention-required'
138
144
const headerColor =
@@ -166,7 +172,7 @@ export function InterventionModal({
166
172
{ titleHeading }
167
173
< Flex alignItems = { ALIGN_CENTER } onClick = { iconHeadingOnClick } >
168
174
{ iconName != null ? (
169
- < Icon name = { iconName } css = { ICON_STYLE } />
175
+ < Icon name = { iconName } css = { buildIconStyle ( iconSize ) } />
170
176
) : null }
171
177
{ iconHeading != null ? iconHeading : null }
172
178
</ Flex >
@@ -178,9 +184,11 @@ export function InterventionModal({
178
184
)
179
185
}
180
186
181
- const ICON_STYLE = css `
182
- width : ${ SPACING . spacing32 } ;
183
- height : ${ SPACING . spacing32 } ;
187
+ const buildIconStyle = (
188
+ iconSize : string | undefined
189
+ ) : FlattenSimpleInterpolation => css `
190
+ width : ${ iconSize ?? SPACING . spacing16 } ;
191
+ height : ${ iconSize ?? SPACING . spacing16 } ;
184
192
margin : ${ SPACING . spacing4 } ;
185
193
cursor : ${ CURSOR_POINTER } ;
186
194
0 commit comments