Skip to content

Commit 3a06536

Browse files
committed
fix: share is not working issue
Signed-off-by: Amit Amrutiya <amitamrutiya2210@gmail.com>
1 parent 44c6e97 commit 3a06536

2 files changed

Lines changed: 25 additions & 17 deletions

File tree

src/custom/ShareModal/ShareModal.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ const ShareModal: React.FC<ShareModalProps> = ({
167167
handleShare,
168168
hostURL = null,
169169
handleCopy,
170-
171170
isVisibilitySelectorDisabled = false,
172171
fetchSuggestions
173172
}: ShareModalProps): JSX.Element => {
@@ -221,7 +220,6 @@ const ShareModal: React.FC<ShareModalProps> = ({
221220
setOption(selectedResource?.visibility);
222221
}
223222
}, [selectedResource]);
224-
225223
return (
226224
<div style={{ marginBottom: '1rem' }}>
227225
<Modal
@@ -257,12 +255,14 @@ const ShareModal: React.FC<ShareModalProps> = ({
257255
<PublicIcon
258256
width={24}
259257
height={24}
258+
fill={theme.palette.icon.default}
260259
stroke={theme.palette.mode === 'dark' ? WHITE : BLACK}
261260
/>
262261
) : (
263262
<LockIcon
264263
width={24}
265264
height={24}
265+
fill={theme.palette.icon.default}
266266
stroke={theme.palette.mode === 'dark' ? WHITE : BLACK}
267267
/>
268268
)}
@@ -289,7 +289,13 @@ const ShareModal: React.FC<ShareModalProps> = ({
289289
</MenuItem>
290290
))}
291291
</CustomSelect>
292-
<Typography component="span" variant="body2">
292+
<Typography
293+
sx={{
294+
color: theme.palette.text.secondary
295+
}}
296+
component="span"
297+
variant="body2"
298+
>
293299
{selectedOption === SHARE_MODE.PRIVATE ? options.PRIVATE : options.PUBLIC}
294300
</Typography>
295301
</div>

src/custom/UserSearchField/UserSearchField.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Autocomplete from '@mui/material/Autocomplete';
22
import CircularProgress from '@mui/material/CircularProgress';
3+
import { debounce } from 'lodash';
34
import React, { useState } from 'react';
45
import { Avatar, Box, Chip, Grid, TextField, Tooltip, Typography } from '../../base';
56
import { iconSmall } from '../../constants/iconsSizes';
@@ -88,21 +89,22 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
8889
}
8990
};
9091

91-
const handleInputChange = (_event: React.SyntheticEvent<Element, Event>, value: string) => {
92-
if (value === '') {
93-
setOptions([]);
94-
setOpen(false);
95-
} else {
96-
setSearchUserLoading(true);
97-
fetchSuggestions(value).then((filteredData) => {
98-
setOptions(filteredData);
92+
const handleInputChange = debounce(
93+
async (_event: React.SyntheticEvent<Element, Event>, value: string) => {
94+
if (value === '') {
95+
setOptions([]);
96+
setOpen(false);
97+
} else {
98+
setSearchUserLoading(true);
99+
const suggestions = await fetchSuggestions(value);
100+
setOptions(suggestions);
99101
setSearchUserLoading(false);
100-
});
101-
setError(false);
102-
setOpen(true);
103-
}
104-
};
105-
102+
setError(false);
103+
setOpen(true);
104+
}
105+
},
106+
300
107+
);
106108
/**
107109
* Clone customUsersList component to pass necessary props
108110
*/

0 commit comments

Comments
 (0)