Skip to content

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

chore: optimizing performance by removing usage of style elements

Ilian Sapundshiev1353413019d6
diff --git a/src/renderer/AppConfig.ts b/src/renderer/AppConfig.ts
index 51681e452..aa0e7a5aa 100644
--- a/src/renderer/AppConfig.ts
+++ b/src/renderer/AppConfig.ts
@@ -168,8 +168,8 @@ AppConfig.maxCollectedTag = 500;
AppConfig.maxLoops = 2;
AppConfig.defaultFolderColor = '#a466aa'; // 'gray';
AppConfig.defaultFileColor = '#33b5be';
-AppConfig.defaultCSSRadius = 10;
-AppConfig.defaultSpaceBetweenButtons = 10;
+AppConfig.defaultCSSRadius = '10px';
+AppConfig.defaultSpaceBetweenButtons = '10px';
AppConfig.aiFolder = 'ai';
AppConfig.defaultMapBounds =
typeof window !== 'undefined' && window.ExtDefaultMapBounds !== undefined
diff --git a/src/renderer/components/CommonIcons.tsx b/src/renderer/components/CommonIcons.tsx
index 4b44cac07..602fe6637 100644
--- a/src/renderer/components/CommonIcons.tsx
+++ b/src/renderer/components/CommonIcons.tsx
@@ -21,11 +21,11 @@ import KeyboardReturnIcon from '@mui/icons-material/KeyboardReturn';
import MarkdownRawIcon from '@mui/icons-material/SimCardDownloadOutlined';
export const ParentFolderIcon = (props) => (
- <KeyboardReturnIcon style={{ transform: 'rotate(90deg)' }} {...props} />
+ <KeyboardReturnIcon sx={{ transform: 'rotate(90deg)' }} {...props} />
);
export const MarkdownFileIcon = (props) => (
- <MarkdownRawIcon style={{ transform: 'scaleX(-1)' }} />
+ <MarkdownRawIcon sx={{ transform: 'scaleX(-1)' }} />
);
export const NavigateToFolderIcon = (props) => <KeyboardReturnIcon />;
@@ -169,10 +169,7 @@ export { default as RestoreIcon } from '@mui/icons-material/SettingsBackupRestor
import ExpandCircleDownOutlined from '@mui/icons-material/ExpandCircleDownOutlined';
export const PrevDocumentIcon = (props) => (
- <ExpandCircleDownOutlined
- style={{ transform: 'rotate(180deg)' }}
- {...props}
- />
+ <ExpandCircleDownOutlined sx={{ transform: 'rotate(180deg)' }} {...props} />
);
export { default as NextDocumentIcon } from '@mui/icons-material/ExpandCircleDownOutlined';
@@ -208,7 +205,7 @@ export { default as ExportImportIcon } from '@mui/icons-material/SwapHoriz';
export { default as ExportIcon } from '@mui/icons-material/ExitToApp';
export const ImportIcon = (props) => (
- <ExportIcon style={{ transform: 'rotate(180deg)' }} {...props} />
+ <ExportIcon sx={{ transform: 'rotate(180deg)' }} {...props} />
);
export { default as SortingIcon } from '@mui/icons-material/SwapVerticalCircleOutlined';
diff --git a/src/renderer/components/EntryContainerTitle.tsx b/src/renderer/components/EntryContainerTitle.tsx
index 26dcbf4e6..e0d16078e 100644
--- a/src/renderer/components/EntryContainerTitle.tsx
+++ b/src/renderer/components/EntryContainerTitle.tsx
@@ -219,7 +219,7 @@ function EntryContainerTitle(props: Props) {
currentLocation?.getDirSeparator(),
)
}
- <MoreMenuIcon style={{ fontSize: 20 }} />
+ <MoreMenuIcon sx={{ fontSize: '20px' }} />
</FileBadge>
</>
) : (
@@ -241,8 +241,8 @@ function EntryContainerTitle(props: Props) {
WebkitAppRegion: 'no-drag',
}}
>
- <FolderIcon style={{ fontSize: 20 }} />
- <MoreMenuIcon style={{ fontSize: 20 }} />
+ <FolderIcon sx={{ fontSize: '20px' }} />
+ <MoreMenuIcon sx={{ fontSize: '20px' }} />
</FileBadge>
)}
<Tooltip title={openedEntry.isFile && fileName}>
diff --git a/src/renderer/components/EntryProperties.tsx b/src/renderer/components/EntryProperties.tsx
index bcf5bc9f4..613bd2da0 100644
--- a/src/renderer/components/EntryProperties.tsx
+++ b/src/renderer/components/EntryProperties.tsx
@@ -45,7 +45,7 @@ import TsIconButton from '-/components/TsIconButton';
import TsTextField from '-/components/TsTextField';
import ConfirmDialog from '-/components/dialogs/ConfirmDialog';
import LinkGeneratorDialog from '-/components/dialogs/LinkGeneratorDialog';
-import MoveCopyFilesDialog from '-/components/dialogs/MoveCopyFilesDialog';
+import { useMenuContext } from '-/components/dialogs/hooks/useMenuContext';
import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
import { useEditedEntryMetaContext } from '-/hooks/useEditedEntryMetaContext';
import { useFilePropertiesContext } from '-/hooks/useFilePropertiesContext';
@@ -53,7 +53,6 @@ import { useIOActionsContext } from '-/hooks/useIOActionsContext';
import { useNotificationContext } from '-/hooks/useNotificationContext';
import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';
import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
-import { isDesktopMode } from '-/reducers/settings';
import {
dirNameValidation,
fileNameValidation,
@@ -83,7 +82,6 @@ import {
extractFileName,
extractTitle,
} from '@tagspaces/tagspaces-common/paths';
-import { getUuid } from '@tagspaces/tagspaces-common/utils-io';
import L from 'leaflet';
import React, {
ChangeEvent,
@@ -102,9 +100,7 @@ import {
Popup,
TileLayer,
} from 'react-leaflet';
-import { useSelector } from 'react-redux';
import { Pro } from '../pro';
-import { useMenuContext } from '-/components/dialogs/hooks/useMenuContext';
const ThumbnailTextField = styled(TsTextField)(({ theme }) => ({
[`& .${inputBaseClasses.root}`]: {
@@ -570,7 +566,7 @@ function EntryProperties(props: Props) {
onChange={handleFileNameChange}
/>
{fileNameError.current && (
- <FormHelperText style={{ marginTop: 0 }}>
+ <FormHelperText sx={{ marginTop: 0 }}>
{t(
'core:' +
(openedEntry.isFile ? 'fileNameHelp' : 'directoryNameHelp'),
diff --git a/src/renderer/components/FileUploadContainer.tsx b/src/renderer/components/FileUploadContainer.tsx
index 7c5f3bdf8..9f39a06db 100644
--- a/src/renderer/components/FileUploadContainer.tsx
+++ b/src/renderer/components/FileUploadContainer.tsx
@@ -16,7 +16,14 @@
*
*/
-import React, {
+import AppConfig from '-/AppConfig';
+import { useFileUploadDialogContext } from '-/components/dialogs/hooks/useFileUploadDialogContext';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import { useEditedEntryMetaContext } from '-/hooks/useEditedEntryMetaContext';
+import { useIOActionsContext } from '-/hooks/useIOActionsContext';
+import { actions as AppActions, AppDispatch } from '-/reducers/app';
+import { TS } from '-/tagspaces.namespace';
+import {
ChangeEvent,
forwardRef,
Ref,
@@ -24,13 +31,6 @@ import React, {
useRef,
} from 'react';
import { useDispatch } from 'react-redux';
-import { TS } from '-/tagspaces.namespace';
-import AppConfig from '-/AppConfig';
-import { actions as AppActions, AppDispatch } from '-/reducers/app';
-import { useIOActionsContext } from '-/hooks/useIOActionsContext';
-import { useEditedEntryMetaContext } from '-/hooks/useEditedEntryMetaContext';
-import { useFileUploadDialogContext } from '-/components/dialogs/hooks/useFileUploadDialogContext';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
interface Props {
id?: string;
diff --git a/src/renderer/components/FilesDragPreview.tsx b/src/renderer/components/FilesDragPreview.tsx
index 09e457c84..a8df6300c 100644
--- a/src/renderer/components/FilesDragPreview.tsx
+++ b/src/renderer/components/FilesDragPreview.tsx
@@ -1,8 +1,8 @@
-import React from 'react';
+import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
import Avatar from '@mui/material/Avatar';
import Chip from '@mui/material/Chip';
+import React from 'react';
import { useTranslation } from 'react-i18next';
-import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
export interface Props {
// entriesLength: number;
@@ -19,7 +19,7 @@ export function FilesDragPreview(props: Props) {
<Chip
size="small"
avatar={<Avatar>{entriesLength}</Avatar>}
- style={{ marginLeft: 15 }}
+ sx={{ marginLeft: '15px' }}
label={t('core:selectedFiles')}
color="primary"
/>
diff --git a/src/renderer/components/FolderContainer.tsx b/src/renderer/components/FolderContainer.tsx
index c86dfac2f..17011faf8 100644
--- a/src/renderer/components/FolderContainer.tsx
+++ b/src/renderer/components/FolderContainer.tsx
@@ -24,7 +24,6 @@ import TsButton from '-/components/TsButton';
import TsIconButton from '-/components/TsIconButton';
import { AIProvider } from '-/components/chat/ChatTypes';
import { adjustKeyBinding } from '-/components/dialogs/KeyboardDialog';
-import RenameEntryDialog from '-/components/dialogs/RenameEntryDialog';
import { useFileUploadDialogContext } from '-/components/dialogs/hooks/useFileUploadDialogContext';
import { useProTeaserDialogContext } from '-/components/dialogs/hooks/useProTeaserDialogContext';
import { TabNames } from '-/hooks/EntryPropsTabsContextProvider';
@@ -47,7 +46,6 @@ import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
import Typography from '@mui/material/Typography';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
-import { useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import {
@@ -322,7 +320,6 @@ function FolderContainer(props: Props) {
)}
</div>
<div style={{ minHeight: '100%', width: '100%', overflowY: 'auto' }}>
- {/*<LoadingAnimation />*/}
{/* eslint-disable-next-line jsx-a11y/anchor-has-content,jsx-a11y/anchor-is-valid */}
<a href="#" id="downloadFile" />
<RenderPerspective />
diff --git a/src/renderer/components/HelpFeedbackPanel.tsx b/src/renderer/components/HelpFeedbackPanel.tsx
index b6cd1c6e3..f7e40f350 100644
--- a/src/renderer/components/HelpFeedbackPanel.tsx
+++ b/src/renderer/components/HelpFeedbackPanel.tsx
@@ -65,11 +65,10 @@ function HelpFeedbackPanel(props: Props) {
return (
<Box
- style={{
+ sx={{
display: 'flex',
flexDirection: 'column',
- //marginLeft: 5,
- paddingLeft: 5,
+ paddingLeft: '5px',
paddingRight: 0,
height: '100%',
}}
@@ -79,10 +78,10 @@ function HelpFeedbackPanel(props: Props) {
dense={false}
component="nav"
aria-label="main help area"
- style={{
+ sx={{
height: 'calc(100% - ' + reduceHeightBy + 'px)',
overflowY: 'auto',
- marginRight: 5,
+ marginRight: '5px',
}}
>
<ListItem
@@ -93,7 +92,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<AboutIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:aboutTagSpaces')}
</Typography>
</ListItem>
@@ -105,7 +104,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<HelpIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:documentation')}
</Typography>
</ListItem>
@@ -113,7 +112,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<KeyShortcutsIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:shortcutKeys')}
</Typography>
</ListItem>
@@ -124,7 +123,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<ChangeLogIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:whatsNew')}
</Typography>
</ListItem>
@@ -132,7 +131,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<OnboardingIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:onboardingWizard')}
</Typography>
</ListItem>
@@ -142,7 +141,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<WebClipperIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:webClipper')}
</Typography>
</ListItem>
@@ -153,7 +152,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<NewFeatureIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:suggestNewFeatures')}
</Typography>
</ListItem>
@@ -163,7 +162,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<ForumIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:forums')}
</Typography>
</ListItem>
@@ -173,7 +172,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<IssueIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:reportIssues')}
</Typography>
</ListItem>
@@ -183,7 +182,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<TranslationIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:helpWithTranslation')}
</Typography>
</ListItem>
@@ -194,7 +193,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<EmailIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:emailContact')}
</Typography>
</ListItem>
@@ -207,7 +206,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<CancelSubscriptionIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:cancelSubscription')}
</Typography>
</ListItem>
@@ -216,7 +215,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<XIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('core:followOnX')}
</Typography>
</ListItem>
@@ -225,7 +224,7 @@ function HelpFeedbackPanel(props: Props) {
<ListItemIcon>
<ProTeaserIcon />
</ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
+ <Typography sx={{ color: theme.palette.text.primary }}>
{t('achieveMore') + ' TagSpaces Pro'}
</Typography>
</ListItem>
diff --git a/src/renderer/components/HelperComponents.tsx b/src/renderer/components/HelperComponents.tsx
index 526ad3917..de4fcdf19 100644
--- a/src/renderer/components/HelperComponents.tsx
+++ b/src/renderer/components/HelperComponents.tsx
@@ -25,7 +25,7 @@ export function BetaLabel() {
const { t } = useTranslation();
return (
<Tooltip title={t('featureInBetaStatus')}>
- <Typography style={{ display: 'initial' }}>
+ <Typography sx={{ display: 'initial' }}>
<sup style={{ marginLeft: 5, textTransform: 'uppercase' }}>
{t('betaStatus')}
</sup>
@@ -39,7 +39,7 @@ export function ProLabel() {
return (
!Pro && (
<Tooltip placement="top" title={t('thisFunctionalityIsAvailableInPro')}>
- <Typography style={{ display: 'initial' }}>
+ <Typography sx={{ display: 'initial' }}>
<sup style={{ marginLeft: 5 }}>PRO</sup>
</Typography>
</Tooltip>
@@ -52,7 +52,7 @@ export function ProSign() {
return (
!Pro && (
<Tooltip placement="top" title={t('thisFunctionalityIsAvailableInPro')}>
- <Typography style={{ display: 'initial' }}>
+ <Typography sx={{ display: 'initial' }}>
<sup
style={{
fontSize: 10,
diff --git a/src/renderer/components/InfoIcon.tsx b/src/renderer/components/InfoIcon.tsx
index a58264ea2..86561d5b8 100644
--- a/src/renderer/components/InfoIcon.tsx
+++ b/src/renderer/components/InfoIcon.tsx
@@ -27,7 +27,7 @@ function InfoIcon(props: Props) {
const { tooltip } = props;
return (
<Tooltip title={tooltip}>
- <HelpOutlined fontSize="small" style={{ opacity: '0.7' }} />
+ <HelpOutlined fontSize="small" sx={{ opacity: '0.7' }} />
</Tooltip>
);
}
diff --git a/src/renderer/components/LoadingAnimation.tsx b/src/renderer/components/LoadingAnimation.tsx
deleted file mode 100644
index 63051c67a..000000000
--- a/src/renderer/components/LoadingAnimation.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * TagSpaces - universal file and folder organizer
- * Copyright (C) 2017-present TagSpaces GmbH
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License (version 3) as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-/*import React from 'react';
-import { useSelector } from 'react-redux';
-import PlatformIO from '-/services/platform-facade';
-//import { isLoading } from '-/reducers/app';
-import { useTheme } from '@mui/material/styles';
-
-function LoadingAnimation() {
- const theme = useTheme();
- const loading = useSelector(isLoading);
-
- if (
- !loading ||
- !(PlatformIO.haveObjectStoreSupport() && PlatformIO.haveWebDavSupport())
- ) {
- return null;
- }
-
- return (
- <div
- style={{
- position: 'absolute',
- zIndex: 1000,
- height: '100%',
- width: '100%',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- borderRadius: 10,
- backdropFilter: 'grayscale(1)'
- }}
- >
- <div className="lds-ellipsis">
- <div style={{ backgroundColor: theme.palette.primary.main }} />
- <div style={{ backgroundColor: theme.palette.primary.main }} />
- <div style={{ backgroundColor: theme.palette.primary.main }} />
- <div style={{ backgroundColor: theme.palette.primary.main }} />
- </div>
- </div>
- );
-}
-
-export default React.memo(LoadingAnimation);*/
diff --git a/src/renderer/components/LoadingLazy.tsx b/src/renderer/components/LoadingLazy.tsx
index 9e5d5b04c..46332f410 100644
--- a/src/renderer/components/LoadingLazy.tsx
+++ b/src/renderer/components/LoadingLazy.tsx
@@ -16,10 +16,6 @@
*
*/
-import React from 'react';
-// {t('core:loading')}
-// <div style={{ padding: 10, backgroundColor: 'transparent' }}>...</div>
-
function LoadingLazy() {
return (
<div
diff --git a/src/renderer/components/MobileNavigation.tsx b/src/renderer/components/MobileNavigation.tsx
index 2622ca24f..e9004207b 100644
--- a/src/renderer/components/MobileNavigation.tsx
+++ b/src/renderer/components/MobileNavigation.tsx
@@ -493,7 +493,7 @@ function MobileNavigation(props: Props) {
<ProTeaser setShowTeaserBanner={setShowTeaserBanner} />
)}
<Box
- style={{
+ sx={{
display: 'flex',
flexDirection: 'row',
alignSelf: 'center',
@@ -505,7 +505,7 @@ function MobileNavigation(props: Props) {
tooltip={t('core:locationManager')}
keyBinding={keyBindings['showLocationManager']}
onClick={() => showPanel('locationManagerPanel')}
- style={{
+ sx={{
backgroundColor:
currentOpenedPanel === 'locationManagerPanel'
? theme.palette.primary.light
@@ -521,7 +521,7 @@ function MobileNavigation(props: Props) {
tooltip={t('core:tagLibrary')}
keyBinding={keyBindings['showTagLibrary']}
onClick={() => showPanel('tagLibraryPanel')}
- style={{
+ sx={{
backgroundColor:
currentOpenedPanel === 'tagLibraryPanel'
? theme.palette.primary.light
@@ -535,7 +535,7 @@ function MobileNavigation(props: Props) {
tooltip={t('core:quickAccess')}
data-tid="quickAccessButton"
onClick={() => showPanel('searchPanel')}
- style={{
+ sx={{
backgroundColor:
currentOpenedPanel === 'searchPanel'
? theme.palette.primary.light
@@ -549,7 +549,7 @@ function MobileNavigation(props: Props) {
title={t('core:help')}
data-tid="helpFeedback"
onClick={() => showPanel('helpFeedbackPanel')}
- style={{
+ sx={{
backgroundColor:
currentOpenedPanel === 'helpFeedbackPanel'
? theme.palette.primary.light
@@ -565,7 +565,7 @@ function MobileNavigation(props: Props) {
onClick={() => {
openSettingsDialog();
}}
- style={{
+ sx={{
backgroundColor: theme.palette.background.default,
}}
title={t('core:settings')}
diff --git a/src/renderer/components/PathBreadcrumbs.tsx b/src/renderer/components/PathBreadcrumbs.tsx
index a40aca537..dc0ccb743 100644
--- a/src/renderer/components/PathBreadcrumbs.tsx
+++ b/src/renderer/components/PathBreadcrumbs.tsx
@@ -16,7 +16,6 @@
*
*/
-import React from 'react';
import AppConfig from '-/AppConfig';
import {
CloudLocationIcon,
@@ -24,6 +23,7 @@ import {
MoreMenuIcon,
} from '-/components/CommonIcons';
import Tooltip from '-/components/Tooltip';
+import { useMenuContext } from '-/components/dialogs/hooks/useMenuContext';
import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
@@ -35,8 +35,8 @@ import {
extractShortDirectoryName,
normalizePath,
} from '@tagspaces/tagspaces-common/paths';
+import React from 'react';
import { useTranslation } from 'react-i18next';
-import { useMenuContext } from '-/components/dialogs/hooks/useMenuContext';
const StyledBreadcrumb = styled(Chip)(({ theme }) => {
const backgroundColor =
@@ -194,7 +194,7 @@ function PathBreadcrumbs(props: Props) {
onDelete={openDirMenu}
onClick={openDirMenu}
onContextMenu={openDirMenu}
- style={{ marginRight: 2 }}
+ sx={{ marginRight: '2px' }}
/>
</Tooltip>
);
diff --git a/src/renderer/components/Tag.tsx b/src/renderer/components/Tag.tsx
index b45b18884..b8c7bb039 100644
--- a/src/renderer/components/Tag.tsx
+++ b/src/renderer/components/Tag.tsx
@@ -16,10 +16,8 @@
*
*/
-import React from 'react';
-import { InfoTooltipIcon } from '-/components/CommonIcons';
-import Button from '@mui/material/Button';
import Tooltip from '-/components/Tooltip';
+import Button from '@mui/material/Button';
interface Props {
tagTitle?: string;
@@ -35,7 +33,7 @@ function Tag(props: Props) {
<Tooltip title={tagTitle}>
<Button
size="small"
- style={{
+ sx={{
opacity: isDragging ? 0.5 : 1,
fontSize: 13,
fontWeight: 'normal',
@@ -45,14 +43,14 @@ function Tag(props: Props) {
whiteSpace: 'nowrap',
color: textColor,
backgroundColor: backgroundColor,
- minHeight: 20,
+ minHeight: '20px',
minWidth: 0,
- margin: 2,
+ margin: '2px',
paddingTop: 0,
paddingBottom: 0,
paddingRight: 0,
- paddingLeft: 5,
- borderRadius: 5,
+ paddingLeft: '5px',
+ borderRadius: '5px',
}}
>
{children}
diff --git a/src/renderer/components/TagContainer.tsx b/src/renderer/components/TagContainer.tsx
index bc71df8c7..7c85f127e 100644
--- a/src/renderer/components/TagContainer.tsx
+++ b/src/renderer/components/TagContainer.tsx
@@ -19,6 +19,7 @@
import Tag from '-/components/Tag';
import TagContainerMenu from '-/components/TagContainerMenu';
import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
+import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
import { getTagColor, getTagTextColor } from '-/reducers/settings';
import { getTagColors } from '-/services/taglibrary-utils';
import { TS } from '-/tagspaces.namespace';
@@ -29,7 +30,6 @@ import PlaceIcon from '@mui/icons-material/Place';
import { formatDateTime } from '@tagspaces/tagspaces-common/misc';
import React, { useMemo } from 'react';
import { useSelector } from 'react-redux';
-import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
interface Props {
tag: TS.Tag;
@@ -211,19 +211,19 @@ function TagContainer(props: Props) {
>
{(isTagGeo || isGeoSmartTag) && (
<PlaceIcon
- style={{
+ sx={{
color: textColor,
- height: 16,
- marginLeft: -5,
+ height: '16px',
+ marginLeft: '-5px',
}}
/>
)}
{(isTagDate || isDateSmartTag) && (
<DateIcon
- style={{
+ sx={{
color: textColor,
- height: 16,
- marginLeft: -5,
+ height: '16px',
+ marginLeft: '-5px',
}}
/>
)}
diff --git a/src/renderer/components/TsDatePicker.tsx b/src/renderer/components/TsDatePicker.tsx
index 0ae6653fe..b6de12c7c 100644
--- a/src/renderer/components/TsDatePicker.tsx
+++ b/src/renderer/components/TsDatePicker.tsx
@@ -43,21 +43,21 @@ function TsDatePicker(props) {
},
'& .Mui-focused': {
backgroundColor: 'transparent !important',
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
transition: '0.3s',
'&:hover .MuiOutlinedInput-notchedOutline': {
border: '2px solid transparent !important',
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
'& .MuiOutlinedInput-notchedOutline': {
border: '2px solid transparent',
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
'& .Mui-focused .MuiOutlinedInput-notchedOutline': {
border: `2px solid ${alpha(theme.palette.divider, 0.5)} !important`,
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
}}
format="yyyy-MM-dd"
diff --git a/src/renderer/components/TsTextField.tsx b/src/renderer/components/TsTextField.tsx
index 833733d8e..ac6e3af1e 100644
--- a/src/renderer/components/TsTextField.tsx
+++ b/src/renderer/components/TsTextField.tsx
@@ -100,42 +100,40 @@ function TsTextField(props: TSTextFieldProps) {
return (
<div>
{label && (
- <FormHelperText style={{ marginLeft: 5, marginTop: 0 }}>
+ <FormHelperText sx={{ marginLeft: '5px', marginTop: 0 }}>
{label}
</FormHelperText>
)}
<TextField
onContextMenu={handleContextMenu}
- style={{
- cursor: 'context-menu',
- marginTop: 0,
- }}
margin="dense"
size={desktopMode ? 'small' : 'medium'}
variant="outlined"
fullWidth
sx={{
+ cursor: 'context-menu',
+ marginTop: 0,
backgroundColor: alpha(theme.palette.divider, 0.2),
'&:hover': {
backgroundColor: alpha(theme.palette.divider, 0.5),
},
'& .Mui-focused': {
backgroundColor: 'transparent !important',
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
transition: '0.3s',
'&:hover .MuiOutlinedInput-notchedOutline': {
border: '2px solid transparent !important',
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
'& .MuiOutlinedInput-notchedOutline': {
border: '2px solid transparent',
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
'& .Mui-focused .MuiOutlinedInput-notchedOutline': {
border: `2px solid ${alpha(theme.palette.divider, 0.5)} !important`,
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
}}
{...restProps}
diff --git a/src/renderer/components/TsTimePicker.tsx b/src/renderer/components/TsTimePicker.tsx
index e6852bde8..7697825b0 100644
--- a/src/renderer/components/TsTimePicker.tsx
+++ b/src/renderer/components/TsTimePicker.tsx
@@ -31,7 +31,7 @@ function TsTimePicker(props) {
return (
<div>
{label && (
- <FormHelperText style={{ marginLeft: 5, marginTop: 0 }}>
+ <FormHelperText sx={{ marginLeft: '5px', marginTop: 0 }}>
{label}
</FormHelperText>
)}
@@ -43,21 +43,21 @@ function TsTimePicker(props) {
},
'& .Mui-focused': {
backgroundColor: 'transparent !important',
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
transition: '0.3s',
'&:hover .MuiOutlinedInput-notchedOutline': {
border: '2px solid transparent !important',
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
'& .MuiOutlinedInput-notchedOutline': {
border: '2px solid transparent',
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
'& .Mui-focused .MuiOutlinedInput-notchedOutline': {
border: `2px solid ${alpha(theme.palette.divider, 0.5)} !important`,
- borderRadius: AppConfig.defaultCSSRadius + 'px',
+ borderRadius: AppConfig.defaultCSSRadius,
},
}}
{...props}
diff --git a/src/renderer/components/TsToolbarButton.tsx b/src/renderer/components/TsToolbarButton.tsx
index d1945a44d..0f39252b9 100644
--- a/src/renderer/components/TsToolbarButton.tsx
+++ b/src/renderer/components/TsToolbarButton.tsx
@@ -51,9 +51,9 @@ function TsToolbarButton(props: TSIconButtonProps) {
disabled={disabled}
style={{
borderRadius: AppConfig.defaultCSSRadius,
- padding: 8,
- paddingLeft: 6,
- paddingRight: 6,
+ padding: '8px',
+ paddingLeft: '6px',
+ paddingRight: '6px',
display: 'block',
...style,
}}
@@ -62,22 +62,17 @@ function TsToolbarButton(props: TSIconButtonProps) {
width: showTitle ? '0.9em' : '1em',
heigh: showTitle ? '0.9em' : '1em',
},
- // border: '1px solid transparent',
- // '&:hover': {
- // border: '1px solid ' + alpha(theme.palette.divider, 0.9),
- // borderRadius: AppConfig.defaultCSSRadius,
- // },
}}
{...restProps}
>
{children}
{showTitle && (
<Typography
- style={{
+ sx={{
display: 'block',
fontSize: 11,
- marginTop: -5,
- width: 45,
+ marginTop: '-5px',
+ width: '45px',
padding: 0,
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
diff --git a/src/renderer/perspectives/common/CellView.tsx b/src/renderer/perspectives/common/CellView.tsx
index d0ae3968d..891645f9e 100644
--- a/src/renderer/perspectives/common/CellView.tsx
+++ b/src/renderer/perspectives/common/CellView.tsx
@@ -16,36 +16,35 @@
*
*/
-import React from 'react';
-import { useSelector } from 'react-redux';
import AppConfig from '-/AppConfig';
-import { TS } from '-/tagspaces.namespace';
-import { getDesktopMode, getEntryContainerTab } from '-/reducers/settings';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
-import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
-import { usePerspectiveSettingsContext } from '-/hooks/usePerspectiveSettingsContext';
-import FileSourceDnd from '-/components/FileSourceDnd';
-import { NativeTypes } from 'react-dnd-html5-backend';
-import TargetFileBox from '-/components/TargetFileBox';
import CustomDragLayer from '-/components/CustomDragLayer';
-import TargetMoveFileBox from '-/components/TargetMoveFileBox';
import DragItemTypes from '-/components/DragItemTypes';
-import DragHandleIcon from '@mui/icons-material/DragHandleOutlined';
-import Typography from '@mui/material/Typography';
-import { useTheme } from '@mui/material/styles';
+import TargetFileBox from '-/components/TargetFileBox';
+import TargetMoveFileBox from '-/components/TargetMoveFileBox';
+import { useEntryExistDialogContext } from '-/components/dialogs/hooks/useEntryExistDialogContext';
+import { useMenuContext } from '-/components/dialogs/hooks/useMenuContext';
+import { TabNames } from '-/hooks/EntryPropsTabsContextProvider';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
+import { useIOActionsContext } from '-/hooks/useIOActionsContext';
+import { useNotificationContext } from '-/hooks/useNotificationContext';
+import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';
+import { usePerspectiveSettingsContext } from '-/hooks/usePerspectiveSettingsContext';
+import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
import {
fileOperationsEnabled,
folderOperationsEnabled,
} from '-/perspectives/common/main-container';
import { useSortedDirContext } from '-/perspectives/grid/hooks/useSortedDirContext';
-import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';
-import { useIOActionsContext } from '-/hooks/useIOActionsContext';
-import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
-import { useNotificationContext } from '-/hooks/useNotificationContext';
-import { useEntryExistDialogContext } from '-/components/dialogs/hooks/useEntryExistDialogContext';
+import { getDesktopMode, getEntryContainerTab } from '-/reducers/settings';
import i18n from '-/services/i18n';
-import { TabNames } from '-/hooks/EntryPropsTabsContextProvider';
-import { useMenuContext } from '-/components/dialogs/hooks/useMenuContext';
+import { TS } from '-/tagspaces.namespace';
+import DragHandleIcon from '@mui/icons-material/DragHandleOutlined';
+import Typography from '@mui/material/Typography';
+import { useTheme } from '@mui/material/styles';
+import React from 'react';
+import { NativeTypes } from 'react-dnd-html5-backend';
+import { useSelector } from 'react-redux';
interface Props {
fsEntry: TS.FileSystemEntry;
@@ -285,11 +284,11 @@ function CellView(props: Props) {
window.electronIO.ipcRenderer.startDrag(fsEntry.path);
}}
>
- <DragHandleIcon style={{ color: theme.palette.text.primary }} />
+ <DragHandleIcon sx={{ color: theme.palette.text.primary }} />
<Typography
color="textSecondary"
variant="caption"
- style={{ alignSelf: 'center' }}
+ sx={{ alignSelf: 'center' }}
>
{i18n.t('dragOutsideApp')}
</Typography>
diff --git a/src/renderer/perspectives/list/components/RowCell.tsx b/src/renderer/perspectives/list/components/RowCell.tsx
index 79eebeb3e..48745e0b3 100644
--- a/src/renderer/perspectives/list/components/RowCell.tsx
+++ b/src/renderer/perspectives/list/components/RowCell.tsx
@@ -324,10 +324,8 @@ function RowCell(props: Props) {
<Grid
container
wrap="nowrap"
- style={{
- borderRadius: AppConfig.defaultCSSRadius,
- }}
sx={{
+ borderRadius: AppConfig.defaultCSSRadius,
backgroundColor,
'&:hover': {
backgroundColor: theme.palette.divider + ' !important',
@@ -376,17 +374,17 @@ function RowCell(props: Props) {
</Typography>
</Grid>
) : (
- <Grid style={{ alignSelf: 'center', width: '100%', marginLeft: 5 }}>
+ <Grid sx={{ alignSelf: 'center', width: '100%', marginLeft: 5 }}>
<Typography
variant="body1"
title={fsEntry.name}
- style={{ wordBreak: 'break-all' }}
+ sx={{ wordBreak: 'break-all' }}
>
{entryTitle}
</Typography>
<Typography
data-tid="gridCellDescription"
- style={{
+ sx={{
color: 'gray',
}}
variant="body2"
@@ -442,11 +440,11 @@ function RowCell(props: Props) {
</Grid>
)}
<Grid
- style={{
+ sx={{
display: 'flex',
alignItems: 'center',
- marginRight: 5,
- paddingRight: 10,
+ marginRight: '5px',
+ paddingRight: '10px',
}}
>
<TsIconButton