Skip to content

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

polish: improving ux

Ilian Sapundshiev224e54f6ff6a
diff --git a/app/components/LocationManager.tsx b/app/components/LocationManager.tsx
index 8f4d943ff..6bf0492b7 100644
--- a/app/components/LocationManager.tsx
+++ b/app/components/LocationManager.tsx
@@ -32,7 +32,7 @@ import {
Location
} from '../reducers/locations';
import { actions as AppActions } from '../reducers/app';
-import { getPerspectives } from '-/reducers/settings';
+import { getPerspectives, isDesktopMode } from '-/reducers/settings';
import i18n from '../services/i18n';
import AppConfig from '../config';
import LoadingLazy from '-/components/LoadingLazy';
@@ -64,6 +64,7 @@ interface Props {
addLocations: (locations: Array<Location>) => void;
editLocation: () => void;
removeLocation: (location: Location) => void;
+ isDesktop: boolean;
}
type SubFolder = {
@@ -113,7 +114,7 @@ const LocationManager = (props: Props) => {
target.value = null;
}
- const { classes } = props;
+ const { classes, isDesktop } = props;
return (
<div className={classes.panel} style={props.style}>
<CustomLogo />
@@ -191,7 +192,9 @@ const LocationManager = (props: Props) => {
className={classes.locationListArea}
data-tid="locationList"
style={{
- maxHeight: 'calc(100vh - 175px)',
+ maxHeight: isDesktop
+ ? 'calc(100vh - 175px)'
+ : 'calc(100vh - 225px)',
// @ts-ignore
overflowY: AppConfig.isFirefox ? 'auto' : 'overlay'
}}
@@ -240,7 +243,8 @@ const LocationManager = (props: Props) => {
function mapStateToProps(state) {
return {
locations: getLocations(state),
- perspectives: getPerspectives(state)
+ perspectives: getPerspectives(state),
+ isDesktop: isDesktopMode(state)
};
}
diff --git a/app/components/MobileNavigation.tsx b/app/components/MobileNavigation.tsx
index ae1df3854..82c57b197 100644
--- a/app/components/MobileNavigation.tsx
+++ b/app/components/MobileNavigation.tsx
@@ -21,6 +21,7 @@ import uuidv1 from 'uuid';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import classNames from 'classnames';
+import Tooltip from '@material-ui/core/Tooltip';
import ToggleButton from '@material-ui/lab/ToggleButton';
import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
import IconButton from '@material-ui/core/IconButton';
@@ -111,7 +112,6 @@ interface State {
class MobileNavigation extends React.Component<Props, State> {
state = {
- isManagementPanelVisible: true,
isProTeaserVisible: false
};
@@ -154,12 +154,9 @@ class MobileNavigation extends React.Component<Props, State> {
`}
</style>
<div style={{ width: 300, maxWidth: 300, height: 'calc(100% - 60px)' }}>
- <LocationManager
- hideDrawer={hideDrawer}
- style={{
- display: isLocationManagerPanelOpened ? 'block' : 'none'
- }}
- />
+ {isLocationManagerPanelOpened && (
+ <LocationManager hideDrawer={hideDrawer} />
+ )}
{isTagLibraryPanelOpened && <TagLibrary />}
{isSearchPanelOpened && <Search hideDrawer={hideDrawer} />}
{/* {isPerspectivesPanelOpened && <PerspectiveManager />} */}
@@ -175,90 +172,96 @@ class MobileNavigation extends React.Component<Props, State> {
)}
</div>
<div className={classes.bottomToolbar}>
- <IconButton
- id="verticalNavButton"
- title={i18n.t('core:settings')}
- data-tid="settings"
- onClick={() => {
- toggleSettingsDialog();
- hideDrawer();
- }}
- style={{ marginTop: -15, marginRight: 2 }}
- >
- <SettingsIcon className={classes.buttonIcon} />
- </IconButton>
- <ToggleButtonGroup exclusive>
- <ToggleButton
- id="verticalNavButton"
- onClick={openLocationManagerPanel}
- className={
- isLocationManagerPanelOpened
- ? classNames(classes.button, classes.selectedButton)
- : classes.button
- }
- title={i18n.t('core:locationManager')}
- data-tid="locationManager"
- >
- <LocationsIcon className={classes.buttonIcon} />
- </ToggleButton>
- <ToggleButton
- id="verticalNavButton"
- title={i18n.t('core:tagGroupOperations')}
- data-tid="tagLibrary"
- onClick={openTagLibraryPanel}
- className={
- isTagLibraryPanelOpened
- ? classNames(classes.button, classes.selectedButton)
- : classes.button
- }
- >
- <TagLibraryIcon className={classes.buttonIcon} />
- </ToggleButton>
- <ToggleButton
+ <Tooltip title={i18n.t('core:settings')}>
+ <IconButton
id="verticalNavButton"
- title={i18n.t('core:searchTitle')}
- data-tid="search"
- onClick={openSearchPanel}
- className={
- isSearchPanelOpened
- ? classNames(classes.button, classes.selectedButton)
- : classes.button
- }
+ data-tid="settings"
+ onClick={() => {
+ toggleSettingsDialog();
+ hideDrawer();
+ }}
+ style={{ marginTop: -15, marginRight: 2 }}
>
- <SearchIcon className={classes.buttonIcon} />
- </ToggleButton>
- <ToggleButton
+ <SettingsIcon className={classes.buttonIcon} />
+ </IconButton>
+ </Tooltip>
+ <ToggleButtonGroup exclusive>
+ <Tooltip title={i18n.t('core:locationManager')}>
+ <ToggleButton
+ id="verticalNavButton"
+ onClick={openLocationManagerPanel}
+ className={
+ isLocationManagerPanelOpened
+ ? classNames(classes.button, classes.selectedButton)
+ : classes.button
+ }
+ data-tid="locationManager"
+ >
+ <LocationsIcon className={classes.buttonIcon} />
+ </ToggleButton>
+ </Tooltip>
+ <Tooltip title={i18n.t('core:tagLibrary')}>
+ <ToggleButton
+ id="verticalNavButton"
+ data-tid="tagLibrary"
+ onClick={openTagLibraryPanel}
+ className={
+ isTagLibraryPanelOpened
+ ? classNames(classes.button, classes.selectedButton)
+ : classes.button
+ }
+ >
+ <TagLibraryIcon className={classes.buttonIcon} />
+ </ToggleButton>
+ </Tooltip>
+ <Tooltip title={i18n.t('core:searchTitle')}>
+ <ToggleButton
+ id="verticalNavButton"
+ data-tid="search"
+ onClick={openSearchPanel}
+ className={
+ isSearchPanelOpened
+ ? classNames(classes.button, classes.selectedButton)
+ : classes.button
+ }
+ >
+ <SearchIcon className={classes.buttonIcon} />
+ </ToggleButton>
+ </Tooltip>
+ <Tooltip title={i18n.t('core:helpFeedback')}>
+ <ToggleButton
+ id="verticalNavButton"
+ data-tid="helpFeedback"
+ onClick={openHelpFeedbackPanel}
+ className={
+ isHelpFeedbackPanelOpened
+ ? classNames(classes.button, classes.selectedButton)
+ : classes.button
+ }
+ >
+ <HelpIcon className={classes.buttonIcon} />
+ </ToggleButton>
+ </Tooltip>
+ </ToggleButtonGroup>
+ <Tooltip title={i18n.t('core:createFileTitle')}>
+ <IconButton
id="verticalNavButton"
- title={i18n.t('core:helpFeedback')}
- data-tid="helpFeedback"
- onClick={openHelpFeedbackPanel}
- className={
- isHelpFeedbackPanelOpened
- ? classNames(classes.button, classes.selectedButton)
- : classes.button
- }
+ onClick={() => {
+ if (isReadOnlyMode || !directoryPath) {
+ showNotification(
+ 'You are in read-only mode or there is no opened location'
+ );
+ } else {
+ toggleCreateFileDialog();
+ hideDrawer();
+ }
+ }}
+ style={{ marginTop: -15, marginLeft: 2 }}
+ data-tid="locationManager"
>
- <HelpIcon className={classes.buttonIcon} />
- </ToggleButton>
- </ToggleButtonGroup>
- <IconButton
- id="verticalNavButton"
- onClick={() => {
- if (isReadOnlyMode || !directoryPath) {
- showNotification(
- 'You are in read-only mode or there is no opened location'
- );
- } else {
- toggleCreateFileDialog();
- hideDrawer();
- }
- }}
- style={{ marginTop: -15, marginLeft: 2 }}
- title={i18n.t('core:createFileTitle')}
- data-tid="locationManager"
- >
- <NewFileIcon color="primary" />
- </IconButton>
+ <NewFileIcon color="primary" />
+ </IconButton>
+ </Tooltip>
{this.state.isProTeaserVisible && (
<ProTeaserDialogAsync
open={this.state.isProTeaserVisible}
diff --git a/app/components/dialogs/CreateEditLocationDialog.tsx b/app/components/dialogs/CreateEditLocationDialog.tsx
index 43c70184b..75e242747 100644
--- a/app/components/dialogs/CreateEditLocationDialog.tsx
+++ b/app/components/dialogs/CreateEditLocationDialog.tsx
@@ -78,7 +78,7 @@ const CreateEditLocationDialog = (props: Props) => {
);
const [path, setPath] = useState<string>(
props.location && props.location.type === locationType.TYPE_LOCAL
- ? props.location.path
+ ? props.location.path || props.location.paths[0]
: ''
);
const [endpointURL, setEndpointURL] = useState<string>(