Skip to content

Commit 4371c16

Browse files
feat: added icon picker
1 parent 47fc7bd commit 4371c16

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/components/NewChartModal.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@ export default function NewChartModal({
164164
)}
165165
<ModalContent>
166166
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
167+
{/* Display the chart icon as a non-interactive image.
168+
If chartIcon is not set, show a default placeholder image. */}
169+
<Box sx={{ display: 'flex', justifyContent: 'center' }}>
170+
<img
171+
src={
172+
chartIcon ||
173+
'https://assets.streamlinehq.com/image/private/w_300,h_300,ar_1/f_auto/v1/icons/logos/akamai-gqva4arap2uinswj55zve.png/akamai-4cwl4z4ddcnjbmpmzcl38.png?_a=DAJFJtWIZAAC'
174+
}
175+
alt='Chart Icon'
176+
style={{ maxWidth: '100px', maxHeight: '100px', objectFit: 'contain' }}
177+
/>
178+
</Box>
167179
{/* Row for the GitHub URL input and Test Connection button */}
168180
<Box sx={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
169181
<TextField
@@ -195,6 +207,7 @@ export default function NewChartModal({
195207
color={actionButtonColor || 'error'}
196208
sx={{ ml: 1, bgcolor: actionButtonColor }}
197209
onClick={() =>
210+
handleAction &&
198211
handleAction({
199212
url: githubUrl,
200213
chartName,
@@ -203,8 +216,8 @@ export default function NewChartModal({
203216
revision,
204217
})
205218
}
206-
startIcon={actionButtonFrontIcon && actionButtonFrontIcon}
207-
endIcon={actionButtonEndIcon && actionButtonEndIcon}
219+
startIcon={actionButtonFrontIcon}
220+
endIcon={actionButtonEndIcon}
208221
>
209222
{actionButtonText}
210223
</Button>

0 commit comments

Comments
 (0)