Skip to content

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

chore: removing old styling and unneeded code

Ilian Sapundshiev804783b8bbbb
diff --git a/src/renderer/components/DirectoryTreeView.tsx b/src/renderer/components/DirectoryTreeView.tsx
index 3a0777096..2231edf41 100644
--- a/src/renderer/components/DirectoryTreeView.tsx
+++ b/src/renderer/components/DirectoryTreeView.tsx
@@ -109,7 +109,6 @@ const DirectoryTreeView = forwardRef(
marginRight: 6,
marginBottom: -8,
}}
- className={classes.icon}
/>
{field && field.length > 25 ? field.substr(0, 25) + '...' : field}
</span>
diff --git a/src/renderer/components/HelpFeedbackPanel.tsx b/src/renderer/components/HelpFeedbackPanel.tsx
index 2a5052055..e0efd88eb 100644
--- a/src/renderer/components/HelpFeedbackPanel.tsx
+++ b/src/renderer/components/HelpFeedbackPanel.tsx
@@ -46,7 +46,6 @@ import ListItemIcon from '@mui/material/ListItemIcon';
import Typography from '@mui/material/Typography';
import { useTheme } from '@mui/material/styles';
import Links from 'assets/links';
-import classNames from 'classnames';
import { useTranslation } from 'react-i18next';
interface Props {
@@ -71,9 +70,9 @@ function HelpFeedbackPanel(props: Props) {
marginLeft: 5,
}}
>
- <div className={classes.toolbar}>
+ <div style={{ display: 'flex' }}>
<Typography
- className={classNames(classes.panelTitle, classes.header)}
+ className={classes.panelTitle}
variant="subtitle1"
style={{ paddingLeft: 0 }}
>
diff --git a/src/renderer/components/LocationManager.tsx b/src/renderer/components/LocationManager.tsx
index ffa828e3d..c51b21b46 100644
--- a/src/renderer/components/LocationManager.tsx
+++ b/src/renderer/components/LocationManager.tsx
@@ -16,20 +16,18 @@
*
*/
-import React, { useRef, useState } from 'react';
-import { useDispatch } from 'react-redux';
-import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
-import { List } from '@mui/material';
-import LocationManagerMenu from '-/components/menus/LocationManagerMenu';
-import ConfirmDialog from '-/components/dialogs/ConfirmDialog';
-import { AppDispatch } from '-/reducers/app';
import LocationView from '-/components/LocationView';
+import { SidePanel, classes } from '-/components/SidePanels.css';
+import ConfirmDialog from '-/components/dialogs/ConfirmDialog';
+import { useCreateEditLocationDialogContext } from '-/components/dialogs/hooks/useCreateEditLocationDialogContext';
+import LocationContextMenu from '-/components/menus/LocationContextMenu';
+import LocationManagerMenu from '-/components/menus/LocationManagerMenu';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
import { Pro } from '-/pro';
-import { classes, SidePanel } from '-/components/SidePanels.css';
+import { List } from '@mui/material';
+import { useRef, useState } from 'react';
+import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';
import { useTranslation } from 'react-i18next';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
-import LocationContextMenu from '-/components/menus/LocationContextMenu';
-import { useCreateEditLocationDialogContext } from '-/components/dialogs/hooks/useCreateEditLocationDialogContext';
/*const CreateEditLocationDialog = React.lazy(
() =>
@@ -163,12 +161,13 @@ function LocationManager(props: Props) {
/>
)}
<List
- className={classes.locationListArea}
data-tid="locationList"
style={{
height: 'calc(100% - ' + reduceHeightBy + 'px)',
width: 310,
borderRadius: 5,
+ paddingTop: 0,
+ marginTop: 0,
overflowY: 'auto',
}}
>
diff --git a/src/renderer/components/LocationView.tsx b/src/renderer/components/LocationView.tsx
index 85dd1a6fd..0269a6fb7 100644
--- a/src/renderer/components/LocationView.tsx
+++ b/src/renderer/components/LocationView.tsx
@@ -45,6 +45,7 @@ import { ListItemText } from '@mui/material';
import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import Typography from '@mui/material/Typography';
+import { useTheme } from '@mui/material/styles';
import { locationType } from '@tagspaces/tagspaces-common/misc';
import React, { useRef } from 'react';
import { NativeTypes } from 'react-dnd-html5-backend';
@@ -79,6 +80,7 @@ function LocationView(props: Props) {
const { currentLocationPath, openDirectory } = useDirectoryContentContext();
const { showNotification } = useNotificationContext();
const directoryTreeRef = useRef<DirectoryTreeViewRef>(null);
+ const theme = useTheme();
const dispatch: AppDispatch = useDispatch();
const currentLocation = findLocation();
@@ -214,7 +216,6 @@ function LocationView(props: Props) {
paddingLeft: 5,
paddingRight: 5,
}}
- className={classes.header}
data-tid="locationTitleElement"
noWrap
>
@@ -223,6 +224,8 @@ function LocationView(props: Props) {
</div>
);
const { FILE } = NativeTypes;
+ const isLocationSelected =
+ currentLocation && currentLocation.uuid === location.uuid;
return (
<SidePanel>
<TargetFileBox
@@ -233,11 +236,14 @@ function LocationView(props: Props) {
<CustomDragLayer />
<ListItem
data-tid={'location_' + location.name.replace(/ /g, '_')}
- className={
- currentLocation && currentLocation.uuid === location.uuid
- ? classes.listItemSelected
- : classes.listItem
- }
+ style={{
+ padding: 0,
+ paddingRight: 15,
+ borderRadius: AppConfig.defaultCSSRadius,
+ backgroundColor: isLocationSelected
+ ? theme.palette.primary.light
+ : 'inherit',
+ }}
onClick={handleLocationClick}
onContextMenu={(event) =>
handleLocationContextMenuClick(event, location)
@@ -255,15 +261,15 @@ function LocationView(props: Props) {
<CloudLocationIcon
style={{
cursor: 'pointer',
+ margin: theme.spacing(1),
}}
- className={classes.icon}
/>
) : (
<LocalLocationIcon
style={{
cursor: 'pointer',
+ margin: theme.spacing(1),
}}
- className={classes.icon}
/>
)}
</Tooltip>
diff --git a/src/renderer/components/PerspectiveManager.tsx b/src/renderer/components/PerspectiveManager.tsx
deleted file mode 100644
index d042f3aa0..000000000
--- a/src/renderer/components/PerspectiveManager.tsx
+++ /dev/null
@@ -1,36 +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 Typography from '@mui/material/Typography';
-import { classes, SidePanel } from '-/components/SidePanels.css';
-
-interface Props {
- style: any;
-}
-
-function PerspectiveManager(props: Props) {
- return (
- <SidePanel style={props.style}>
- <Typography className={classes.panelTitle}>Perspectives</Typography>
- </SidePanel>
- );
- // <TsButton onClick={() => history.push('/login')}>Login</TsButton>
-}
-
-export default PerspectiveManager;
diff --git a/src/renderer/components/SearchPopover.tsx b/src/renderer/components/SearchPopover.tsx
index a7c115d2b..790ca1ea1 100644
--- a/src/renderer/components/SearchPopover.tsx
+++ b/src/renderer/components/SearchPopover.tsx
@@ -19,7 +19,7 @@
import AppConfig from '-/AppConfig';
import { CloseIcon, CreateFileIcon, EditIcon } from '-/components/CommonIcons';
import EditSearchQuery from '-/components/EditSearchQuery';
-import { SidePanel, classes } from '-/components/SidePanels.css';
+import { SidePanel } from '-/components/SidePanels.css';
import TooltipTS from '-/components/Tooltip';
import TsButton from '-/components/TsButton';
import TsIconButton from '-/components/TsIconButton';
@@ -97,13 +97,12 @@ function SearchPopover(props: Props) {
WebkitAppRegion: 'no-drag',
}}
>
- <div className={classes.toolbar}>
+ <div style={{ display: 'flex' }}>
<Typography variant="button" style={{ margin: '12px 0 10px 10px' }}>
{t('core:advancedSearch')}
</Typography>
<Typography
variant="caption"
- className={classes.header}
style={{ flex: 1, margin: 'auto', paddingLeft: 10 }}
>
{indexStatus}
diff --git a/src/renderer/components/SidePanels.css.tsx b/src/renderer/components/SidePanels.css.tsx
index b220ddcf1..d89826063 100644
--- a/src/renderer/components/SidePanels.css.tsx
+++ b/src/renderer/components/SidePanels.css.tsx
@@ -15,49 +15,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
-import AppConfig from '-/AppConfig';
import { styled } from '@mui/material/styles';
const PREFIX = 'SidePanel';
export const classes = {
- panel: `${PREFIX}-panel`,
- header: `${PREFIX}-header`,
- icon: `${PREFIX}-icon`,
- locationListArea: `${PREFIX}-locationListArea`,
- listItem: `${PREFIX}-listItem`,
- listItemSelected: `${PREFIX}-listItemSelected`,
panelTitle: `${PREFIX}-panelTitle`,
- toolbar: `${PREFIX}-toolbar`,
- mainActionButton: `${PREFIX}-mainActionButton`,
- leftIcon: `${PREFIX}-leftIcon`,
};
export const SidePanel = styled('div')(({ theme }) => ({
height: '100%',
paddingLeft: 5,
paddingRight: 0,
- [`& .${classes.header}`]: {
- color: theme.palette.text.primary,
- },
- [`& .${classes.icon}`]: {
- margin: theme.spacing(1),
- },
- [`& .${classes.locationListArea}`]: {
- paddingTop: 0,
- marginTop: 0,
- overflowY: 'auto',
- },
- [`& .${classes.listItem}`]: {
- padding: 0,
- paddingRight: 15,
- borderRadius: AppConfig.defaultCSSRadius,
- },
- [`& .${classes.listItemSelected}`]: {
- padding: 0,
- paddingRight: 15,
- borderRadius: AppConfig.defaultCSSRadius,
- backgroundColor: theme.palette.primary.light,
- },
[`& .${classes.panelTitle}`]: {
textTransform: 'uppercase',
fontSize: '0.9rem',
@@ -65,15 +33,4 @@ export const SidePanel = styled('div')(({ theme }) => ({
paddingLeft: 7,
paddingTop: 12,
},
- [`& .${classes.toolbar}`]: {
- display: 'flex',
- },
- [`& .${classes.mainActionButton}`]: {
- marginTop: 10,
- marginLeft: 0,
- paddingLeft: 8,
- },
- [`& .${classes.leftIcon}`]: {
- marginRight: theme.spacing(1),
- },
}));
diff --git a/src/renderer/components/StoredSearches.tsx b/src/renderer/components/StoredSearches.tsx
index 37ee97020..5c8473866 100644
--- a/src/renderer/components/StoredSearches.tsx
+++ b/src/renderer/components/StoredSearches.tsx
@@ -44,7 +44,6 @@ import {
import { TS } from '-/tagspaces.namespace';
import Grid from '@mui/material/Grid2';
import Typography from '@mui/material/Typography';
-import classNames from 'classnames';
import React, { useContext, useReducer, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { connect } from 'react-redux';
@@ -156,9 +155,9 @@ function StoredSearches(props: Props) {
marginRight: 0,
}}
>
- <div className={classes.toolbar}>
+ <div style={{ display: 'flex' }}>
<Typography
- className={classNames(classes.panelTitle, classes.header)}
+ className={classes.panelTitle}
variant="subtitle1"
style={{ paddingLeft: 0 }}
>
diff --git a/src/renderer/components/TagGroupTitleDnD.tsx b/src/renderer/components/TagGroupTitleDnD.tsx
index 118144956..918b3a6f4 100644
--- a/src/renderer/components/TagGroupTitleDnD.tsx
+++ b/src/renderer/components/TagGroupTitleDnD.tsx
@@ -23,7 +23,7 @@ import {
SmallArrowRightIcon,
} from '-/components/CommonIcons';
import DragItemTypes from '-/components/DragItemTypes';
-import { SidePanel, classes } from '-/components/SidePanels.css';
+import { SidePanel } from '-/components/SidePanels.css';
import TsIconButton from '-/components/TsIconButton';
import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
import { TS } from '-/tagspaces.namespace';
@@ -158,7 +158,6 @@ function TagGroupTitleDnD(props: Props) {
<Grid size={9} style={{ alignSelf: 'center' }}>
<Typography
variant="inherit"
- className={classes.header}
style={{ paddingLeft: 0 }}
data-tid="locationTitleElement"
noWrap
diff --git a/src/renderer/components/TagLibrary.tsx b/src/renderer/components/TagLibrary.tsx
index 0350c4997..b64d58e06 100644
--- a/src/renderer/components/TagLibrary.tsx
+++ b/src/renderer/components/TagLibrary.tsx
@@ -53,7 +53,6 @@ import { CommonLocation } from '-/utils/CommonLocation';
import useFirstRender from '-/utils/useFirstRender';
import Collapse from '@mui/material/Collapse';
import Typography from '@mui/material/Typography';
-import classNames from 'classnames';
import React, { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
@@ -300,9 +299,9 @@ function TagLibrary(props: Props) {
flexDirection: 'column',
}}
>
- <div className={classes.toolbar}>
+ <div style={{ display: 'flex' }}>
<Typography
- className={classNames(classes.panelTitle, classes.header)}
+ className={classes.panelTitle}
title={
'Your tag library contains ' +
allTags.length +
@@ -398,6 +397,7 @@ function TagLibrary(props: Props) {
showEditTagDialog={() => setIsEditTagDialogOpened(true)}
showDeleteTagDialog={() => setIsDeleteTagDialogOpened(true)}
selectedTag={selectedTag}
+ selectedTagGroupEntry={selectedTagGroupEntry}
/>
)}
{isEditTagDialogOpened && (
diff --git a/src/renderer/components/UserDetailsPopover.tsx b/src/renderer/components/UserDetailsPopover.tsx
index 60f65fd91..db41bf875 100644
--- a/src/renderer/components/UserDetailsPopover.tsx
+++ b/src/renderer/components/UserDetailsPopover.tsx
@@ -16,50 +16,20 @@
*
*/
-import React, { useState } from 'react';
-import classNames from 'classnames';
-import Typography from '@mui/material/Typography';
-import Box from '@mui/material/Box';
-import ListItem from '@mui/material/ListItem';
-import ListItemIcon from '@mui/material/ListItemIcon';
-import Avatar from '@mui/material/Avatar';
import TsButton from '-/components/TsButton';
+import { useUserContext } from '-/hooks/useUserContext';
+import { Pro } from '-/pro';
+import { clearAllURLParams } from '-/utils/dom';
import Auth from '@aws-amplify/auth';
import ExitToAppIcon from '@mui/icons-material/ExitToApp';
-import { clearAllURLParams } from '-/utils/dom';
-import { Pro } from '-/pro';
-import { styled, useTheme } from '@mui/material/styles';
+import Avatar from '@mui/material/Avatar';
+import Box from '@mui/material/Box';
+import ListItem from '@mui/material/ListItem';
+import ListItemIcon from '@mui/material/ListItemIcon';
+import Typography from '@mui/material/Typography';
+import { useTheme } from '@mui/material/styles';
+import { useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useUserContext } from '-/hooks/useUserContext';
-
-const PREFIX = 'UserDetailsPopover';
-
-const classes = {
- panelTitle: `${PREFIX}-panelTitle`,
- header: `${PREFIX}-header`,
- mainActionButton: `${PREFIX}-mainActionButton`,
- leftIcon: `${PREFIX}-leftIcon`,
-};
-
-const Root = styled('div')(({ theme }) => ({
- [`& .${classes.panelTitle}`]: {
- textTransform: 'uppercase',
- flex: 1,
- paddingLeft: 7,
- paddingTop: 12,
- },
- [`& .${classes.header}`]: {
- color: theme.palette.text.primary,
- },
- [`& .${classes.mainActionButton}`]: {
- marginTop: 10,
- marginLeft: 0,
- paddingLeft: 8,
- },
- [`& .${classes.leftIcon}`]: {
- marginRight: theme.spacing(1),
- },
-}));
interface Props {
onClose: () => void;
@@ -96,14 +66,19 @@ function UserDetailsPopover(props: Props) {
};
return (
- <Root
+ <div
style={{
maxWidth: 400,
height: '100%',
}}
>
<Typography
- className={classNames(classes.panelTitle, classes.header)}
+ style={{
+ textTransform: 'uppercase',
+ flex: 1,
+ paddingLeft: 7,
+ paddingTop: 12,
+ }}
variant="subtitle1"
>
User Profile
@@ -151,11 +126,15 @@ function UserDetailsPopover(props: Props) {
<TsButton
tooltip={t('core:setupTOTPHelp')}
data-tid="setupTOTP"
- className={classes.mainActionButton}
onClick={() => {
setSetupTOTPOpened(true);
}}
- style={{ width: '95%' }}
+ style={{
+ width: '95%',
+ marginTop: 10,
+ marginLeft: 0,
+ paddingLeft: 8,
+ }}
>
{t('core:setupTOTP')}
</TsButton>
@@ -165,7 +144,6 @@ function UserDetailsPopover(props: Props) {
{t('core:TOTPEnabled')}
</Typography>
<TsButton
- className={classes.mainActionButton}
onClick={async () => {
try {
await Auth.setPreferredMFA(currentUser, 'NOMFA');
@@ -174,7 +152,12 @@ function UserDetailsPopover(props: Props) {
console.log(error);
}
}}
- style={{ width: '95%' }}
+ style={{
+ width: '95%',
+ marginTop: 10,
+ marginLeft: 0,
+ paddingLeft: 8,
+ }}
>
{t('core:disableTOTP')}
</TsButton>
@@ -192,16 +175,20 @@ function UserDetailsPopover(props: Props) {
<TsButton
data-tid="signOutTID"
title={t('core:signOut')}
- className={classes.mainActionButton}
onClick={signOut}
- style={{ width: '95%' }}
+ style={{
+ width: '95%',
+ marginTop: 10,
+ marginLeft: 0,
+ paddingLeft: 8,
+ }}
>
- <ExitToAppIcon className={classNames(classes.leftIcon)} />
+ <ExitToAppIcon style={{ marginRight: theme.spacing(1) }} />
{t('core:signOut')}
</TsButton>
</Box>
</Box>
- </Root>
+ </div>
);
}
diff --git a/src/renderer/components/menus/LocationManagerMenu.tsx b/src/renderer/components/menus/LocationManagerMenu.tsx
index f9f5d4b5a..e2cfb9161 100644
--- a/src/renderer/components/menus/LocationManagerMenu.tsx
+++ b/src/renderer/components/menus/LocationManagerMenu.tsx
@@ -41,7 +41,6 @@ import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import Typography from '@mui/material/Typography';
import Links from 'assets/links';
-import classNames from 'classnames';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -187,11 +186,8 @@ function LocationManagerMenu(props: Props) {
return (
<>
- <div className={classes.toolbar}>
- <Typography
- className={classNames(classes.panelTitle, classes.header)}
- variant="subtitle1"
- >
+ <div style={{ display: 'flex' }}>
+ <Typography className={classes.panelTitle} variant="subtitle1">
{t('core:locationManager')}
</Typography>
<TsIconButton