TagSpaces is an offline, open source, document manager with tagging support
chore: refactoring mui styling
Ilian Sapundshievbb9817b7d084
diff --git a/src/renderer/components/PerspectiveSelector.tsx b/src/renderer/components/PerspectiveSelector.tsxindex fbacc8f9b..10b3e773a 100644--- a/src/renderer/components/PerspectiveSelector.tsx+++ b/src/renderer/components/PerspectiveSelector.tsx@@ -23,6 +23,7 @@ import { AvailablePerspectives, PerspectiveIDs } from '-/perspectives';import { Pro } from '-/pro';import { isDesktopMode, isDevMode } from '-/reducers/settings';import LayersClearIcon from '@mui/icons-material/LayersClear';+import { Box } from '@mui/material';import ListItemIcon from '@mui/material/ListItemIcon';import ListItemText from '@mui/material/ListItemText';import MenuItem from '@mui/material/MenuItem';@@ -49,12 +50,12 @@ function PerspectiveSelector(props: Props) {key={PerspectiveIDs.UNSPECIFIED}value={PerspectiveIDs.UNSPECIFIED}>- <div style={{ display: 'flex', alignItems: 'center' }}>+ <Box sx={{ display: 'flex', alignItems: 'center' }}><ListItemIcon><LayersClearIcon /></ListItemIcon><ListItemText>{t('core:unspecified')}</ListItemText>- </div>+ </Box></MenuItem>,);@@ -66,13 +67,13 @@ function PerspectiveSelector(props: Props) {if (includePerspective) {perspectiveSelectorMenuItems.push(<MenuItem key={perspective.key} value={perspective.id}>- <div style={{ display: 'flex', alignItems: 'center' }}>+ <Box sx={{ display: 'flex', alignItems: 'center' }}><ListItemIcon>{perspective.icon}</ListItemIcon><ListItemText>{perspective.title} {perspective.beta && <BetaLabel />}</ListItemText>- </div>+ </Box></MenuItem>,);}diff --git a/src/renderer/components/ProTeaser.tsx b/src/renderer/components/ProTeaser.tsxindex 131ce655d..33a7f1bbd 100644--- a/src/renderer/components/ProTeaser.tsx+++ b/src/renderer/components/ProTeaser.tsx@@ -41,7 +41,7 @@ function ProTeaser(props: Props) {const { t } = useTranslation();return (- <Box style={{ display: 'block', marginBottom: 0 }}>+ <Box sx={{ display: 'block', marginBottom: 0 }}><CardContentsx={{paddingLeft: '5px',@@ -76,7 +76,6 @@ function ProTeaser(props: Props) {}}><b>TagSpaces Pro</b>- {/* <img style={{ height: 35 }} src={ProTextLogo} alt="" /> */}<br /><ViewKanbanTwoToneIconsx={{@@ -86,14 +85,13 @@ function ProTeaser(props: Props) {/><CameraTwoToneIcon sx={{ fontSize: '50px', color: '#f7901e' }} /><MapTwoToneIcon sx={{ fontSize: '50px', color: '#33b5be' }} />- {/* <img style={{ maxHeight: 60 }} src={ProTeaserImage} alt="" /> */}</div></CardContent><CardActions- style={{+ sx={{flexDirection: 'row',justifyContent: 'center',- marginTop: -10,+ marginTop: '-10px',}}><ButtonGroup>diff --git a/src/renderer/components/SearchAutocomplete.tsx b/src/renderer/components/SearchAutocomplete.tsxindex 4c6d15f4c..c71c06ef3 100644--- a/src/renderer/components/SearchAutocomplete.tsx+++ b/src/renderer/components/SearchAutocomplete.tsx@@ -456,7 +456,7 @@ function SearchAutocomplete(props: Props) {return (<Tooltiptitle={- <span style={{ fontSize: 14 }}>+ <Box sx={{ fontSize: '14px' }}>The search query consists of a tag part and a search term. This termis optional and can be a single word. The tag part can have one ormore tags preceded by the following symbols:@@ -484,7 +484,7 @@ function SearchAutocomplete(props: Props) {tags beach or sunset</li></ul>- </span>+ </Box>}><TsIconButton edge="end">@@ -1390,18 +1390,18 @@ function SearchAutocomplete(props: Props) {return (<Boxkey={'button_' + index}- style={{+ sx={{border: '1px solid gray',- minHeight: 0,- minWidth: 0,- margin: 2,- marginLeft: 1,- marginTop: 3,- paddingTop: 0,- paddingBottom: 0,- paddingRight: 0,- paddingLeft: 4,- borderRadius: 5,+ minHeight: '0',+ minWidth: '0',+ margin: '2px',+ marginLeft: '1px',+ marginTop: '3px',+ paddingTop: '0px',+ paddingBottom: '0px',+ paddingRight: '0px',+ paddingLeft: '4px',+ borderRadius: '5px',...(action &&action.color && {color: action.textcolor,@@ -1414,8 +1414,8 @@ function SearchAutocomplete(props: Props) {isAction(action.action, SearchQueryComposition.TAG_OR) ||isAction(action.action, SearchQueryComposition.TAG_NOT) ? (<Box- style={{- fontSize: 13,+ sx={{+ fontSize: '13px',fontWeight: 'bold',display: 'inline',}}diff --git a/src/renderer/components/SearchPopover.tsx b/src/renderer/components/SearchPopover.tsxindex ae9621480..f21018451 100644--- a/src/renderer/components/SearchPopover.tsx+++ b/src/renderer/components/SearchPopover.tsx@@ -30,6 +30,7 @@ import { useSearchQueryContext } from '-/hooks/useSearchQueryContext';import { isDesktopMode } from '-/reducers/settings';import { openURLExternally } from '-/services/utils-io';import { TS } from '-/tagspaces.namespace';+import { Box } from '@mui/material';import ButtonGroup from '@mui/material/ButtonGroup';import FormControl from '@mui/material/FormControl';import FormHelperText from '@mui/material/FormHelperText';@@ -99,7 +100,7 @@ function SearchPopover(props: Props) {} as React.CSSProperties & { WebkitAppRegion?: string }}>- <div style={{ display: 'flex' }}>+ <Box sx={{ display: 'flex' }}><Typography variant="button" sx={{ margin: '12px 0 10px 10px' }}>{t('core:advancedSearch')}</Typography>@@ -116,13 +117,13 @@ function SearchPopover(props: Props) {><CloseIcon /></TsIconButton>- </div>- <div- style={{- paddingTop: 0,- paddingLeft: 10,- paddingRight: 10,- marginTop: 0,+ </Box>+ <Box+ sx={{+ paddingTop: '0px',+ paddingLeft: '10px',+ paddingRight: '10px',+ marginTop: '0px',height: 'calc(100% - 90px)',maxHeight: 'calc(100% - 90px)',overflowX: 'hidden',@@ -134,7 +135,7 @@ function SearchPopover(props: Props) {<Gridcontainerspacing={2}- style={{ marginBottom: 15 }}+ sx={{ marginBottom: '15px' }}direction="row"justifyContent="center"alignItems="flex-end"@@ -159,8 +160,12 @@ function SearchPopover(props: Props) {<MenuItem>{t('noSavedSearches')}</MenuItem>)}{searches.map((search) => (- <MenuItem key={search.uuid} value={search.uuid}>- <span style={{ width: '100%' }}>{search.title}</span>+ <MenuItem+ sx={{ width: '100%' }}+ key={search.uuid}+ value={search.uuid}+ >+ {search.title}</MenuItem>))}</TsSelect>@@ -169,7 +174,7 @@ function SearchPopover(props: Props) {</Grid><Gridsize={3}- style={{ display: 'flex', alignSelf: 'center', paddingTop: 25 }}+ sx={{ display: 'flex', alignSelf: 'center', paddingTop: '25px' }}><ButtonGroupsx={{@@ -199,9 +204,9 @@ function SearchPopover(props: Props) {<EditSearchQuery /></Grid></Grid>- </div>- <div- style={{+ </Box>+ <Box+ sx={{display: 'flex',justifyContent: 'space-between',padding: AppConfig.defaultSpaceBetweenButtons,@@ -235,7 +240,7 @@ function SearchPopover(props: Props) {: t('searchTitle')}</TsButton></div>- </div>+ </Box></div>);}diff --git a/src/renderer/components/TagContainerMenu.tsx b/src/renderer/components/TagContainerMenu.tsxindex bbacbcd00..7db176bcd 100644--- a/src/renderer/components/TagContainerMenu.tsx+++ b/src/renderer/components/TagContainerMenu.tsx@@ -18,6 +18,7 @@import { MoreMenuIcon, RemoveTagIcon } from '-/components/CommonIcons';import { TS } from '-/tagspaces.namespace';+import { Box } from '@mui/material';interface Props {tag: TS.Tag;@@ -27,13 +28,9 @@ interface Props {}function TagContainerMenu(props: Props) {- //const { readOnlyMode } = useCurrentLocationContext();const { deleteIcon, tag, handleRemoveTag, tagMode } = props;- /*if (readOnlyMode) {- return <div style={{ width: 10 }} />;- }*/if (tagMode === 'display') {- return <div style={{ width: 10 }} />;+ return <Box sx={{ width: '10px' }} />;}return tagMode === 'remove' ? (deleteIcon || (diff --git a/src/renderer/components/dialogs/AboutDialog.tsx b/src/renderer/components/dialogs/AboutDialog.tsxindex 2b60c3302..a26abd5db 100644--- a/src/renderer/components/dialogs/AboutDialog.tsx+++ b/src/renderer/components/dialogs/AboutDialog.tsx@@ -239,7 +239,7 @@ function AboutDialog(props: Props) {</TsButton></Typography></DialogContent>- <TsDialogActions style={{ justifyContent: 'space-between' }}>+ <TsDialogActions sx={{ justifyContent: 'space-between' }}><span>{!Pro && (<TsButtondiff --git a/src/renderer/components/dialogs/CreateEditLocationDialog.tsx b/src/renderer/components/dialogs/CreateEditLocationDialog.tsxindex c8193cf23..2127a5cb2 100644--- a/src/renderer/components/dialogs/CreateEditLocationDialog.tsx+++ b/src/renderer/components/dialogs/CreateEditLocationDialog.tsx@@ -669,7 +669,7 @@ function CreateEditLocationDialog(props: Props) {</>)}<Accordion defaultExpanded>- <AccordionDetails style={{ paddingTop: 16 }}>+ <AccordionDetails sx={{ paddingTop: '16px' }}><FormGroup>{!selectedLocation && (<FormControl disabled={disableLocationTypeSwitch} fullWidth>@@ -698,15 +698,6 @@ function CreateEditLocationDialog(props: Props) {{t('core:objectStorage') +' (AWS S3, CloudFlare R2, Wasabi,...)'}</MenuItem>- {/* {Pro && devMode && (- <MenuItem- key="TYPE_WEBDAV"- value={locationType.TYPE_WEBDAV}- data-tid="webdavLocationTID"- >- {t('core:webdavLocation') + ' (experimental)'}- </MenuItem>- )} */}</TsSelect></FormControl>)}@@ -729,7 +720,7 @@ function CreateEditLocationDialog(props: Props) {/><FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<Switchdata-tid="locationIsDefault"@@ -744,7 +735,7 @@ function CreateEditLocationDialog(props: Props) {/><FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<Switchdisabled={!Pro}@@ -782,7 +773,7 @@ function CreateEditLocationDialog(props: Props) {{fullTextIndex && (<FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<Switchdisabled={!Pro}@@ -804,7 +795,7 @@ function CreateEditLocationDialog(props: Props) {)}<FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<Switchdisabled={!Pro}@@ -844,7 +835,7 @@ function CreateEditLocationDialog(props: Props) {<FormGroup><FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<Switchdisabled={!Pro}@@ -870,7 +861,7 @@ function CreateEditLocationDialog(props: Props) {AppConfig.isCordova}labelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<Switchdata-tid="changeWatchForChanges"@@ -890,7 +881,7 @@ function CreateEditLocationDialog(props: Props) {/><FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<Switchdata-tid="locationSettingsGenThumbsTID"@@ -905,7 +896,7 @@ function CreateEditLocationDialog(props: Props) {/><FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<Switchdisabled={!Pro}@@ -926,12 +917,12 @@ function CreateEditLocationDialog(props: Props) {/><FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<TsTextFieldname="maxIndexAge"- style={{- width: 100,+ sx={{+ width: '100px',}}type="number"data-tid="maxIndexAgeTID"@@ -952,7 +943,7 @@ function CreateEditLocationDialog(props: Props) {{type === locationType.TYPE_CLOUD && (<FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<MaxLoopsSelectmaxLoops={maxLoops}@@ -970,7 +961,7 @@ function CreateEditLocationDialog(props: Props) {{AppConfig.useSidecarsForFileTaggingDisableSetting ? (<FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between', marginLeft: 0 }}+ sx={{ justifyContent: 'space-between', marginLeft: 0 }}control={<TsButton disabled>{currentTagsSetting@@ -983,9 +974,9 @@ function CreateEditLocationDialog(props: Props) {) : (<FormControlLabellabelPlacement="top"- style={{+ sx={{alignItems: 'start',- marginBottom: 10,+ marginBottom: '10px',marginLeft: 0,}}control={@@ -1000,7 +991,7 @@ function CreateEditLocationDialog(props: Props) {? persistTagsInSidecarFile: false}- style={{+ sx={{borderTopRightRadius: 0,borderBottomRightRadius: 0,}}@@ -1021,7 +1012,7 @@ function CreateEditLocationDialog(props: Props) {</TsToggleButton><TsToggleButtonvalue={false}- style={{+ sx={{borderRadius: 0,}}data-tid="locationSetPersistTagsInFileName"@@ -1036,7 +1027,7 @@ function CreateEditLocationDialog(props: Props) {</TsToggleButton><TsToggleButtonvalue={true}- style={{+ sx={{borderTopLeftRadius: 0,borderBottomLeftRadius: 0,}}@@ -1063,9 +1054,9 @@ function CreateEditLocationDialog(props: Props) {<FormControlLabeldisabled={!Pro}labelPlacement="start"- style={{+ sx={{justifyContent: 'space-between',- marginTop: 15,+ marginTop: '15px',marginLeft: 0,marginRight: 0,}}@@ -1076,7 +1067,7 @@ function CreateEditLocationDialog(props: Props) {onClick={() => {setIgnorePatternDialogOpen(true);}}- style={{+ sx={{marginBottom: AppConfig.defaultSpaceBetweenButtons,}}>@@ -1094,18 +1085,18 @@ function CreateEditLocationDialog(props: Props) {/>{ignorePatternPaths && ignorePatternPaths.length > 0 && (<List- style={{- padding: 5,+ sx={{+ padding: '5px',backgroundColor: '#d3d3d34a',- borderRadius: 10,+ borderRadius: '10px',}}dense>{ignorePatternPaths.map((ignorePatternPath) => (- <ListItem style={{ padding: 0 }}>+ <ListItem sx={{ padding: 0 }}><ListItemText primary={ignorePatternPath} /><ListItemIcon- style={{ minWidth: 0 }}+ sx={{ minWidth: 0 }}title={t('core:ignorePatternRemove')}onClick={() => {const array = [...ignorePatternPaths];@@ -1132,7 +1123,7 @@ function CreateEditLocationDialog(props: Props) {/>)}</>- <FormControl fullWidth={true} style={{ marginTop: 10 }}>+ <FormControl fullWidth sx={{ marginTop: '10px' }}><TsTextFieldname="autoOpenedFilename"data-tid="autoOpenedFilenameTID"@@ -1150,7 +1141,7 @@ function CreateEditLocationDialog(props: Props) {label={t('core:autoOpenedFilename')}/></FormControl>- <FormControl fullWidth={true} style={{ marginTop: 10 }}>+ <FormControl fullWidth sx={{ marginTop: '10px' }}><TsTextFieldrequiredname="newuuid"@@ -1165,7 +1156,7 @@ function CreateEditLocationDialog(props: Props) {slotProps={{input: {endAdornment: (- <InputAdornment position="end" style={{ height: 32 }}>+ <InputAdornment position="end" sx={{ height: '32px' }}><TsIconButtontooltip={t('core:generateNewLocationId')}onClick={() => {@@ -1203,7 +1194,7 @@ function CreateEditLocationDialog(props: Props) {</AccordionSummary><AccordionDetails><FormControl fullWidth={true}>- <FormLabel style={{ marginBottom: 15 }}>+ <FormLabel sx={{ marginBottom: '15px' }}>{t('encryptionExplanation')}</FormLabel><TsTextFielddiff --git a/src/renderer/components/dialogs/CreateTagGroupDialog.tsx b/src/renderer/components/dialogs/CreateTagGroupDialog.tsxindex d8dee4f36..35bb2ec52 100644--- a/src/renderer/components/dialogs/CreateTagGroupDialog.tsx+++ b/src/renderer/components/dialogs/CreateTagGroupDialog.tsx@@ -204,7 +204,7 @@ function CreateTagGroupDialog(props: Props) {actionSlot={okButton}/><DialogContent- style={{ overflowY: 'visible', overflowX: 'hidden', minWidth: 300 }}+ sx={{ overflowY: 'visible', overflowX: 'hidden', minWidth: '300px' }}><FormControl fullWidth={true} error={inputError}><TsTextField@@ -221,7 +221,7 @@ function CreateTagGroupDialog(props: Props) {)}</FormControl>{saveTagsInLocation && (- <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>+ <ListItem sx={{ paddingLeft: 0, paddingRight: 0 }}><TsSelectdata-tid="tagGroupLocationTID"disabled={!Pro}@@ -258,7 +258,7 @@ function CreateTagGroupDialog(props: Props) {</TsSelect></ListItem>)}- <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>+ <ListItem sx={{ paddingLeft: 0, paddingRight: 0 }}><WorkSpacesDropdowndisabled={!Pro}dataTid="createTgWorkspaceTID"@@ -276,14 +276,14 @@ function CreateTagGroupDialog(props: Props) {}/></ListItem>- <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>+ <ListItem sx={{ paddingLeft: 0, paddingRight: 0 }}><ListItemText primary={t('core:tagBackgroundColor')} /><TransparentBackground><TsButtononClick={toggleDefaultTagBackgroundColorPicker}data-tid="createTagGroupBackgroundColor"- style={{- height: 30,+ sx={{+ height: '30px',borderRadius: AppConfig.defaultCSSRadius,borderWidth: 1,borderStyle: 'solid',@@ -305,14 +305,14 @@ function CreateTagGroupDialog(props: Props) {/>)}</ListItem>- <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>+ <ListItem sx={{ paddingLeft: 0, paddingRight: 0 }}><ListItemText primary={t('core:tagForegroundColor')} /><TransparentBackground><TsButtononClick={toggleDefaultTagTextColorPicker}data-tid="createTagGroupForegroundColor"- style={{- height: 30,+ sx={{+ height: '30px',borderRadius: AppConfig.defaultCSSRadius,borderWidth: 1,borderStyle: 'solid',@@ -334,7 +334,7 @@ function CreateTagGroupDialog(props: Props) {/>)}</ListItem>- <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>+ <ListItem sx={{ paddingLeft: 0, paddingRight: 0 }}><ListItemText primary={t('core:tagPreview')} /><TagbackgroundColor={color.current}diff --git a/src/renderer/components/dialogs/FileUploadDialog.tsx b/src/renderer/components/dialogs/FileUploadDialog.tsxindex c067e58a7..744e7bdd1 100644--- a/src/renderer/components/dialogs/FileUploadDialog.tsx+++ b/src/renderer/components/dialogs/FileUploadDialog.tsx@@ -188,7 +188,7 @@ function FileUploadDialog(props: Props) {onClose={onClose}/><DialogContent- style={{+ sx={{marginLeft: 'auto',marginRight: 'auto',width: '90%',@@ -223,7 +223,7 @@ function FileUploadDialog(props: Props) {><Gridsize={{ xs: 10 }}- style={{+ sx={{display: 'flex',alignItems: 'center',wordBreak: 'break-word',diff --git a/src/renderer/components/dialogs/ImportMacTagDialog.tsx b/src/renderer/components/dialogs/ImportMacTagDialog.tsxindex 86e8ffd6c..74989e26b 100644--- a/src/renderer/components/dialogs/ImportMacTagDialog.tsx+++ b/src/renderer/components/dialogs/ImportMacTagDialog.tsx@@ -26,7 +26,7 @@ import { useNotificationContext } from '-/hooks/useNotificationContext';import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';import { Pro } from '-/pro';import { readMacOSTags } from '-/services/utils-io';-import { Switch } from '@mui/material';+import { Box, Switch } from '@mui/material';import Dialog from '@mui/material/Dialog';import DialogContent from '@mui/material/DialogContent';import DialogTitle from '@mui/material/DialogTitle';@@ -128,7 +128,7 @@ Do you want to continue?`)<DialogCloseButton testId="closeImportMacTagTID" onClose={onClose} /></DialogTitle><DialogContent>- <div style={{ margin: 20 }}>{t('core:importMacTagsHelp')}</div>+ <Box sx={{ margin: '20px' }}>{t('core:importMacTagsHelp')}</Box><FormControlLabellabelPlacement="start"control={diff --git a/src/renderer/components/dialogs/IsTruncatedConfirmDialog.tsx b/src/renderer/components/dialogs/IsTruncatedConfirmDialog.tsxindex c404a124c..1dae56f52 100644--- a/src/renderer/components/dialogs/IsTruncatedConfirmDialog.tsx+++ b/src/renderer/components/dialogs/IsTruncatedConfirmDialog.tsx@@ -93,7 +93,7 @@ function IsTruncatedConfirmDialog(props: Props) {<DialogContentText component="span"><FormControlLabellabelPlacement="start"- style={{ justifyContent: 'space-between' }}+ sx={{ justifyContent: 'space-between' }}control={<MaxLoopsSelectmaxLoops={defaultMaxLoops}diff --git a/src/renderer/components/dialogs/OpenLinkDialog.tsx b/src/renderer/components/dialogs/OpenLinkDialog.tsxindex ea7d813b3..cf830d078 100644--- a/src/renderer/components/dialogs/OpenLinkDialog.tsx+++ b/src/renderer/components/dialogs/OpenLinkDialog.tsx@@ -124,7 +124,7 @@ function OpenLinkDialog(props: Props) {onClose={onClose}actionSlot={okButton}/>- <DialogContent style={{ minWidth: smallScreen ? 100 : 400 }}>+ <DialogContent sx={{ minWidth: smallScreen ? '100px' : '400px' }}><FormControl fullWidth={true}><TsTextFieldautoFocusdiff --git a/src/renderer/components/dialogs/ProTeaserDialog.tsx b/src/renderer/components/dialogs/ProTeaserDialog.tsxindex 84f2c52a4..8ca10a296 100644--- a/src/renderer/components/dialogs/ProTeaserDialog.tsx+++ b/src/renderer/components/dialogs/ProTeaserDialog.tsx@@ -70,10 +70,10 @@ function Slide(props: SlideProps) {const { t } = useTranslation();return (- <div- style={{- padding: 40,- marginTop: -40,+ <Box+ sx={{+ padding: '40px',+ marginTop: '-40px',}}><Typography@@ -91,7 +91,7 @@ function Slide(props: SlideProps) {★ {item}</Typography>))}- <div style={{ textAlign: 'center', paddingTop: 10 }}>+ <Box sx={{ textAlign: 'center', paddingTop: '10px' }}>{pictureURL && (<ahref="#"@@ -130,7 +130,7 @@ function Slide(props: SlideProps) {/>)}<br />- <Box style={{ whiteSpace: 'nowrap' }}>+ <Box sx={{ whiteSpace: 'nowrap' }}><TsButtononClick={() => {openURLExternally(Links.links.productsOverview, true);@@ -149,8 +149,8 @@ function Slide(props: SlideProps) {</TsButton>)}</Box>- </div>- </div>+ </Box>+ </Box>);}@@ -183,7 +183,7 @@ function ProTeaserDialog(props: Props) {dialogTitle={''}/><DialogContent- style={{+ sx={{padding: 0,}}>diff --git a/src/renderer/components/dialogs/ProgressDialog.tsx b/src/renderer/components/dialogs/ProgressDialog.tsxindex 6244e8f4c..91a36e314 100644--- a/src/renderer/components/dialogs/ProgressDialog.tsx+++ b/src/renderer/components/dialogs/ProgressDialog.tsx@@ -39,7 +39,7 @@ function ProgressDialog(props: Props) {PaperComponent={DraggablePaper}open={open}onClose={onClose}- style={{ minHeight: 200 }}+ sx={{ minHeight: '200px' }}><DialogTitlesx={{ cursor: 'move', minHeight: '20px' }}@@ -50,8 +50,8 @@ function ProgressDialog(props: Props) {<DialogCloseButton testId="closeProgressTID" onClose={onClose} /></DialogTitle><DialogContent- style={{- minWidth: 300,+ sx={{+ minWidth: '300px',display: 'flex',justifyContent: 'center',alignItems: 'center',diff --git a/src/renderer/components/dialogs/ResolveConflictDialog.tsx b/src/renderer/components/dialogs/ResolveConflictDialog.tsxindex aa7b30d37..c9c9af639 100644--- a/src/renderer/components/dialogs/ResolveConflictDialog.tsx+++ b/src/renderer/components/dialogs/ResolveConflictDialog.tsx@@ -73,9 +73,9 @@ function ResolveConflictDialog(props: Props) {<DialogCloseButton testId="closeResolveConflictTID" onClose={onClose} /></DialogTitle><DialogContent- style={{+ sx={{overflow: 'auto',- minWidth: 400,+ minWidth: '400px',}}>{isSaveAs ? (diff --git a/src/renderer/components/dialogs/SaveSearchDialog.tsx b/src/renderer/components/dialogs/SaveSearchDialog.tsxindex 13efc8f8a..99b7f5da5 100644--- a/src/renderer/components/dialogs/SaveSearchDialog.tsx+++ b/src/renderer/components/dialogs/SaveSearchDialog.tsx@@ -167,7 +167,7 @@ function SaveSearchDialog(props: Props) {onClose={onClose}actionSlot={okButton}/>- <DialogContent style={{ minWidth: smallScreen ? 'unset' : 300 }}>+ <DialogContent sx={{ minWidth: smallScreen ? 'unset' : '300px' }}><FormControl fullWidth={true}><TsTextFielderror={!!inputError.current}@@ -194,7 +194,7 @@ function SaveSearchDialog(props: Props) {<EditSearchQuery /></DialogContent>{!smallScreen && (- <TsDialogActions style={{ justifyContent: 'space-between' }}>+ <TsDialogActions sx={{ justifyContent: 'space-between' }}><div>{tempSearchQuery?.uuid !== undefined && (<TsButton onClick={onDelete} data-tid="deleteSavedSearchTID">diff --git a/src/renderer/components/dialogs/SettingsDialog.tsx b/src/renderer/components/dialogs/SettingsDialog.tsxindex cb9b2c55c..8b466f9e9 100644--- a/src/renderer/components/dialogs/SettingsDialog.tsx+++ b/src/renderer/components/dialogs/SettingsDialog.tsx@@ -97,7 +97,7 @@ function SettingsDialog(props: Props) {const renderContent = (<DialogContent- style={{+ sx={{overflowY: 'hidden',overflowX: 'hidden',display: smallScreen ? 'block' : 'flex',@@ -226,12 +226,8 @@ function SettingsDialog(props: Props) {<Dialogsx={{'& .MuiDialog-paper': {- maxWidth: 'unset',height: '100%',- // background: props.fullScreen- // ? theme.palette.background.default- // : alpha(theme.palette.background.default, 0.85),- // backdropFilter: props.fullScreen ? 'unset' : 'blur(5px)',+ maxWidth: 'unset',},}}fullScreen={smallScreen}@@ -240,7 +236,6 @@ function SettingsDialog(props: Props) {keepMountedscroll="paper"onClose={onClose}- style={{ maxWidth: 'auto' }}><TsDialogTitledialogTitle={t('core:settings')}@@ -251,7 +246,7 @@ function SettingsDialog(props: Props) {{renderContent}{!smallScreen && (<TsDialogActions- style={{+ sx={{justifyContent: 'space-between',}}>diff --git a/src/renderer/components/dialogs/components/CreateFile.tsx b/src/renderer/components/dialogs/components/CreateFile.tsxindex 4b250770d..77c6ba07f 100644--- a/src/renderer/components/dialogs/components/CreateFile.tsx+++ b/src/renderer/components/dialogs/components/CreateFile.tsx@@ -203,26 +203,26 @@ function CreateFile(props: Props) {<Card variant="outlined"><CardContent><Box- style={{+ sx={{display: 'flex',flexWrap: 'nowrap',alignItems: 'anchor-center',}}><Typography variant="h6">{template.name}</Typography>- <span- style={{- marginLeft: 5,- padding: 2,- fontSize: 12,+ <Box+ sx={{+ marginLeft: '5px',+ padding: '2px',+ fontSize: '12px',textTransform: 'uppercase',border: '1px solid gray',borderRadius: '3px',- height: 13,+ height: '13px',}}>{template.type}- </span>+ </Box></Box><Typographyvariant="body2"diff --git a/src/renderer/components/dialogs/components/SettingsExtensions.tsx b/src/renderer/components/dialogs/components/SettingsExtensions.tsxindex ad43be5e3..1f082fbb3 100644--- a/src/renderer/components/dialogs/components/SettingsExtensions.tsx+++ b/src/renderer/components/dialogs/components/SettingsExtensions.tsx@@ -127,12 +127,12 @@ function SettingsExtensions() {};return (- <div- style={{+ <Box+ sx={{overflowX: 'hidden',overflowY: 'auto',height: '100%',- padding: 10,+ padding: '10px',}}><Accordion defaultExpanded>@@ -233,7 +233,7 @@ function SettingsExtensions() {)}</AccordionDetails></Accordion>- </div>+ </Box>);}diff --git a/src/renderer/components/dialogs/components/SettingsFileTypes.tsx b/src/renderer/components/dialogs/components/SettingsFileTypes.tsxindex 33b89600e..5ab53e00a 100644--- a/src/renderer/components/dialogs/components/SettingsFileTypes.tsx+++ b/src/renderer/components/dialogs/components/SettingsFileTypes.tsx@@ -582,8 +582,8 @@ function SettingsFileTypes() {</TsButton>)}</Box>- <div- style={{+ <Box+ sx={{height: smallScreen ? 'calc(100% - 80px)' : 'calc(100% - 50px)',width: '100%',}}@@ -611,7 +611,7 @@ function SettingsFileTypes() {},}}/>- </div>+ </Box><ColorPickerDialogopen={isColorPickerVisible}setColor={handleChangeColor}diff --git a/src/renderer/components/dialogs/components/SettingsTemplates.tsx b/src/renderer/components/dialogs/components/SettingsTemplates.tsxindex 735c0856d..826d0a267 100644--- a/src/renderer/components/dialogs/components/SettingsTemplates.tsx+++ b/src/renderer/components/dialogs/components/SettingsTemplates.tsx@@ -38,6 +38,7 @@ import {Accordion,AccordionDetails,AccordionSummary,+ Box,Typography,} from '@mui/material';import FormHelperText from '@mui/material/FormHelperText';@@ -130,12 +131,12 @@ function SettingsTemplates(props: Props) {}return (- <div- style={{+ <Box+ sx={{overflowX: 'hidden',overflowY: 'auto',height: '100%',- padding: 10,+ padding: '10px',}}><Accordion defaultExpanded>@@ -333,7 +334,7 @@ function SettingsTemplates(props: Props) {<ToggleButtonGroupvalue={currentTemplate(template).type}exclusive- style={{ marginTop: 10, marginBottom: 10 }}+ sx={{ marginTop: '10px', marginBottom: '10px' }}title="Template type"><TsToggleButton@@ -425,7 +426,7 @@ function SettingsTemplates(props: Props) {</AccordionDetails></Accordion>))}- </div>+ </Box>);}diff --git a/src/renderer/components/dialogs/components/TargetPath.tsx b/src/renderer/components/dialogs/components/TargetPath.tsxindex 6a4f5f9c6..15849ca73 100644--- a/src/renderer/components/dialogs/components/TargetPath.tsx+++ b/src/renderer/components/dialogs/components/TargetPath.tsx@@ -31,7 +31,7 @@ function TargetPath() {const currentLocation = findLocation();return (- <Grid container style={{ marginTop: '20px' }}>+ <Grid container sx={{ marginTop: '20px' }}>{targetDirectoryPath ? (<Typographysx={{ display: 'flex', alignItems: 'center' }}diff --git a/src/renderer/components/dialogs/components/TsDialogActions.tsx b/src/renderer/components/dialogs/components/TsDialogActions.tsxindex 020e2b225..8f0e8056e 100644--- a/src/renderer/components/dialogs/components/TsDialogActions.tsx+++ b/src/renderer/components/dialogs/components/TsDialogActions.tsx@@ -25,7 +25,7 @@ import { useSelector } from 'react-redux';export type TSDialogActions = DialogActionsProps & {};function TSDialogActions(props: TSDialogActions) {- const { children, style } = props;+ const { children, sx } = props;const desktopMode = useSelector(isDesktopMode);const theme = useTheme();const smallScreen = useMediaQuery(theme.breakpoints.down('md'));@@ -33,10 +33,9 @@ function TSDialogActions(props: TSDialogActions) {return (<DialogActions{...props}- style={{+ sx={{padding: '10px 20px 20px 20px',- // padding: smallScreen ? '10px 20px 20px 30px' : 'inherited',- ...style,+ ...sx,}}>{children}diff --git a/src/renderer/components/dialogs/components/WorkSpacesDropdown.tsx b/src/renderer/components/dialogs/components/WorkSpacesDropdown.tsxindex 5c8b21fa4..bbb4f2038 100644--- a/src/renderer/components/dialogs/components/WorkSpacesDropdown.tsx+++ b/src/renderer/components/dialogs/components/WorkSpacesDropdown.tsx@@ -78,7 +78,7 @@ const WorkSpacesDropdown: React.FC<WorkSpacesDropdownProps> = ({startAdornment: (<InputAdornment position="start"><TsIconButton- style={{ marginLeft: -10 }}+ sx={{ marginLeft: '-10px' }}aria-label="add-workspace"onClick={() => onOpenNewWorkspace && onOpenNewWorkspace()}data-tid="wSpaceAddTID"@@ -95,7 +95,7 @@ const WorkSpacesDropdown: React.FC<WorkSpacesDropdownProps> = ({aria-label="delete-workspace"onClick={() => setWorkSpaceId('')}data-tid="wSpaceResetTID"- style={{ marginRight: 15 }}+ sx={{ marginRight: '15px' }}tooltip={t('removeWorkspace')}disabled={disabled}>diff --git a/src/renderer/components/menus/EntryTagMenu.tsx b/src/renderer/components/menus/EntryTagMenu.tsxindex df9fdabad..d13f4cd66 100644--- a/src/renderer/components/menus/EntryTagMenu.tsx+++ b/src/renderer/components/menus/EntryTagMenu.tsx@@ -28,6 +28,7 @@ import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';import { getMaxSearchResults } from '-/reducers/settings';import { TS } from '-/tagspaces.namespace';+import { Box } from '@mui/material';import ListItemIcon from '@mui/material/ListItemIcon';import ListItemText from '@mui/material/ListItemText';import Menu from '@mui/material/Menu';@@ -149,11 +150,11 @@ function EntryTagMenu(props: Props) {}return (- <div style={{ overflowY: 'hidden' }}>+ <Box sx={{ overflowY: 'hidden' }}><Menu anchorEl={anchorEl} open={open} onClose={onClose}><TsMenuList>{menuItems}</TsMenuList></Menu>- </div>+ </Box>);}diff --git a/src/renderer/components/menus/HistoryMenu.tsx b/src/renderer/components/menus/HistoryMenu.tsxindex 1ace4ffbe..638496d43 100644--- a/src/renderer/components/menus/HistoryMenu.tsx+++ b/src/renderer/components/menus/HistoryMenu.tsx@@ -18,6 +18,7 @@import { DeleteIcon, ReloadIcon } from '-/components/CommonIcons';import TsMenuList from '-/components/TsMenuList';+import { Box } from '@mui/material';import ListItemIcon from '@mui/material/ListItemIcon';import ListItemText from '@mui/material/ListItemText';import Menu from '@mui/material/Menu';@@ -69,11 +70,11 @@ function HistoryMenu(props: Props) {);return (- <div style={{ overflowY: 'hidden' }}>+ <Box sx={{ overflowY: 'hidden' }}><Menu anchorEl={anchorEl} open={open} onClose={onClose}><TsMenuList>{menuItems}</TsMenuList></Menu>- </div>+ </Box>);}diff --git a/src/renderer/components/menus/SavedSearchesMenu.tsx b/src/renderer/components/menus/SavedSearchesMenu.tsxindex 5820ec6b6..f0743ad40 100644--- a/src/renderer/components/menus/SavedSearchesMenu.tsx+++ b/src/renderer/components/menus/SavedSearchesMenu.tsx@@ -18,6 +18,7 @@import { useSavedSearchesContext } from '-/hooks/useSavedSearchesContext';import { getSearches } from '-/reducers/searches';+import { Box } from '@mui/material';import Menu from '@mui/material/Menu';import MenuItem from '@mui/material/MenuItem';import { useTranslation } from 'react-i18next';@@ -52,7 +53,7 @@ function SavedSearchesMenu(props: Props) {);return (- <div style={{ overflowY: 'hidden' }}>+ <Box sx={{ overflowY: 'hidden' }}><MenuanchorEl={anchorEl}open={open}@@ -93,7 +94,7 @@ function SavedSearchesMenu(props: Props) {>{menuItems}</Menu>- </div>+ </Box>);}export default SavedSearchesMenu;diff --git a/src/renderer/components/menus/SearchMenu.tsx b/src/renderer/components/menus/SearchMenu.tsxindex f5a55d57a..7b1fe64e1 100644--- a/src/renderer/components/menus/SearchMenu.tsx+++ b/src/renderer/components/menus/SearchMenu.tsx@@ -17,22 +17,23 @@*/import {+ CreateFileIcon,ExportIcon,HelpIcon,ImportIcon,- CreateFileIcon,} from '-/components/CommonIcons';import { ProLabel } from '-/components/HelperComponents';import TsMenuList from '-/components/TsMenuList';+import { useSearchQueryContext } from '-/hooks/useSearchQueryContext';import { Pro } from '-/pro';import { openURLExternally } from '-/services/utils-io';+import { Box } from '@mui/material';import ListItemIcon from '@mui/material/ListItemIcon';import ListItemText from '@mui/material/ListItemText';import Menu from '@mui/material/Menu';import MenuItem from '@mui/material/MenuItem';import Links from 'assets/links';import { useTranslation } from 'react-i18next';-import { useSearchQueryContext } from '-/hooks/useSearchQueryContext';interface Props {classes?: any;@@ -125,11 +126,11 @@ function SearchMenu(props: Props) {);return (- <div style={{ overflowY: 'hidden' }}>+ <Box sx={{ overflowY: 'hidden' }}><Menu anchorEl={props.anchorEl} open={props.open} onClose={props.onClose}><TsMenuList>{menuItems}</TsMenuList></Menu>- </div>+ </Box>);}diff --git a/src/renderer/components/menus/TagGroupMenu.tsx b/src/renderer/components/menus/TagGroupMenu.tsxindex 6b212da30..ffc1bac29 100644--- a/src/renderer/components/menus/TagGroupMenu.tsx+++ b/src/renderer/components/menus/TagGroupMenu.tsx@@ -32,6 +32,7 @@ import { TS } from '-/tagspaces.namespace';import ShowEntriesWithTagIcon from '@mui/icons-material/SearchOutlined';import SortTagGroupIcon from '@mui/icons-material/SortByAlpha';import CollectTagsIcon from '@mui/icons-material/Voicemail';+import { Box } from '@mui/material';import ListItemIcon from '@mui/material/ListItemIcon';import ListItemText from '@mui/material/ListItemText';import Menu from '@mui/material/Menu';@@ -117,7 +118,7 @@ function TagGroupMenu(props: Props) {}return (- <div style={{ overflowY: 'hidden' }}>+ <Box sx={{ overflowY: 'hidden' }}><Menu anchorEl={anchorEl} open={open} onClose={handleCloseTagGroupMenu}><TsMenuList><MenuItem data-tid="createTags" onClick={showCreateTagsDialog}>@@ -178,7 +179,7 @@ function TagGroupMenu(props: Props) {</MenuItem></TsMenuList></Menu>- </div>+ </Box>);}diff --git a/src/renderer/components/menus/TagLibraryMenu.tsx b/src/renderer/components/menus/TagLibraryMenu.tsxindex 99ba08847..d99dca88a 100644--- a/src/renderer/components/menus/TagLibraryMenu.tsx+++ b/src/renderer/components/menus/TagLibraryMenu.tsx@@ -31,6 +31,7 @@ import { useNotificationContext } from '-/hooks/useNotificationContext';import { Pro } from '-/pro';import { getSaveTagInLocation } from '-/reducers/settings';import { openURLExternally } from '-/services/utils-io';+import { Box } from '@mui/material';import ListItemIcon from '@mui/material/ListItemIcon';import ListItemText from '@mui/material/ListItemText';import Menu from '@mui/material/Menu';@@ -104,7 +105,7 @@ function TagLibraryMenu(props: Props) {}return (- <div style={{ overflowY: 'hidden' }}>+ <Box sx={{ overflowY: 'hidden' }}>{isImportExportTagGroupDialogOpened && (<ImportExportTagGroupsDialogopen={isImportExportTagGroupDialogOpened}@@ -187,7 +188,7 @@ function TagLibraryMenu(props: Props) {type="file"onChange={handleFileInputChange}/>- </div>+ </Box>);}diff --git a/src/renderer/components/menus/TagMenu.tsx b/src/renderer/components/menus/TagMenu.tsxindex 2f8789090..1f43047de 100644--- a/src/renderer/components/menus/TagMenu.tsx+++ b/src/renderer/components/menus/TagMenu.tsx@@ -30,6 +30,7 @@ import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';import { getMaxSearchResults } from '-/reducers/settings';import { TS } from '-/tagspaces.namespace';+import { Box } from '@mui/material';import ListItemIcon from '@mui/material/ListItemIcon';import ListItemText from '@mui/material/ListItemText';import Menu from '@mui/material/Menu';@@ -111,7 +112,7 @@ function TagMenu(props: Props) {selectedTag.functionality && selectedTag.functionality.length > 0;return (- <div style={{ overflowY: 'hidden' }}>+ <Box sx={{ overflowY: 'hidden' }}><Menu anchorEl={anchorEl} open={open} onClose={onClose}><TsMenuList>{!isSmartTag && (@@ -154,7 +155,7 @@ function TagMenu(props: Props) {)}</TsMenuList></Menu>- </div>+ </Box>);}diff --git a/src/renderer/containers/MainPage.tsx b/src/renderer/containers/MainPage.tsxindex 29aeb2beb..62f35d128 100644--- a/src/renderer/containers/MainPage.tsx+++ b/src/renderer/containers/MainPage.tsx@@ -25,7 +25,7 @@ import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';import { usePanelsContext } from '-/hooks/usePanelsContext';import { useUserContext } from '-/hooks/useUserContext';import useEventListener from '-/utils/useEventListener';-import { useMediaQuery } from '@mui/material';+import { Box, useMediaQuery } from '@mui/material';import Drawer from '@mui/material/Drawer';import SwipeableDrawer from '@mui/material/SwipeableDrawer';import { styled, useTheme } from '@mui/material/styles';@@ -311,8 +311,8 @@ function MainPage() {<Root><GlobalHotKeys handlers={keyBindingHandlers} keyMap={keyMap}><PageNotification />- <div- style={{+ <Box+ sx={{backgroundColor: theme.palette.background.default,height: '100%',}}@@ -353,7 +353,7 @@ function MainPage() {{isDesktopMode || (AppConfig.isAmplify && !isLoggedIn()) ? (<><Drawer- style={{ backgroundColor: 'unset' }}+ sx={{ backgroundColor: 'unset' }}variant="persistent"anchor="left"open={drawerOpened}@@ -386,7 +386,7 @@ function MainPage() {{renderContainers()}</>)}- </div>+ </Box></GlobalHotKeys></Root>);diff --git a/src/renderer/perspectives/grid/components/GridPagination.tsx b/src/renderer/perspectives/grid/components/GridPagination.tsxindex c9fc7c37f..067f49b10 100644--- a/src/renderer/perspectives/grid/components/GridPagination.tsx+++ b/src/renderer/perspectives/grid/components/GridPagination.tsx@@ -290,9 +290,9 @@ function GridPagination(props: Props) {</Box><TooltipTS title={t('core:changeThumbnail')} placement="bottom"><Box- style={{ backgroundImage: thumbImage.current }}sx={{':hover': { border: '1px dashed gray !important' },+ backgroundImage: thumbImage.current,borderRadius: AppConfig.defaultCSSRadius,border: '1px solid transparent',height: 100,@@ -389,10 +389,8 @@ function GridPagination(props: Props) {openDirectoryMenu(event, currentDirectoryPath)}onClick={onClick}- style={{- backgroundImage: backgroundImage.current,- }}sx={{+ backgroundImage: backgroundImage.current,height: '100%',overflowY: 'auto',overflowX: 'hidden',diff --git a/src/renderer/perspectives/grid/components/GridSettingsDialog.tsx b/src/renderer/perspectives/grid/components/GridSettingsDialog.tsxindex cd0727268..5defae033 100644--- a/src/renderer/perspectives/grid/components/GridSettingsDialog.tsx+++ b/src/renderer/perspectives/grid/components/GridSettingsDialog.tsx@@ -163,7 +163,7 @@ function GridSettingsDialog(props: Props) {</TsButton></>)}- <Box style={{ display: 'flex', marginTop: 8 }}>+ <Box sx={{ display: 'flex', marginTop: '8px' }}><Typographysx={{ color: theme.palette.text.primary, alignSelf: 'center' }}variant="body1"@@ -279,7 +279,7 @@ function GridSettingsDialog(props: Props) {}}><ListItemText- style={{ display: 'flex' }}+ sx={{ display: 'flex' }}primary={<>{t('core:sort') + ': ' + t(sortBy) + ' '}@@ -360,7 +360,7 @@ function GridSettingsDialog(props: Props) {{/* <FormHelperText>{t('core:pageLimitHelp')}</FormHelperText> */}</FormControl></DialogContent>- <TsDialogActions style={{ justifyContent: 'space-between' }}>+ <TsDialogActions sx={{ justifyContent: 'space-between' }}>{smallScreen ? (<div style={{ width: 1 }} />) : (diff --git a/src/renderer/utils/useEventListener.ts b/src/renderer/utils/useEventListener.tsindex 3b7ce3ef7..64201d1e9 100644--- a/src/renderer/utils/useEventListener.ts+++ b/src/renderer/utils/useEventListener.ts@@ -17,30 +17,7 @@* https://usehooks-typescript.com/use-event-listener/* eslint-disable @typescript-eslint/ban-types*/-import { useRef, useEffect, RefObject } from 'react';--/*-// Usage-function Component() {- // Define button ref- const buttonRef = useRef<HTMLButtonElement>(null)- const onScroll = (event: Event) => {- console.log('window scrolled!', event)- }- const onClick = (event: Event) => {- console.log('button clicked!', event)- }- // example with window based event- useEventListener('scroll', onScroll)- // example with element based event- useEventListener('click', onClick, buttonRef)- return (- <div style={{ minHeight: '200vh' }}>- <button ref={buttonRef}>Click me</button>- </div>-)-}-*/+import { RefObject, useEffect, useRef } from 'react';// Hookexport default function useEventListener<