Skip to content

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

chore: cleaning up css

Ilian Sapundshiev05c02ad50ff5
diff --git a/src/renderer/components/CustomLogo.tsx b/src/renderer/components/CustomLogo.tsx
index 05422f86a..9d4fc14d6 100644
--- a/src/renderer/components/CustomLogo.tsx
+++ b/src/renderer/components/CustomLogo.tsx
@@ -52,12 +52,13 @@ function CustomLogo() {
return (
<Box
onClick={() => openAboutDialog()}
- sx={{
- width: '100%',
- textAlign: 'center',
- // @ts-ignore
- WebkitAppRegion: 'drag',
- }}
+ sx={
+ {
+ width: '100%',
+ textAlign: 'center',
+ WebkitAppRegion: 'drag',
+ } as React.CSSProperties
+ }
>
<Tooltip
title={updateAvailable ? t('core:newVersionAvailable') : tsAboutTitle}
diff --git a/src/renderer/components/EntryContainerButtons.tsx b/src/renderer/components/EntryContainerButtons.tsx
index 184fa1b8d..092a9ff88 100644
--- a/src/renderer/components/EntryContainerButtons.tsx
+++ b/src/renderer/components/EntryContainerButtons.tsx
@@ -16,7 +16,6 @@
*
*/
-import React from 'react';
import AppConfig from '-/AppConfig';
import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
import { useEntryPropsTabsContext } from '-/hooks/useEntryPropsTabsContext';
@@ -27,6 +26,7 @@ import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';
import { Pro } from '-/pro';
import { isDesktopMode, isRevisionsEnabled } from '-/reducers/settings';
import { Box, ButtonGroup, Switch, Tooltip } from '@mui/material';
+import React from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { CancelIcon, CloseEditIcon, SaveIcon } from './CommonIcons';
@@ -111,7 +111,7 @@ function EntryContainerButtons(props: EntryContainerButtonsProps) {
setEditMode(false);
setFileChanged(false);
}}
- style={{
+ sx={{
borderRadius: 'unset',
borderTopLeftRadius: AppConfig.defaultCSSRadius,
borderBottomLeftRadius: AppConfig.defaultCSSRadius,
@@ -126,11 +126,11 @@ function EntryContainerButtons(props: EntryContainerButtonsProps) {
startIcon={closeCancelIcon}
>
<Box
- style={{
+ sx={{
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
overflow: 'hidden',
- maxWidth: 100,
+ maxWidth: '100px',
}}
>
{fileChanged ? t('core:cancel') : t('core:exitEditMode')}
@@ -153,7 +153,7 @@ function EntryContainerButtons(props: EntryContainerButtonsProps) {
data-tid="fileContainerSaveFile"
startIcon={desktopMode && <SaveIcon />}
loading={isSavingInProgress}
- style={{
+ sx={{
borderRadius: 'unset',
borderTopRightRadius: AppConfig.defaultCSSRadius,
borderBottomRightRadius: AppConfig.defaultCSSRadius,
@@ -172,11 +172,11 @@ function EntryContainerButtons(props: EntryContainerButtonsProps) {
return (
<Box
- style={{
+ sx={{
marginLeft: 'auto',
display: 'flex',
flexDirection: 'column',
- marginRight: 10,
+ marginRight: '10px',
alignItems: 'anchor-center',
}}
>
diff --git a/src/renderer/components/EntryContainerMenu.tsx b/src/renderer/components/EntryContainerMenu.tsx
index 7df76c2ea..2620e30f1 100644
--- a/src/renderer/components/EntryContainerMenu.tsx
+++ b/src/renderer/components/EntryContainerMenu.tsx
@@ -17,6 +17,7 @@ import MenuKeyBinding from '-/components/menus/MenuKeyBinding';
import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
import { useFullScreenContext } from '-/hooks/useFullScreenContext';
import { useIOActionsContext } from '-/hooks/useIOActionsContext';
+import { useNotificationContext } from '-/hooks/useNotificationContext';
import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';
import {
getKeyBindingObject,
@@ -38,7 +39,6 @@ import {
import { extractDirectoryName } from '@tagspaces/tagspaces-common/paths';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
-import { useNotificationContext } from '-/hooks/useNotificationContext';
interface Props {
anchorEl: null | HTMLElement;
@@ -60,7 +60,6 @@ function EntryContainerMenu(props: Props) {
const { toggleFullScreen } = useFullScreenContext();
const { openedEntry } = useOpenedEntryContext();
const { t } = useTranslation();
- // const theme = useTheme();
const {
toggleEntryFullWidth,
openLink,
@@ -425,7 +424,6 @@ function EntryContainerMenu(props: Props) {
<DeleteIcon />
</ListItemIcon>
<ListItemText primary={t('core:deleteDirectory')} />
- {/* <MenuKeyBinding keyBinding={keyBindings['deleteDocument']} /> */}
</MenuItem>,
);
}
diff --git a/src/renderer/components/EntryContainerNav.tsx b/src/renderer/components/EntryContainerNav.tsx
index 3826fdfa9..e655cb589 100644
--- a/src/renderer/components/EntryContainerNav.tsx
+++ b/src/renderer/components/EntryContainerNav.tsx
@@ -7,6 +7,7 @@ import TsIconButton from '-/components/TsIconButton';
import { usePerspectiveActionsContext } from '-/hooks/usePerspectiveActionsContext';
import { getKeyBindingObject } from '-/reducers/settings';
import { TS } from '-/tagspaces.namespace';
+import { Box } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
@@ -25,13 +26,12 @@ function EntryContainerNav(props: Props) {
const theme = useTheme();
return (
- <div
- style={{
+ <Box
+ sx={{
zIndex: 1,
position: 'absolute',
top: 5,
right: 5,
- // backgroundColor: theme.palette.background.default,
display: 'flex',
alignItems: 'center',
}}
@@ -77,7 +77,7 @@ function EntryContainerNav(props: Props) {
<CloseIcon />
</TsIconButton>
)}
- </div>
+ </Box>
);
}
diff --git a/src/renderer/components/EntryContainerTabs.tsx b/src/renderer/components/EntryContainerTabs.tsx
index 47720524d..0195eff9f 100644
--- a/src/renderer/components/EntryContainerTabs.tsx
+++ b/src/renderer/components/EntryContainerTabs.tsx
@@ -16,6 +16,7 @@
*
*/
+import EntryContainerButtons from '-/components/EntryContainerButtons';
import LoadingLazy from '-/components/LoadingLazy';
import TsTabPanel from '-/components/TsTabPanel';
import { TabItem, TabNames } from '-/hooks/EntryPropsTabsContextProvider';
@@ -32,19 +33,7 @@ import { Box, Tab, Tabs, TabsProps } from '@mui/material';
import { styled, useTheme } from '@mui/material/styles';
import React, { useEffect, useReducer, useRef } from 'react';
import { useDispatch, useSelector } from 'react-redux';
-import EntryContainerButtons from '-/components/EntryContainerButtons';
-/*interface StyledTabsProps {
- children?: React.ReactNode;
- value: number;
- onChange: (event: React.SyntheticEvent, newValue: number) => void;
-}
-interface StyledTabProps {
- title: string;
- tinyMode: any;
- icon: any;
- onClick: (event: React.SyntheticEvent) => void;
-}*/
const TabContent1 = React.lazy(
() => import(/* webpackChunkName: "EntryProperties" */ './EntryProperties'),
);
@@ -143,9 +132,6 @@ function EntryContainerTabs(props: EntryContainerTabsProps) {
if (!isPanelOpened && openedEntry.isFile) {
return undefined;
}
- /*if (selectedTab === 0 || selectedTab === undefined) {
- return 0;
- }*/
const index = tabsArray.current.findIndex(
(tab) => tab.name === selectedTab,
);
@@ -175,8 +161,8 @@ function EntryContainerTabs(props: EntryContainerTabsProps) {
}
return (
- <div
- style={{
+ <Box
+ sx={{
width: '100%',
height: '100%',
display: 'flex',
@@ -189,7 +175,7 @@ function EntryContainerTabs(props: EntryContainerTabsProps) {
}}
>
<Box
- style={{
+ sx={{
display: 'flex',
}}
>
@@ -207,19 +193,18 @@ function EntryContainerTabs(props: EntryContainerTabsProps) {
// @ts-ignore
icon={tab.icon}
label={tab.title}
- style={{
+ sx={{
paddingLeft: 0,
paddingRight: 0,
- fontSize: 12,
+ fontSize: '12px',
fontWeight: 'normal',
textTransform: 'none',
paddingTop: '0px',
paddingBottom: '0px',
minHeight: '60px', // 68px
- marginLeft: -8,
- marginRight: -8,
+ marginLeft: '-8px',
+ marginRight: '-8px',
}}
- // sx={{ maxWidth: 70 }}
id={`tab-${index}`}
ariaControls={`simple-tabpanel-${index}`}
onClick={() => handleTabClick(selectedTabIndex, index)}
@@ -240,7 +225,7 @@ function EntryContainerTabs(props: EntryContainerTabsProps) {
)}
</TsTabPanel>
))}
- </div>
+ </Box>
);
}
diff --git a/src/renderer/components/EntryContainerTitle.tsx b/src/renderer/components/EntryContainerTitle.tsx
index d7c7f5e06..1504064ba 100644
--- a/src/renderer/components/EntryContainerTitle.tsx
+++ b/src/renderer/components/EntryContainerTitle.tsx
@@ -136,23 +136,24 @@ function EntryContainerTitle(props: Props) {
const addMacMargin =
AppConfig.isMacLike && desktopMode && (smallScreen || isEntryInFullWidth);
- const rightMargin = smallScreen ? 35 : 70;
+ const rightMargin = smallScreen ? '35px' : '70px';
return (
- <div
- style={{
- paddingLeft: 5,
- display: 'flex',
- alignItems: 'center',
- marginRight: openedEntry.isFile ? rightMargin : 0,
- flexDirection: 'row',
- flex: '1 1',
- overflowX: 'auto',
- overflowY: 'hidden',
- marginLeft: addMacMargin ? 60 : 0,
- // @ts-ignore
- WebkitAppRegion: 'drag',
- }}
+ <Box
+ sx={
+ {
+ paddingLeft: '5px',
+ display: 'flex',
+ alignItems: 'center',
+ marginRight: openedEntry.isFile ? rightMargin : 0,
+ flexDirection: 'row',
+ flex: '1 1',
+ overflowX: 'auto',
+ overflowY: 'hidden',
+ marginLeft: addMacMargin ? '60px' : 0,
+ WebkitAppRegion: 'drag',
+ } as React.CSSProperties
+ }
>
{smallScreen && (
<TsIconButton
@@ -174,14 +175,14 @@ function EntryContainerTitle(props: Props) {
<>
{fileChanged ? (
<Tooltip title={t('core:fileChanged')}>
- <span
+ <Box
style={{
color: theme.palette.text.primary,
- margin: 3,
+ margin: '3px',
}}
>
{String.fromCharCode(0x25cf)}
- </span>
+ </Box>
</Tooltip>
) : (
''
@@ -256,7 +257,7 @@ function EntryContainerTitle(props: Props) {
data-tid="toggleBookmarkTID"
aria-label="bookmark"
onClick={bookmarkClick}
- style={
+ sx={
{
WebkitAppRegion: 'no-drag',
} as React.CSSProperties & { WebkitAppRegion?: string }
@@ -295,7 +296,7 @@ function EntryContainerTitle(props: Props) {
reloadDocument={reloadDocument}
fileViewerContainer={fileViewerContainer}
/>
- </div>
+ </Box>
);
}
diff --git a/src/renderer/components/TagsPreview.tsx b/src/renderer/components/TagsPreview.tsx
index 1542fa363..2e3caef03 100644
--- a/src/renderer/components/TagsPreview.tsx
+++ b/src/renderer/components/TagsPreview.tsx
@@ -81,24 +81,27 @@ function TagsPreview(props: Props) {
return (
<Tooltip title={tagNames}>
<Box
- sx={{
- display: 'inline-block',
- minWidth: 15,
- width: 18,
- height: 15,
- marginLeft: '4px',
- marginRight: '4px',
- borderRadius: '7px',
- borderRight: moreThanOne ? 'white 1px solid' : 'initial',
- boxShadow: moreThanOne ? '4px 0px 0px 0px ' + secondTagColor : 'none',
- backgroundColor: firstTagColor,
- fontSize: '11px',
- lineHeight: '16px',
- color: firstTagTextColor || defaultTextColor, //tag1Colors.textcolor ,
- textAlign: 'center',
- // @ts-ignore
- WebkitAppRegion: 'no-drag',
- }}
+ sx={
+ {
+ display: 'inline-block',
+ minWidth: 15,
+ width: 18,
+ height: 15,
+ marginLeft: '4px',
+ marginRight: '4px',
+ borderRadius: '7px',
+ borderRight: moreThanOne ? 'white 1px solid' : 'initial',
+ boxShadow: moreThanOne
+ ? '4px 0px 0px 0px ' + secondTagColor
+ : 'none',
+ backgroundColor: firstTagColor,
+ fontSize: '11px',
+ lineHeight: '16px',
+ color: firstTagTextColor || defaultTextColor, //tag1Colors.textcolor ,
+ textAlign: 'center',
+ WebkitAppRegion: 'no-drag',
+ } as React.CSSProperties
+ }
>
{moreThanOne ? tags.length : '1'}
</Box>
diff --git a/src/renderer/hooks/DirectoryContentContextProvider.tsx b/src/renderer/hooks/DirectoryContentContextProvider.tsx
index f0a514f37..bce8a3293 100644
--- a/src/renderer/hooks/DirectoryContentContextProvider.tsx
+++ b/src/renderer/hooks/DirectoryContentContextProvider.tsx
@@ -670,16 +670,6 @@ export const DirectoryContentContextProvider = ({
function setSearchResults(searchResults: TS.FileSystemEntry[]) {
if (isSearchMode.current) {
setCurrentDirectoryEntries(searchResults);
- /*setCurrentDirectoryEntries(
- searchResults.map((sr) => ({
- ...sr,
- // @ts-ignore temp fix model in common
- ...(sr.thumbPath && {
- // @ts-ignore
- meta: { ...(sr.meta && sr.meta), thumbPath: sr.thumbPath },
- }),
- })),
- );*/
}
}