Skip to content

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

chore: mobile optimizations

Ilian Sapundshiev651ae4f4e286
diff --git a/src/renderer/components/dialogs/AboutDialog.tsx b/src/renderer/components/dialogs/AboutDialog.tsx
index 6cacf7146..b3c791eb5 100644
--- a/src/renderer/components/dialogs/AboutDialog.tsx
+++ b/src/renderer/components/dialogs/AboutDialog.tsx
@@ -16,28 +16,28 @@
*
*/
-import React, { useState } from 'react';
+import AppConfig from '-/AppConfig';
+import LogoIcon from '-/assets/images/icon100x100.svg';
+import DraggablePaper from '-/components/DraggablePaper';
+import Tooltip from '-/components/Tooltip';
import TsButton from '-/components/TsButton';
-import Paper from '@mui/material/Paper';
-import Typography from '@mui/material/Typography';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
-import DialogContent from '@mui/material/DialogContent';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
-import Tooltip from '-/components/Tooltip';
-import semver from 'semver';
-import DraggablePaper from '-/components/DraggablePaper';
-import LogoIcon from '-/assets/images/icon100x100.svg';
-import versionMeta from '-/version.json';
+import { useLicenseDialogContext } from '-/components/dialogs/hooks/useLicenseDialogContext';
+import { useThirdPartyLibsDialogContext } from '-/components/dialogs/hooks/useThirdPartyLibsDialogContext';
import { Pro } from '-/pro';
import { getLastVersionPromise } from '-/reducers/settings';
-import Links from 'assets/links';
-import useMediaQuery from '@mui/material/useMediaQuery';
-import { useTheme } from '@mui/material/styles';
-import AppConfig from '-/AppConfig';
import { openURLExternally } from '-/services/utils-io';
+import versionMeta from '-/version.json';
+import DialogContent from '@mui/material/DialogContent';
+import Paper from '@mui/material/Paper';
+import Typography from '@mui/material/Typography';
+import { useTheme } from '@mui/material/styles';
+import useMediaQuery from '@mui/material/useMediaQuery';
+import Links from 'assets/links';
+import { useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useLicenseDialogContext } from '-/components/dialogs/hooks/useLicenseDialogContext';
-import { useThirdPartyLibsDialogContext } from '-/components/dialogs/hooks/useThirdPartyLibsDialogContext';
+import semver from 'semver';
import TranslucentDialog from './TranslucentDialog';
interface Props {
@@ -222,42 +222,28 @@ function AboutDialog(props: Props) {
</div>
</Typography>
</DialogContent>
- <TsDialogActions>
- {!Pro && (
+ <TsDialogActions style={{ justifyContent: 'space-between' }}>
+ <span>
+ {!Pro && (
+ <TsButton
+ data-tid="checkForUpdates"
+ title={t('core:checkForNewVersion')}
+ onClick={() => {
+ openURLExternally(Links.links.productsOverview, true);
+ }}
+ >
+ Upgrade to PRO
+ </TsButton>
+ )}
<TsButton
data-tid="checkForUpdates"
title={t('core:checkForNewVersion')}
- onClick={() => {
- openURLExternally(Links.links.productsOverview, true);
- }}
+ onClick={checkForUpdates}
>
- Upgrade to PRO
+ {versionInfo}
</TsButton>
- )}
- <TsButton
- data-tid="checkForUpdates"
- title={t('core:checkForNewVersion')}
- onClick={checkForUpdates}
- >
- {versionInfo}
- </TsButton>
- {/* <TsButton
- data-tid="openLicenseDialog"
- onClick={this.props.toggleLicenseDialog}
- >
- {t('core:license')}
- </TsButton>
- <TsButton
- data-tid="openThirdPartyLibsDialog"
- onClick={this.props.toggleThirdPartyLibsDialog}
- >
- {t('core:thirdPartyLibs')}
- </TsButton> */}
- <TsButton
- data-tid="closeAboutDialog"
- onClick={onClose}
- variant="contained"
- >
+ </span>
+ <TsButton data-tid="closeAboutDialog" onClick={onClose}>
{t('core:ok')}
</TsButton>
</TsDialogActions>
diff --git a/src/renderer/components/dialogs/KeyboardDialog.tsx b/src/renderer/components/dialogs/KeyboardDialog.tsx
index e0e9b4b6f..062b9487d 100644
--- a/src/renderer/components/dialogs/KeyboardDialog.tsx
+++ b/src/renderer/components/dialogs/KeyboardDialog.tsx
@@ -16,24 +16,23 @@
*
*/
-import React from 'react';
-import { useSelector } from 'react-redux';
+import AppConfig from '-/AppConfig';
+import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
-import DraggablePaper from '-/components/DraggablePaper';
+import { getKeyBindingObject } from '-/reducers/settings';
+import Box from '@mui/material/Box';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
-import Box from '@mui/material/Box';
import ListItemText from '@mui/material/ListItemText';
-import Dialog from '@mui/material/Dialog';
-import { getKeyBindingObject } from '-/reducers/settings';
+import Paper from '@mui/material/Paper';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import { useTranslation } from 'react-i18next';
-import AppConfig from '-/AppConfig';
-import Paper from '@mui/material/Paper';
+import { useSelector } from 'react-redux';
export function adjustKeyBinding(keyBinding: string) {
if (!keyBinding || !keyBinding.length) return '';
diff --git a/src/renderer/components/dialogs/ProTeaserDialog.tsx b/src/renderer/components/dialogs/ProTeaserDialog.tsx
index c34b836f6..9559c9ffe 100644
--- a/src/renderer/components/dialogs/ProTeaserDialog.tsx
+++ b/src/renderer/components/dialogs/ProTeaserDialog.tsx
@@ -16,23 +16,22 @@
*
*/
-import React from 'react';
import TsButton from '-/components/TsButton';
+import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
-import DialogTitle from '@mui/material/DialogTitle';
import Typography from '@mui/material/Typography';
-import Dialog from '@mui/material/Dialog';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
+
+import AppConfig from '-/AppConfig';
+import { getProTeaserSlides } from '-/content/ProTeaserSlides';
+import { openURLExternally } from '-/services/utils-io';
+import NavigateBeforeIcon from '@mui/icons-material/NavigateBefore';
+import NavigateNextIcon from '@mui/icons-material/NavigateNext';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
-import { getProTeaserSlides } from '-/content/ProTeaserSlides';
import Links from 'assets/links';
-import { openURLExternally } from '-/services/utils-io';
import { useTranslation } from 'react-i18next';
import Slider from 'react-slick';
-import NavigateNextIcon from '@mui/icons-material/NavigateNext';
-import NavigateBeforeIcon from '@mui/icons-material/NavigateBefore';
-import AppConfig from '-/AppConfig';
interface Props {
open: boolean;
@@ -218,9 +217,12 @@ function ProTeaserDialog(props: Props) {
keepMounted
scroll="paper"
>
- <DialogTitle style={{ justifyContent: 'center', textAlign: 'center' }}>
- <DialogCloseButton testId="closeProTeaserTID" onClose={onClose} />
- </DialogTitle>
+ <TsDialogTitle
+ closeButtonTestId="closeProTeaserTID"
+ style={{ height: 25 }}
+ onClose={onClose}
+ dialogTitle={''}
+ />
<DialogContent
style={{
overflowY: 'auto',
diff --git a/src/renderer/components/dialogs/SettingsDialog.tsx b/src/renderer/components/dialogs/SettingsDialog.tsx
index 64aa3a2a5..15bb697c8 100644
--- a/src/renderer/components/dialogs/SettingsDialog.tsx
+++ b/src/renderer/components/dialogs/SettingsDialog.tsx
@@ -26,6 +26,7 @@ import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import Dialog from '@mui/material/Dialog';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
+import DraggablePaper from '-/components/DraggablePaper';
import DialogContent from '@mui/material/DialogContent';
import { isDesktopMode } from '-/reducers/settings';
import ConfirmDialog from '-/components/dialogs/ConfirmDialog';
@@ -40,6 +41,7 @@ import { openURLExternally } from '-/services/utils-io';
import { useTranslation } from 'react-i18next';
import AppConfig from '-/AppConfig';
import TranslucentDialog from '-/components/dialogs/TranslucentDialog';
+import Paper from '@mui/material/Paper';
interface Props {
open: boolean;
@@ -55,7 +57,7 @@ function SettingsDialog(props: Props) {
useState<boolean>(false);
const { open, onClose } = props;
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
const handleTabClick = (event, tab) => {
setCurrentTab(tab);
@@ -76,7 +78,7 @@ function SettingsDialog(props: Props) {
style={{
overflowY: 'hidden',
overflowX: 'hidden',
- display: fullScreen ? 'block' : 'flex',
+ display: smallScreen ? 'block' : 'flex',
flexGrow: 1,
}}
>
@@ -86,8 +88,8 @@ function SettingsDialog(props: Props) {
onChange={handleTabClick}
indicatorColor="primary"
scrollButtons="auto"
- variant={fullScreen ? 'scrollable' : 'standard'}
- orientation={fullScreen ? 'horizontal' : 'vertical'}
+ variant={smallScreen ? 'scrollable' : 'standard'}
+ orientation={smallScreen ? 'horizontal' : 'vertical'}
// allowScrollButtonsMobile
// style={{
// width: fullScreen ? '100%' : '170px',
@@ -149,7 +151,7 @@ function SettingsDialog(props: Props) {
style={{
height: 'calc(100% - 50px)',
minHeight: 400,
- width: fullScreen ? '100%' : 600,
+ width: smallScreen ? '100%' : 600,
//minWidth: 600,
//maxWidth: 600,
}}
@@ -204,7 +206,8 @@ function SettingsDialog(props: Props) {
// backdropFilter: props.fullScreen ? 'unset' : 'blur(5px)',
},
}}
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
open={open}
keepMounted
scroll="paper"
@@ -218,7 +221,7 @@ function SettingsDialog(props: Props) {
actionSlot={helpButton}
/>
{renderContent}
- {!fullScreen && (
+ {!smallScreen && (
<TsDialogActions
style={{
justifyContent: 'space-between',
diff --git a/src/renderer/components/dialogs/ThirdPartyLibsDialog.tsx b/src/renderer/components/dialogs/ThirdPartyLibsDialog.tsx
index e29ade3e5..948cf7762 100644
--- a/src/renderer/components/dialogs/ThirdPartyLibsDialog.tsx
+++ b/src/renderer/components/dialogs/ThirdPartyLibsDialog.tsx
@@ -16,14 +16,14 @@
*
*/
-import React from 'react';
+import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
-import DialogContent from '@mui/material/DialogContent';
-import DialogTitle from '@mui/material/DialogTitle';
-import Dialog from '@mui/material/Dialog';
+import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
import ThirdPartyLibs from '-/third-party.txt';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
+import Dialog from '@mui/material/Dialog';
+import DialogContent from '@mui/material/DialogContent';
+import Paper from '@mui/material/Paper';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import { useTranslation } from 'react-i18next';
@@ -37,33 +37,34 @@ function ThirdPartyLibsDialog(props: Props) {
const { open, onClose } = props;
const { t } = useTranslation();
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const okButton = (
+ <TsButton data-tid="confirmThirdPartyLibsDialog" onClick={onClose}>
+ {t('core:ok')}
+ </TsButton>
+ );
+
return (
<Dialog
open={open}
onClose={onClose}
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
keepMounted
scroll="paper"
>
- <DialogTitle>
- {t('core:thirdPartyLibs')}{' '}
- <DialogCloseButton testId="closeThirdPartyTID" onClose={onClose} />
- </DialogTitle>
- <DialogContent style={{ overflowX: 'auto' }}>
+ <TsDialogTitle
+ dialogTitle={t('core:thirdPartyLibs')}
+ closeButtonTestId="closeThirdPartyTID"
+ onClose={onClose}
+ actionSlot={okButton}
+ />
+ <DialogContent>
<pre style={{ whiteSpace: 'pre-wrap', userSelect: 'text' }}>
{ThirdPartyLibs}
</pre>
</DialogContent>
- <TsDialogActions>
- <TsButton
- data-tid="confirmThirdPartyLibsDialog"
- onClick={onClose}
- variant="contained"
- >
- {t('core:ok')}
- </TsButton>
- </TsDialogActions>
+ {!smallScreen && <TsDialogActions>{okButton}</TsDialogActions>}
</Dialog>
);
}