Skip to content

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

chore: code clean-up

Ilian Sapundshievbe082fc9e99f
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index b5b95ef79..7ce236287 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -122,18 +122,6 @@ function MapiquePerspectiveAsync(props) {
);
}
-/* let TreeVizPerspective = React.Fragment;
-if (Pro && Pro.Perspectives && Pro.Perspectives.TreeVizPerspective) {
- // TreeVizPerspective = React.lazy(() => import(/!* webpackChunkName: "TreeVizPerspective" *!/ '../node_modules/@tagspaces/pro/modules/perspectives/treeviz'));
- // eslint-disable-next-line prefer-destructuring
- TreeVizPerspective = Pro.Perspectives.TreeVizPerspective;
-}
-const TreeVizPerspectiveAsync = props => (
- <React.Suspense fallback={<LoadingLazy />}>
- <TreeVizPerspective {...props} />
- </React.Suspense>
-); */
-
let KanBanPerspective = React.Fragment;
if (Pro && Pro.Perspectives && Pro.Perspectives.KanBanPerspective) {
KanBanPerspective = Pro.Perspectives.KanBanPerspective;
@@ -146,18 +134,6 @@ function KanBanPerspectiveAsync(props) {
);
}
-// let WikiPerspective = React.Fragment;
-// if (Pro && Pro.Perspectives && Pro.Perspectives.WikiPerspective) {
-// WikiPerspective = Pro.Perspectives.WikiPerspective;
-// }
-// function WikiPerspectiveAsync(props) {
-// return (
-// <React.Suspense fallback={<LoadingLazy />}>
-// <WikiPerspective {...props} />
-// </React.Suspense>
-// );
-// }
-
const WelcomePanel = React.lazy(() =>
import(/* webpackChunkName: "WelcomePanel" */ './WelcomePanel')
);
@@ -237,10 +213,8 @@ interface Props {
progress?: Array<any>;
searchQuery: TS.SearchQuery;
setSearchQuery: (searchQuery: TS.SearchQuery) => void;
- // openCurrentDirectory: () => void;
openURLExternally?: (url: string, skipConfirmation: boolean) => void;
language: string;
- // keyBindings: Array<any>;
}
function FolderContainer(props: Props) {
@@ -284,7 +258,6 @@ function FolderContainer(props: Props) {
boolean
>(false);
const [isSearchVisible, setSearchVisible] = useState<boolean>(false);
- // const [advancedSearch, setAdvancedSearch] = useState<boolean>(false);
const [anchorSearch, setAnchorSearch] = useState<HTMLButtonElement | null>(
null
);
@@ -293,9 +266,7 @@ function FolderContainer(props: Props) {
currentDirectoryPath = '',
loadDirectoryContent,
directoryContent,
- // searchResultCount,
classes,
- // maxSearchResults,
toggleDrawer,
drawerOpened,
isDesktopMode,
@@ -306,7 +277,6 @@ function FolderContainer(props: Props) {
openDirectory,
reflectCreateEntry,
openFsEntry,
- // keyBindings,
defaultPerspective
} = props;
@@ -388,26 +358,7 @@ function FolderContainer(props: Props) {
/>
);
}
- // if (Pro && currentPerspective === PerspectiveIDs.WIKI) {
- // return (
- // <WikiPerspectiveAsync
- // directoryContent={props.directoryContent}
- // loadDirectoryContent={props.loadDirectoryContent}
- // openFsEntry={props.openFsEntry}
- // openRenameEntryDialog={() => setIsRenameEntryDialogOpened(true)}
- // loadParentDirectoryContent={props.loadParentDirectoryContent}
- // renameFile={props.renameFile}
- // openDirectory={props.openDirectory}
- // showInFileManager={props.showInFileManager}
- // currentDirectoryPath={props.currentDirectoryPath}
- // addTags={props.addTags}
- // editTagForEntry={props.editTagForEntry}
- // removeTags={props.removeTags}
- // removeAllTags={props.removeAllTags}
- // windowWidth={props.windowWidth}
- // />
- // );
- // }
+
return (
<GridPerspectiveAsync
directoryContent={props.directoryContent}
@@ -495,14 +446,6 @@ function FolderContainer(props: Props) {
true
);
}
- // } else if (perspectiveId === PerspectiveIDs.WIKI) {
- // const openPersDocs = window.confirm(i18n.t('perspectiveInPro'));
- // if (openPersDocs) {
- // props.openURLExternally(
- // Links.documentationLinks.kanbanPerspective,
- // true
- // );
- // }
}
};
@@ -588,7 +531,6 @@ function FolderContainer(props: Props) {
variant="outlined"
size="small"
style={{
- marginTop: 10,
minWidth: 40,
width: 200
}}
diff --git a/app/components/PathBreadcrumbs.tsx b/app/components/PathBreadcrumbs.tsx
index 133369eed..ac967d7b6 100644
--- a/app/components/PathBreadcrumbs.tsx
+++ b/app/components/PathBreadcrumbs.tsx
@@ -44,10 +44,6 @@ const StyledBreadcrumb = withStyles((theme: Theme) => ({
'&:hover, &:focus': {
backgroundColor: emphasize(theme.palette.background.default, 0.22)
}
- // '&:active': {
- // boxShadow: theme.shadows[1],
- // backgroundColor: emphasize(theme.palette.grey[300], 0.12)
- // }
}
}))(Chip) as typeof Chip;
@@ -75,11 +71,6 @@ interface Props {
isDesktopMode: boolean;
}
-function handleClick(event: React.MouseEvent<Element, MouseEvent>) {
- event.preventDefault();
- console.info('You clicked a breadcrumb.');
-}
-
function PathBreadcrumbs(props: Props) {
let pathParts: Array<string> = [];
@@ -147,14 +138,10 @@ function PathBreadcrumbs(props: Props) {
);
}
- // console.log('Path parts : ' + JSON.stringify(pathParts));
if (pathParts.length >= 1) {
pathParts = pathParts.slice(1, pathParts.length); // remove current directory
}
pathParts = pathParts.reverse();
- // if (pathParts.length > 2) {
- // pathParts = pathParts.slice(pathParts.length - 2, pathParts.length); // leave only the last 2 dirs in the path
- // }
}
return (
@@ -175,7 +162,6 @@ function PathBreadcrumbs(props: Props) {
</span>
}
>
- {/* <LocationMenu /> */}
{pathParts.length > 0 &&
pathParts.map(pathPart => (
<Tooltip
@@ -208,7 +194,6 @@ function PathBreadcrumbs(props: Props) {
'/'
)}
deleteIcon={<ExpandMoreIcon />}
- // onClick={handleClick}
onDelete={openDirectoryMenu}
onClick={openDirectoryMenu}
onContextMenu={openDirectoryMenu}
diff --git a/app/components/menus/LocationMenu.tsx b/app/components/menus/LocationMenu.tsx
index 9c643767d..db5e54525 100644
--- a/app/components/menus/LocationMenu.tsx
+++ b/app/components/menus/LocationMenu.tsx
@@ -88,17 +88,13 @@ function LocationMenu(props: Props) {
id="locationMenuButton"
onClick={event => setLocationChooserMenuAnchorEl(event.currentTarget)}
style={{
- // paddingRight: 0,
- // paddingLeft: 0,
- // marginRight: 5,
+ padding: 5,
fontSize: theme.typography.fontSize,
borderRadius: 10
}}
size="large"
>
- {currentLocation
- ? locationIcon // this.state.currentLocation.name
- : i18n.t('core:pleaseOpenLocation')}
+ {currentLocation ? locationIcon : i18n.t('core:pleaseOpenLocation')}
<ArrowDropDownIcon />
</IconButton>
</Tooltip>