Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: migration to tsiconbutton

Ilian Sapundshiev8d9d77e1dea6
diff --git a/src/renderer/components/EntryProperties.tsx b/src/renderer/components/EntryProperties.tsx
index 0407f2711..ec6bfa769 100644
--- a/src/renderer/components/EntryProperties.tsx
+++ b/src/renderer/components/EntryProperties.tsx
@@ -28,7 +28,6 @@ import { styled, useTheme } from '@mui/material/styles';
import { extractTitle } from '@tagspaces/tagspaces-common/paths';
import L from 'leaflet';
import {
- Grid,
FormControl,
Typography,
TextField,
@@ -39,6 +38,7 @@ import {
} from '@mui/material';
import Tooltip from '-/components/Tooltip';
import Stack from '@mui/material/Stack';
+import Grid from '@mui/material/Grid';
import InfoIcon from '-/components/InfoIcon';
import QRCodeIcon from '@mui/icons-material/QrCode';
import ColorPaletteIcon from '@mui/icons-material/ColorLens';
diff --git a/src/renderer/components/LocationView.tsx b/src/renderer/components/LocationView.tsx
index bcd2586f8..35dafc68c 100644
--- a/src/renderer/components/LocationView.tsx
+++ b/src/renderer/components/LocationView.tsx
@@ -23,7 +23,7 @@ import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import Typography from '@mui/material/Typography';
-import IconButton from '@mui/material/IconButton';
+import TsIconButton from '-/components/TsIconButton';
import { LocalLocationIcon, CloudLocationIcon } from '-/components/CommonIcons';
import DefaultLocationIcon from '@mui/icons-material/Highlight';
import { locationType } from '@tagspaces/tagspaces-common/misc';
@@ -281,13 +281,10 @@ function LocationView(props: Props) {
</ListItemText>
{location.isDefault && (
<Tooltip title={t('core:thisIsStartupLocation')}>
- <DefaultLocationIcon
- // color="primary"
- data-tid="startupIndication"
- />
+ <DefaultLocationIcon data-tid="startupIndication" />
</Tooltip>
)}
- <IconButton
+ <TsIconButton
aria-label={t('core:options')}
aria-haspopup="true"
edge="end"
@@ -296,10 +293,9 @@ function LocationView(props: Props) {
onContextMenu={(event) =>
handleLocationContextMenuClick(event, location)
}
- size="large"
>
<MoreVertIcon />
- </IconButton>
+ </TsIconButton>
</ListItem>
</TargetFileBox>
<DirectoryTreeView
diff --git a/src/renderer/components/SearchAutocomplete.tsx b/src/renderer/components/SearchAutocomplete.tsx
index 47464a037..bff2adef0 100644
--- a/src/renderer/components/SearchAutocomplete.tsx
+++ b/src/renderer/components/SearchAutocomplete.tsx
@@ -456,7 +456,7 @@ function SearchAutocomplete(props: Props) {
</span>
}
>
- <IconButton size="small" edge="end">
+ <IconButton edge="end">
<HelpOutlineIcon style={{ color: 'lightgray' }} />
</IconButton>
</Tooltip>
diff --git a/src/renderer/components/dialogs/settings/SettingsAdvanced.tsx b/src/renderer/components/dialogs/settings/SettingsAdvanced.tsx
index d35b4f75c..cd8e910f4 100644
--- a/src/renderer/components/dialogs/settings/SettingsAdvanced.tsx
+++ b/src/renderer/components/dialogs/settings/SettingsAdvanced.tsx
@@ -25,7 +25,7 @@ import Tooltip from '-/components/Tooltip';
import TsButton from '-/components/TsButton';
import CheckIcon from '@mui/icons-material/Check';
import EditIcon from '@mui/icons-material/Edit';
-import IconButton from '@mui/material/IconButton';
+import TsIconButton from '-/components/TsIconButton';
import Switch from '@mui/material/Switch';
import MenuItem from '@mui/material/MenuItem';
import AppConfig from '-/AppConfig';
@@ -185,14 +185,13 @@ function SettingsAdvanced(props: Props) {
<ListItemText primary={t('core:fileOpenHistory')} />
<ListItemIcon>
<Tooltip title={t('clearHistory')}>
- <IconButton
+ <TsIconButton
aria-label={t('core:clearHistory')}
onClick={() => setConfirmDialogKey(historyKeys.fileOpenKey)}
data-tid="clearSearchTID"
- size="small"
>
<DeleteIcon />
- </IconButton>
+ </TsIconButton>
</Tooltip>
</ListItemIcon>
<TsSelect
@@ -214,14 +213,13 @@ function SettingsAdvanced(props: Props) {
<ListItemText primary={t('core:folderOpenHistory')} />
<ListItemIcon>
<Tooltip title={t('clearHistory')}>
- <IconButton
+ <TsIconButton
aria-label={t('core:clearHistory')}
onClick={() => setConfirmDialogKey(historyKeys.folderOpenKey)}
data-tid="clearSearchTID"
- size="small"
>
<DeleteIcon />
- </IconButton>
+ </TsIconButton>
</Tooltip>
</ListItemIcon>
<TsSelect
@@ -243,14 +241,13 @@ function SettingsAdvanced(props: Props) {
<ListItemText primary={t('core:fileEditHistory')} />
<ListItemIcon>
<Tooltip title={t('clearHistory')}>
- <IconButton
+ <TsIconButton
aria-label={t('core:clearHistory')}
onClick={() => setConfirmDialogKey(historyKeys.fileEditKey)}
data-tid="clearSearchTID"
- size="small"
>
<DeleteIcon />
- </IconButton>
+ </TsIconButton>
</Tooltip>
</ListItemIcon>
<TsSelect
@@ -272,16 +269,15 @@ function SettingsAdvanced(props: Props) {
<ListItemText primary={t('core:searchHistory')} />
<ListItemIcon>
<Tooltip title={t('clearHistory')}>
- <IconButton
+ <TsIconButton
aria-label={t('core:clearHistory')}
onClick={() =>
setConfirmDialogKey(historyKeys.searchHistoryKey)
}
data-tid="clearSearchTID"
- size="small"
>
<DeleteIcon />
- </IconButton>
+ </TsIconButton>
</Tooltip>
</ListItemIcon>
<TsSelect
@@ -403,7 +399,7 @@ function SettingsAdvanced(props: Props) {
secondary={tileServer.serverURL}
style={{ maxWidth: 470 }}
/>
- <IconButton
+ <TsIconButton
aria-label={t('core:options')}
aria-haspopup="true"
edge="end"
@@ -411,10 +407,9 @@ function SettingsAdvanced(props: Props) {
onClick={(event) =>
handleEditTileServerClick(event, tileServer, index === 0)
}
- size="large"
>
<EditIcon />
- </IconButton>
+ </TsIconButton>
{index === 0 && (
<Tooltip title={t('core:serverIsDefaultHelp')}>
<CheckIcon
diff --git a/src/renderer/perspectives/grid/components/MainToolbar.tsx b/src/renderer/perspectives/grid/components/MainToolbar.tsx
index df03f8ec0..9083c911a 100644
--- a/src/renderer/perspectives/grid/components/MainToolbar.tsx
+++ b/src/renderer/perspectives/grid/components/MainToolbar.tsx
@@ -22,7 +22,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { saveAs } from 'file-saver';
import { Toolbar, Box, Divider, Badge } from '@mui/material/';
import Tooltip from '-/components/Tooltip';
-import IconButton from '@mui/material/IconButton';
+import TsIconButton from '-/components/TsIconButton';
import SortingIcon from '@mui/icons-material/SwapVerticalCircle';
import ShareIcon from '@mui/icons-material/Share';
// import DragOnIcon from '@mui/icons-material/PanTool';
@@ -153,7 +153,7 @@ function MainToolbar(props: Props) {
title={t('core:navigateToParentDirectory')}
keyBinding={keyBindings['openParentDirectory']}
>
- <IconButton
+ <TsIconButton
aria-label={t('core:navigateToParentDirectory')}
data-tid={prefixDataTID + 'PerspectiveOnBackButton'}
onClick={() => {
@@ -161,27 +161,27 @@ function MainToolbar(props: Props) {
}}
>
<ParentFolderIcon />
- </IconButton>
+ </TsIconButton>
</Tooltip>
<Tooltip
title={t('core:toggleSelectAllFiles')}
keyBinding={keyBindings['selectAll']}
>
- <IconButton
+ <TsIconButton
data-tid={prefixDataTID + 'PerspectiveSelectAllFiles'}
onClick={toggleSelectAllFiles}
>
{selectedEntries.length > 1 ? <SelectedIcon /> : <UnSelectedIcon />}
- </IconButton>
+ </TsIconButton>
</Tooltip>
<Tooltip title={t('core:directoryPropertiesTitle')}>
- <IconButton
+ <TsIconButton
aria-label={t('core:directoryPropertiesTitle')}
data-tid="openFolderProperties"
onClick={showProperties}
>
<FolderPropertiesIcon />
- </IconButton>
+ </TsIconButton>
</Tooltip>
<Divider flexItem orientation="vertical" sx={{ mx: 0.5, my: 1 }} />
<Box sx={{ display: selectedEntries.length < 1 ? 'none' : 'flex' }}>
@@ -191,13 +191,13 @@ function MainToolbar(props: Props) {
keyBinding={keyBindings['addRemoveTags']}
>
<span>
- <IconButton
+ <TsIconButton
aria-label={t('core:tagSelectedEntries')}
data-tid={prefixDataTID + 'PerspectiveAddRemoveTags'}
onClick={openAddRemoveTagsDialog}
>
<TagIcon />
- </IconButton>
+ </TsIconButton>
</span>
</Tooltip>
)}
@@ -207,13 +207,13 @@ function MainToolbar(props: Props) {
keyBinding={keyBindings['copyMoveSelectedEntries']}
>
<span>
- <IconButton
+ <TsIconButton
aria-label={t('core:copyMoveSelectedEntries')}
data-tid={prefixDataTID + 'PerspectiveCopySelectedFiles'}
onClick={openMoveCopyFilesDialog}
>
<CopyIcon />
- </IconButton>
+ </TsIconButton>
</span>
</Tooltip>
)}
@@ -223,35 +223,34 @@ function MainToolbar(props: Props) {
keyBinding={keyBindings['deleteDocument']}
>
<span>
- <IconButton
+ <TsIconButton
aria-label={t('core:deleteSelectedEntries')}
data-tid={prefixDataTID + 'PerspectiveDeleteMultipleFiles'}
onClick={() => openDeleteMultipleEntriesDialog()}
- // </span>size="large"
>
<DeleteIcon />
- </IconButton>
+ </TsIconButton>
</span>
</Tooltip>
)}
{openShareFilesDialog && (
<ProTooltip tooltip={t('core:shareFiles')}>
<span>
- <IconButton
+ <TsIconButton
aria-label={t('core:shareFiles')}
data-tid={prefixDataTID + 'PerspectiveShareFiles'}
onClick={openShareFilesDialog}
disabled={selectedEntries.length < 1}
>
<ShareIcon />
- </IconButton>
+ </TsIconButton>
</span>
</ProTooltip>
)}
<Divider flexItem orientation="vertical" sx={{ mx: 0.5, my: 1 }} />
</Box>
<Tooltip title={t('core:sort')}>
- <IconButton
+ <TsIconButton
aria-label={t('core:sort')}
data-tid={prefixDataTID + 'PerspectiveSortMenu'}
onClick={(e) => {
@@ -259,28 +258,28 @@ function MainToolbar(props: Props) {
}}
>
<SortingIcon />
- </IconButton>
+ </TsIconButton>
</Tooltip>
{showDownloadButton && (
<Tooltip title={t('core:downloadFiles')}>
- <IconButton
+ <TsIconButton
data-tid={prefixDataTID + 'PerspectiveDownloadMultipleMenuTID'}
onClick={multipleDownload}
>
<DownloadIcon />
- </IconButton>
+ </TsIconButton>
</Tooltip>
)}
{Pro &&
!AppConfig.isCordovaAndroid && ( // SaveAs do not worlk on Android
<Tooltip title={t('core:exportCsv')}>
- <IconButton
+ <TsIconButton
data-tid={prefixDataTID + 'PerspectiveExportCsvMenuTID'}
onClick={handleExportCsvMenu}
style={{ transform: 'scale(-1, 1)' }}
>
<ExportIcon />
- </IconButton>
+ </TsIconButton>
</Tooltip>
)}
<Divider flexItem orientation="vertical" sx={{ mx: 0.5, my: 1 }} />
@@ -290,14 +289,14 @@ function MainToolbar(props: Props) {
</Box>
{AppConfig.isElectron && !currentLocation.haveObjectStoreSupport() && (
<Tooltip title={t('core:dragMode')}>
- <IconButton
+ <TsIconButton
data-tid={prefixDataTID + 'PerspectiveDragNative'}
onClick={() => {
setNativeDragModeEnabled(!nativeDragModeEnabled);
}}
>
{nativeDragModeEnabled ? <DragOnIcon /> : <DragOffIcon />}
- </IconButton>
+ </TsIconButton>
</Tooltip>
)}
<Box sx={{ flexGrow: 1 }} />
@@ -308,7 +307,7 @@ function MainToolbar(props: Props) {
(folderSettingsAvailable ? ' - folder specific' : '')
}
>
- <IconButton
+ <TsIconButton
data-tid={prefixDataTID + 'PerspectiveOptionsMenu'}
onClick={openSettings}
>
@@ -317,7 +316,7 @@ function MainToolbar(props: Props) {
) : (
<PerspectiveSettingsIcon />
)}
- </IconButton>
+ </TsIconButton>
</Tooltip>
</Box>
</Toolbar>