Skip to content

Commit 4f4b6e3

Browse files
authored
Merge pull request #106 from lyjeileen/upload
fix: add tooltips to input icons
2 parents 0f07ccf + fff7463 commit 4f4b6e3

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

src/components/input/baseInput/baseInput.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,18 @@ function BaseInputElement(
201201
</Box>
202202
<Box className="rustic-input-actions">
203203
{props.children}
204-
<IconButton
205-
data-cy="send-button"
206-
aria-label="send message"
207-
onClick={handleSendMessage}
208-
disabled={isSendDisabled}
209-
color="primary"
210-
className="rustic-send-button"
211-
>
212-
<Icon name="send" />
213-
</IconButton>
204+
<Tooltip title="Send">
205+
<IconButton
206+
data-cy="send-button"
207+
aria-label="send message"
208+
onClick={handleSendMessage}
209+
disabled={isSendDisabled}
210+
color="primary"
211+
className="rustic-send-button"
212+
>
213+
<Icon name="send" />
214+
</IconButton>
215+
</Tooltip>
214216
</Box>
215217
</Box>
216218
)

src/components/input/multimodal/uploader/uploader.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Box from '@mui/material/Box'
44
import Card from '@mui/material/Card'
55
import IconButton from '@mui/material/IconButton'
66
import LinearProgress from '@mui/material/LinearProgress'
7+
import Tooltip from '@mui/material/Tooltip'
78
import Typography from '@mui/material/Typography'
89
import type { AxiosProgressEvent } from 'axios'
910
import axios from 'axios'
@@ -231,15 +232,17 @@ function Uploader(props: UploaderProps) {
231232
className="rustic-upload-progress"
232233
/>
233234
)}
234-
<IconButton
235-
data-cy="delete-button"
236-
color="primary"
237-
onClick={() => handleDelete(file, index)}
238-
className="rustic-delete-button"
239-
aria-label="cancel file upload"
240-
>
241-
<span className="material-symbols-rounded">cancel</span>
242-
</IconButton>
235+
<Tooltip title="Delete">
236+
<IconButton
237+
data-cy="delete-button"
238+
color="primary"
239+
onClick={() => handleDelete(file, index)}
240+
className="rustic-delete-button"
241+
aria-label="cancel file upload"
242+
>
243+
<span className="material-symbols-rounded">cancel</span>
244+
</IconButton>
245+
</Tooltip>
243246
</Box>
244247
</Card>
245248
)
@@ -282,9 +285,15 @@ function Uploader(props: UploaderProps) {
282285
<>
283286
<Box className="rustic-uploader">
284287
<label htmlFor={inputId} data-cy="upload-button">
285-
<IconButton component="span" aria-label="Upload file" color="primary">
286-
<span className="material-symbols-rounded">upload_2</span>
287-
</IconButton>
288+
<Tooltip title="Upload">
289+
<IconButton
290+
component="span"
291+
aria-label="Upload file"
292+
color="primary"
293+
>
294+
<span className="material-symbols-rounded">upload_2</span>
295+
</IconButton>
296+
</Tooltip>
288297
</label>
289298
<input
290299
type="file"

0 commit comments

Comments
 (0)