Skip to content

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

chore: adjustment for dialogs on small screens

Ilian Sapundshievb15e0e0a19f8
diff --git a/src/renderer/components/dialogs/AddRemoveTagsDialog.tsx b/src/renderer/components/dialogs/AddRemoveTagsDialog.tsx
index e81ec4631..a454859b0 100644
--- a/src/renderer/components/dialogs/AddRemoveTagsDialog.tsx
+++ b/src/renderer/components/dialogs/AddRemoveTagsDialog.tsx
@@ -16,33 +16,32 @@
*
*/
-import React, { useReducer, useRef, useState } from 'react';
+import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
-import Paper from '@mui/material/Paper';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
-import DialogContent from '@mui/material/DialogContent';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
+import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
+import { TS } from '-/tagspaces.namespace';
+import FolderIcon from '@mui/icons-material/FolderOpen';
+import FileIcon from '@mui/icons-material/InsertDriveFileOutlined';
+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 ListItemIcon from '@mui/material/ListItemIcon';
-import FolderIcon from '@mui/icons-material/FolderOpen';
-import FileIcon from '@mui/icons-material/InsertDriveFileOutlined';
+import Paper from '@mui/material/Paper';
import Typography from '@mui/material/Typography';
-import Dialog from '@mui/material/Dialog';
-import DraggablePaper from '-/components/DraggablePaper';
-import TagsSelect from '../TagsSelect';
+import { useTheme } from '@mui/material/styles';
+import useMediaQuery from '@mui/material/useMediaQuery';
import {
- extractFileName,
extractDirectoryName,
+ extractFileName,
} from '@tagspaces/tagspaces-common/paths';
-import { TS } from '-/tagspaces.namespace';
-import TsTextField from '-/components/TsTextField';
-import { useTheme } from '@mui/material/styles';
-import useMediaQuery from '@mui/material/useMediaQuery';
+import { useReducer, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
-import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import TagsSelect from '../TagsSelect';
interface Props {
open: boolean;
@@ -137,15 +136,15 @@ function AddRemoveTagsDialog(props: Props) {
selected.length < 1;
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
return (
<Dialog
open={open}
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
onClose={onClose}
keepMounted
scroll="paper"
- PaperComponent={fullScreen ? Paper : DraggablePaper}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
aria-labelledby="draggable-dialog-title"
>
<TsDialogTitle
diff --git a/src/renderer/components/dialogs/AddTagToTagGroupDialog.tsx b/src/renderer/components/dialogs/AddTagToTagGroupDialog.tsx
index 3108e384b..dd837c83c 100644
--- a/src/renderer/components/dialogs/AddTagToTagGroupDialog.tsx
+++ b/src/renderer/components/dialogs/AddTagToTagGroupDialog.tsx
@@ -16,24 +16,24 @@
*
*/
-import React, { useState } from 'react';
-import { useSelector, useDispatch } from 'react-redux';
+import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
+import TsSelect from '-/components/TsSelect';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
+import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
+import { getTagColor, getTagTextColor } from '-/reducers/settings';
+import { getTagLibrary } from '-/services/taglibrary-utils';
+import { TS } from '-/tagspaces.namespace';
+import { Paper, useTheme } from '@mui/material';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
-import DialogTitle from '@mui/material/DialogTitle';
import FormControl from '@mui/material/FormControl';
-import Dialog from '@mui/material/Dialog';
-import InputLabel from '@mui/material/InputLabel';
-import Select from '@mui/material/Select';
-import Input from '@mui/material/Input';
import MenuItem from '@mui/material/MenuItem';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
-import { getTagColor, getTagTextColor } from '-/reducers/settings';
-import { TS } from '-/tagspaces.namespace';
-import { getTagLibrary } from '-/services/taglibrary-utils';
+import useMediaQuery from '@mui/material/useMediaQuery';
+import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
+import { useSelector } from 'react-redux';
+import TsDialogTitle from './components/TsDialogTitle';
interface Props {
open: boolean;
@@ -46,7 +46,6 @@ interface Props {
function AddTagToTagGroupDialog(props: Props) {
const { t } = useTranslation();
const { addTag } = useTaggingActionsContext();
- //const dispatch: AppDispatch = useDispatch();
const [tagGroup, setTagGroup] = useState<string>(undefined);
const defaultBackgroundColor = useSelector(getTagColor);
const defaultTextColor = useSelector(getTagTextColor);
@@ -64,19 +63,31 @@ function AddTagToTagGroupDialog(props: Props) {
selectedTag.color = defaultBackgroundColor;
}
addTag([selectedTag], tagGroup);
- //dispatch(AppActions.addTag(selectedTag, tagGroup));
props.onClose();
};
const { open, onClose } = props;
- // const theme = useTheme();
- // const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const theme = useTheme();
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
+
+ const okButton = (
+ <TsButton
+ disabled={tagGroup === undefined}
+ onClick={onConfirm}
+ data-tid="createTagsConfirmButton"
+ variant="contained"
+ >
+ {t('core:ok')}
+ </TsButton>
+ );
+
return (
<Dialog
open={open}
onClose={onClose}
- // fullScreen={fullScreen}
+ fullScreen={smallScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
keepMounted
scroll="paper"
onKeyDown={(event) => {
@@ -87,39 +98,30 @@ function AddTagToTagGroupDialog(props: Props) {
}
}}
>
- <DialogTitle>
- {t('core:addTagToTagGroup') + ': ' + props.selectedTag.title}
- <DialogCloseButton
- testId="closeAddTagToGroupDialogTID"
- onClose={onClose}
- />
- </DialogTitle>
+ <TsDialogTitle
+ dialogTitle={
+ t('core:addTagToTagGroup') + ': ' + props.selectedTag.title
+ }
+ closeButtonTestId="closeAddTagToGroupDialogTID"
+ onClose={onClose}
+ actionSlot={okButton}
+ />
<DialogContent style={{ paddingTop: 10, minWidth: 350 }}>
<FormControl fullWidth={true}>
- <InputLabel htmlFor="addTagToTagGroupInput">
- {t('core:chooseTagGroup')}
- </InputLabel>
- <Select
+ <TsSelect
+ label={t('core:chooseTagGroup')}
value={tagGroup}
onChange={handleTagGroupChange}
- input={<Input id="addTagToTagGroupInput" />}
>
{getTagLibrary().map((tg) => (
<MenuItem value={tg.uuid}>{tg.title}</MenuItem>
))}
- </Select>
+ </TsSelect>
</FormControl>
</DialogContent>
<TsDialogActions>
<TsButton onClick={onClose}>{t('core:cancel')}</TsButton>
- <TsButton
- disabled={tagGroup === undefined}
- onClick={onConfirm}
- data-tid="createTagsConfirmButton"
- variant="contained"
- >
- {t('core:ok')}
- </TsButton>
+ {okButton}
</TsDialogActions>
</Dialog>
);
diff --git a/src/renderer/components/dialogs/ColorPickerDialog.tsx b/src/renderer/components/dialogs/ColorPickerDialog.tsx
index 4d9d5d8f2..2d6b7c827 100644
--- a/src/renderer/components/dialogs/ColorPickerDialog.tsx
+++ b/src/renderer/components/dialogs/ColorPickerDialog.tsx
@@ -16,16 +16,17 @@
*
*/
-import React, { useState } from 'react';
-import { useTheme } from '@mui/material/styles';
-import useMediaQuery from '@mui/material/useMediaQuery';
+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 TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
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 { useState } from 'react';
import ColorPicker from 'react-best-gradient-color-picker';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
import { useTranslation } from 'react-i18next';
const presetColors = [
@@ -69,7 +70,7 @@ function ColorPickerDialog(props: Props) {
const [color, setColor] = useState(undefined);
const { open = false, onClose } = props;
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
function onConfirm() {
// if (color && colorHex) {
@@ -79,11 +80,22 @@ function ColorPickerDialog(props: Props) {
props.onClose();
}
+ const okButton = (
+ <TsButton
+ variant="contained"
+ onClick={onConfirm}
+ data-tid="colorPickerConfirm"
+ >
+ {t('core:ok')}
+ </TsButton>
+ );
+
return (
<Dialog
open={open}
onClose={onClose}
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
keepMounted
scroll="paper"
onKeyDown={(event) => {
@@ -94,10 +106,12 @@ function ColorPickerDialog(props: Props) {
}
}}
>
- <DialogTitle data-tid="colorPickerDialogTitle">
- {t('core:colorPickerDialogTitle')}
- <DialogCloseButton testId="closeColorPickerTID" onClose={onClose} />
- </DialogTitle>
+ <TsDialogTitle
+ dialogTitle={t('core:colorPickerDialogTitle')}
+ closeButtonTestId="closeColorPickerTID"
+ onClose={onClose}
+ actionSlot={okButton}
+ />
<DialogContent
data-tid="colorPickerDialogContent"
style={{
@@ -117,18 +131,14 @@ function ColorPickerDialog(props: Props) {
style={{ backgroundColor: 'transparent' }}
/>
</DialogContent>
- <TsDialogActions>
- <TsButton data-tid="colorPickerCloseDialog" onClick={props.onClose}>
- {t('core:cancel')}
- </TsButton>
- <TsButton
- variant="contained"
- onClick={onConfirm}
- data-tid="colorPickerConfirm"
- >
- {t('core:ok')}
- </TsButton>
- </TsDialogActions>
+ {!smallScreen && (
+ <TsDialogActions>
+ <TsButton data-tid="colorPickerCloseDialog" onClick={props.onClose}>
+ {t('core:cancel')}
+ </TsButton>
+ {okButton}
+ </TsDialogActions>
+ )}
</Dialog>
);
}
diff --git a/src/renderer/components/dialogs/CreateTagsDialog.tsx b/src/renderer/components/dialogs/CreateTagsDialog.tsx
index cf727d754..e0e392994 100644
--- a/src/renderer/components/dialogs/CreateTagsDialog.tsx
+++ b/src/renderer/components/dialogs/CreateTagsDialog.tsx
@@ -16,21 +16,23 @@
*
*/
-import React, { useEffect, useState } from 'react';
+import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
+import TsTextField from '-/components/TsTextField';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
+import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
+import { parseNewTags } from '-/services/utils-io';
+import { TS } from '-/tagspaces.namespace';
+import useFirstRender from '-/utils/useFirstRender';
+import { Paper, useTheme } from '@mui/material';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
-import DialogTitle from '@mui/material/DialogTitle';
import FormControl from '@mui/material/FormControl';
import FormHelperText from '@mui/material/FormHelperText';
-import Dialog from '@mui/material/Dialog';
-import TsTextField from '-/components/TsTextField';
-import useFirstRender from '-/utils/useFirstRender';
-import { TS } from '-/tagspaces.namespace';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
+import useMediaQuery from '@mui/material/useMediaQuery';
+import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
-import { parseNewTags } from '-/services/utils-io';
interface Props {
open: boolean;
@@ -82,13 +84,26 @@ function CreateTagsDialog(props: Props) {
}
};
- // const theme = useTheme();
- // const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const theme = useTheme();
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
+
+ const okButton = (
+ <TsButton
+ disabled={inputError}
+ onClick={onConfirm}
+ data-tid="createTagsConfirmButton"
+ variant="contained"
+ >
+ {t('core:ok')}
+ </TsButton>
+ );
+
return (
<Dialog
open={open}
onClose={onClose}
- // fullScreen={fullScreen}
+ fullScreen={smallScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
keepMounted
scroll="paper"
onKeyDown={(event) => {
@@ -99,10 +114,12 @@ function CreateTagsDialog(props: Props) {
}
}}
>
- <DialogTitle>
- {t('core:addTagsToGroupTitle')}
- <DialogCloseButton testId="closeCreateTagTID" onClose={onClose} />
- </DialogTitle>
+ <TsDialogTitle
+ dialogTitle={t('core:addTagsToGroupTitle')}
+ closeButtonTestId="closeCreateTagTID"
+ onClose={onClose}
+ actionSlot={okButton}
+ />
<DialogContent style={{ minWidth: 300, paddingTop: 10 }}>
<FormControl fullWidth={true} error={inputError}>
<TsTextField
@@ -119,17 +136,12 @@ function CreateTagsDialog(props: Props) {
)}
</FormControl>
</DialogContent>
- <TsDialogActions>
- <TsButton onClick={onClose}>{t('core:cancel')}</TsButton>
- <TsButton
- disabled={inputError}
- onClick={onConfirm}
- data-tid="createTagsConfirmButton"
- variant="contained"
- >
- {t('core:ok')}
- </TsButton>
- </TsDialogActions>
+ {!smallScreen && (
+ <TsDialogActions>
+ <TsButton onClick={onClose}>{t('core:cancel')}</TsButton>
+ {okButton}
+ </TsDialogActions>
+ )}
</Dialog>
);
}
diff --git a/src/renderer/components/dialogs/EditEntryTagDialog.tsx b/src/renderer/components/dialogs/EditEntryTagDialog.tsx
index fdb77c6b3..a8dbebb36 100644
--- a/src/renderer/components/dialogs/EditEntryTagDialog.tsx
+++ b/src/renderer/components/dialogs/EditEntryTagDialog.tsx
@@ -16,33 +16,33 @@
*
*/
-import React, {
- useState,
- useEffect,
- useMemo,
- ChangeEvent,
- useRef,
-} from 'react';
-import { useTheme } from '@mui/material/styles';
-import useMediaQuery from '@mui/material/useMediaQuery';
+import AppConfig from '-/AppConfig';
import TsButton from '-/components/TsButton';
+import TsTextField from '-/components/TsTextField';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
-import DialogContent from '@mui/material/DialogContent';
-import FormControl from '@mui/material/FormControl';
-import FormHelperText from '@mui/material/FormHelperText';
-import Dialog from '@mui/material/Dialog';
-import EditIcon from '@mui/icons-material/Edit';
-import TsTextField from '-/components/TsTextField';
-import { isGeoTag } from '-/utils/geo';
+import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
import { Pro } from '-/pro';
-import { isDateTimeTag } from '-/utils/dates';
+import { tagsValidation } from '-/services/utils-io';
import { TS } from '-/tagspaces.namespace';
+import { isDateTimeTag } from '-/utils/dates';
+import { isGeoTag } from '-/utils/geo';
import useValidation from '-/utils/useValidation';
+import EditIcon from '@mui/icons-material/Edit';
+import Dialog from '@mui/material/Dialog';
+import DialogContent from '@mui/material/DialogContent';
+import FormControl from '@mui/material/FormControl';
+import FormHelperText from '@mui/material/FormHelperText';
+import { useTheme } from '@mui/material/styles';
+import useMediaQuery from '@mui/material/useMediaQuery';
+import React, {
+ ChangeEvent,
+ useEffect,
+ useMemo,
+ useRef,
+ useState,
+} from 'react';
import { useTranslation } from 'react-i18next';
-import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
-import { tagsValidation } from '-/services/utils-io';
-import AppConfig from '-/AppConfig';
interface Props {
open: boolean;
@@ -170,11 +170,11 @@ function EditEntryTagDialog(props: Props) {
}
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
return (
<Dialog
open={open}
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
onClose={onClose}
style={{
minWidth: 400,
diff --git a/src/renderer/components/dialogs/EditTagDialog.tsx b/src/renderer/components/dialogs/EditTagDialog.tsx
index 84c055474..a38dfb5c2 100644
--- a/src/renderer/components/dialogs/EditTagDialog.tsx
+++ b/src/renderer/components/dialogs/EditTagDialog.tsx
@@ -16,25 +16,26 @@
*
*/
-import React, { useEffect, useState } from 'react';
+import Tag from '-/components/Tag';
import TsButton from '-/components/TsButton';
-import format from 'date-fns/format';
+import TsTextField from '-/components/TsTextField';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
+import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
+import { TS } from '-/tagspaces.namespace';
+import { useTheme } from '@mui/material';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
-import DialogTitle from '@mui/material/DialogTitle';
import FormControl from '@mui/material/FormControl';
import FormHelperText from '@mui/material/FormHelperText';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText/ListItemText';
-import Dialog from '@mui/material/Dialog';
-import ColorPickerDialog from './ColorPickerDialog';
-import Tag from '-/components/Tag';
-import TransparentBackground from '../TransparentBackground';
-import TsTextField from '-/components/TsTextField';
-import { TS } from '-/tagspaces.namespace';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
+import useMediaQuery from '@mui/material/useMediaQuery';
+import format from 'date-fns/format';
+import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
+import TransparentBackground from '../TransparentBackground';
+import ColorPickerDialog from './ColorPickerDialog';
interface Props {
open: boolean;
@@ -110,13 +111,24 @@ function EditTagDialog(props: Props) {
};
const { open, onClose } = props;
+ const theme = useTheme();
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
+
+ const okButton = (
+ <TsButton
+ disabled={inputError}
+ onClick={onConfirm}
+ data-tid="editTagConfirm"
+ variant="contained"
+ >
+ {t('core:ok')}
+ </TsButton>
+ );
- // const theme = useTheme();
- // const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
return (
<Dialog
open={open}
- // fullScreen={fullScreen}
+ fullScreen={smallScreen}
onClose={onClose}
keepMounted
scroll="paper"
@@ -130,21 +142,13 @@ function EditTagDialog(props: Props) {
}*/
}}
>
- <DialogTitle style={{ overflow: 'visible' }}>
- {t('core:editTagTitle')}
- {` `}
- <Tag
- backgroundColor={color}
- textColor={textcolor}
- isDragging={false}
- tagTitle={description}
- >
- {title}
- <span style={{ margin: 3 }} />
- </Tag>
- <DialogCloseButton testId="closeEditTagTID" onClose={onClose} />
- </DialogTitle>
- <DialogContent style={{ overflow: 'visible' }}>
+ <TsDialogTitle
+ dialogTitle={t('core:editTagTitle')}
+ closeButtonTestId="closeEditTagTID"
+ onClose={onClose}
+ actionSlot={okButton}
+ />
+ <DialogContent>
<FormControl
fullWidth={true}
error={inputError}
@@ -251,20 +255,24 @@ function EditTagDialog(props: Props) {
/>
)}
</ListItem>
+ <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>
+ <ListItemText primary={t('core:tagPreview')} />
+ <Tag backgroundColor={color} textColor={textcolor} isDragging={false}>
+ <span style={{ textTransform: 'lowercase' }}>
+ {t('core:tagPreview')}
+ </span>
+ <span style={{ margin: 3 }} />
+ </Tag>
+ </ListItem>
</DialogContent>
- <TsDialogActions>
- <TsButton onClick={props.onClose} data-tid="closeEditTagDialog">
- {t('core:cancel')}
- </TsButton>
- <TsButton
- disabled={inputError}
- onClick={onConfirm}
- data-tid="editTagConfirm"
- variant="contained"
- >
- {t('core:ok')}
- </TsButton>
- </TsDialogActions>
+ {!smallScreen && (
+ <TsDialogActions>
+ <TsButton onClick={props.onClose} data-tid="closeEditTagDialog">
+ {t('core:cancel')}
+ </TsButton>
+ {okButton}
+ </TsDialogActions>
+ )}
</Dialog>
);
}
diff --git a/src/renderer/components/dialogs/EditTagGroupDialog.tsx b/src/renderer/components/dialogs/EditTagGroupDialog.tsx
index f41338fc4..ae03d28ba 100644
--- a/src/renderer/components/dialogs/EditTagGroupDialog.tsx
+++ b/src/renderer/components/dialogs/EditTagGroupDialog.tsx
@@ -16,33 +16,33 @@
*
*/
-import React, { ChangeEvent, useEffect, useState } from 'react';
+import Tag from '-/components/Tag';
import TsButton from '-/components/TsButton';
+import TsSelect from '-/components/TsSelect';
+import TsTextField from '-/components/TsTextField';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import { useTagGroupsLocationContext } from '-/hooks/useTagGroupsLocationContext';
+import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
+import { Pro } from '-/pro';
+import { getSaveTagInLocation } from '-/reducers/settings';
+import { TS } from '-/tagspaces.namespace';
+import { CommonLocation } from '-/utils/CommonLocation';
+import { useMediaQuery, useTheme } from '@mui/material';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
import FormControl from '@mui/material/FormControl';
import FormHelperText from '@mui/material/FormHelperText';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText/ListItemText';
-import Switch from '@mui/material/Switch';
-import Dialog from '@mui/material/Dialog';
import MenuItem from '@mui/material/MenuItem';
+import Switch from '@mui/material/Switch';
+import React, { ChangeEvent, useEffect, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
-import ColorPickerDialog from './ColorPickerDialog';
import TransparentBackground from '../TransparentBackground';
-import { TS } from '-/tagspaces.namespace';
-import { Pro } from '-/pro';
-import TsTextField from '-/components/TsTextField';
-import TsSelect from '-/components/TsSelect';
-import Tag from '-/components/Tag';
-import { getSaveTagInLocation } from '-/reducers/settings';
-import { useTranslation } from 'react-i18next';
-import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
-import { CommonLocation } from '-/utils/CommonLocation';
-import { useTagGroupsLocationContext } from '-/hooks/useTagGroupsLocationContext';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
-import { useMediaQuery, useTheme } from '@mui/material';
+import ColorPickerDialog from './ColorPickerDialog';
const defaultTagGroupLocation = 'TAG_LIBRARY';
@@ -250,7 +250,9 @@ function EditTagGroupDialog(props: Props) {
<ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>
<ListItemText primary={t('core:tagPreview')} />
<Tag backgroundColor={color} textColor={textcolor} isDragging={false}>
- tag-preview
+ <span style={{ textTransform: 'lowercase' }}>
+ {t('core:tagPreview')}
+ </span>
<span style={{ margin: 3 }} />
</Tag>
</ListItem>
diff --git a/src/renderer/components/dialogs/LicenseDialog.tsx b/src/renderer/components/dialogs/LicenseDialog.tsx
index 13c3baed9..c3e2d79da 100644
--- a/src/renderer/components/dialogs/LicenseDialog.tsx
+++ b/src/renderer/components/dialogs/LicenseDialog.tsx
@@ -16,18 +16,17 @@
*
*/
-import React from 'react';
+import LicenseContent from '-/LICENSE.txt';
import TsButton from '-/components/TsButton';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
+import { Pro } from '-/pro';
+import { quitApp } from '-/services/utils-io';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
-import Dialog from '@mui/material/Dialog';
-import { Pro } from '-/pro';
-import LicenseContent from '-/LICENSE.txt';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import { useTranslation } from 'react-i18next';
-import { quitApp } from '-/services/utils-io';
// import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
@@ -59,14 +58,14 @@ function LicenseDialog(props: Props) {
// }
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
return (
<Dialog
open={open}
onClose={onClose}
keepMounted
disableEscapeKeyDown
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
scroll="paper"
>
<DialogTitle>{t('core:license')}</DialogTitle>
diff --git a/src/renderer/components/dialogs/MapTileServerDialog.tsx b/src/renderer/components/dialogs/MapTileServerDialog.tsx
index 69a456871..a0182d376 100644
--- a/src/renderer/components/dialogs/MapTileServerDialog.tsx
+++ b/src/renderer/components/dialogs/MapTileServerDialog.tsx
@@ -16,28 +16,29 @@
*
*/
-import React, { useRef } from 'react';
-import { useTheme } from '@mui/material/styles';
-import useMediaQuery from '@mui/material/useMediaQuery';
+import AppConfig from '-/AppConfig';
+import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
-import Dialog from '@mui/material/Dialog';
+import TsTextField from '-/components/TsTextField';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
+import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { AppDispatch } from '-/reducers/app';
+import { actions as SettingsActions } from '-/reducers/settings';
+import { TS } from '-/tagspaces.namespace';
+import useValidation from '-/utils/useValidation';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
-import DialogTitle from '@mui/material/DialogTitle';
-import TsTextField from '-/components/TsTextField';
-import FormHelperText from '@mui/material/FormHelperText';
import FormControl from '@mui/material/FormControl';
+import FormHelperText from '@mui/material/FormHelperText';
+import ListItem from '@mui/material/ListItem/ListItem';
+import ListItemText from '@mui/material/ListItemText';
+import Paper from '@mui/material/Paper';
import Switch from '@mui/material/Switch';
-import { useDispatch } from 'react-redux';
-import useValidation from '-/utils/useValidation';
-import { TS } from '-/tagspaces.namespace';
-import { actions as SettingsActions } from '-/reducers/settings';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
-import { AppDispatch } from '-/reducers/app';
+import { useTheme } from '@mui/material/styles';
+import useMediaQuery from '@mui/material/useMediaQuery';
+import { useRef } from 'react';
import { useTranslation } from 'react-i18next';
-import ListItemText from '@mui/material/ListItemText';
-import ListItem from '@mui/material/ListItem/ListItem';
-import AppConfig from '-/AppConfig';
+import { useDispatch } from 'react-redux';
interface Props {
open: boolean;
@@ -54,19 +55,9 @@ function MapTileServerDialog(props: Props) {
const serverInfo = useRef<string>(props.tileServer.serverInfo);
const isDefault = useRef<boolean>(props.isDefault);
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
-
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const { open, onClose } = props;
const { setError, haveError } = useValidation();
- const renderTitle = () => (
- <DialogTitle>
- {t(
- props.tileServer.uuid
- ? 'core:tileServerDialogEdit'
- : 'core:tileServerDialogAdd',
- )}
- <DialogCloseButton testId="closeMapTileServerTID" onClose={onClose} />
- </DialogTitle>
- );
const validateForm = () => {
if (!name.current) {
@@ -121,9 +112,6 @@ function MapTileServerDialog(props: Props) {
name.current = target.value;
validateForm();
}}
- // updateValue={(value) => {
- // name.current = value;
- // }}
retrieveValue={() => name.current}
defaultValue={name.current}
data-tid="tileServerNameTID"
@@ -137,9 +125,6 @@ function MapTileServerDialog(props: Props) {
const { target } = event;
serverURL.current = target.value;
}}
- // updateValue={(value) => {
- // serverURL.current = value;
- // }}
retrieveValue={() => serverURL.current}
defaultValue={serverURL.current}
data-tid="tileServerUrlTID"
@@ -176,54 +161,58 @@ function MapTileServerDialog(props: Props) {
</DialogContent>
);
- const renderActions = () => (
- <TsDialogActions
- style={{
- justifyContent: props.tileServer.uuid ? 'space-between' : 'flex-end',
- }}
- >
- {props.tileServer.uuid && (
- <TsButton
- style={{
- marginLeft: 10,
- }}
- data-tid="deleteTileServerTID"
- onClick={() => {
- dispatch(SettingsActions.deleteTileServer(props.tileServer.uuid));
- props.onClose();
- }}
- >
- {t('core:delete')}
- </TsButton>
- )}
- <div>
- <TsButton data-tid="closeTileServerDialogTID" onClick={props.onClose}>
- {t('core:closeButton')}
- </TsButton>
- <TsButton
- data-tid="saveTileServerDialogTID"
- onClick={saveTileServer}
- style={{ marginLeft: AppConfig.defaultSpaceBetweenButtons }}
- variant="contained"
- >
- {t('core:confirmSaveButton')}
- </TsButton>
- </div>
- </TsDialogActions>
- );
-
- const { open, onClose } = props;
return (
<Dialog
open={open}
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
keepMounted
scroll="paper"
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
onClose={onClose}
>
- {renderTitle()}
+ <TsDialogTitle
+ dialogTitle={t(
+ props.tileServer.uuid
+ ? 'core:tileServerDialogEdit'
+ : 'core:tileServerDialogAdd',
+ )}
+ closeButtonTestId="closeMapTileServerTID"
+ onClose={onClose}
+ />
{renderContent()}
- {renderActions()}
+ <TsDialogActions
+ style={{
+ justifyContent: props.tileServer.uuid ? 'space-between' : 'flex-end',
+ }}
+ >
+ {props.tileServer.uuid && (
+ <TsButton
+ style={{
+ marginLeft: 10,
+ }}
+ data-tid="deleteTileServerTID"
+ onClick={() => {
+ dispatch(SettingsActions.deleteTileServer(props.tileServer.uuid));
+ props.onClose();
+ }}
+ >
+ {t('core:delete')}
+ </TsButton>
+ )}
+ <div>
+ <TsButton data-tid="closeTileServerDialogTID" onClick={props.onClose}>
+ {t('core:closeButton')}
+ </TsButton>
+ <TsButton
+ data-tid="saveTileServerDialogTID"
+ onClick={saveTileServer}
+ style={{ marginLeft: AppConfig.defaultSpaceBetweenButtons }}
+ variant="contained"
+ >
+ {t('core:confirmSaveButton')}
+ </TsButton>
+ </div>
+ </TsDialogActions>
</Dialog>
);
}
diff --git a/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx b/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx
index cbe0560e4..0fdfc939b 100644
--- a/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx
+++ b/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx
@@ -1,33 +1,33 @@
-import React, { useState, useRef, useReducer, useEffect } from 'react';
-import { useDispatch } from 'react-redux';
-import { formatBytes } from '@tagspaces/tagspaces-common/misc';
-import Paper from '@mui/material/Paper';
+import AppConfig from '-/AppConfig';
+import { FileIcon, FolderIcon } from '-/components/CommonIcons';
+import DirectoryListView from '-/components/DirectoryListView';
+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 { useEntryExistDialogContext } from '-/components/dialogs/hooks/useEntryExistDialogContext';
+import { useFileUploadDialogContext } from '-/components/dialogs/hooks/useFileUploadDialogContext';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
+import { useIOActionsContext } from '-/hooks/useIOActionsContext';
+import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
+import { actions as AppActions, AppDispatch } from '-/reducers/app';
+import { getDirProperties } from '-/services/utils-io';
+import { TS } from '-/tagspaces.namespace';
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 ListItemIcon from '@mui/material/ListItemIcon';
-import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
-import DialogContent from '@mui/material/DialogContent';
-import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import Paper from '@mui/material/Paper';
import Typography from '@mui/material/Typography';
-import Dialog from '@mui/material/Dialog';
-import { FolderIcon, FileIcon } from '-/components/CommonIcons';
-import DraggablePaper from '-/components/DraggablePaper';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
-import { actions as AppActions, AppDispatch } from '-/reducers/app';
-import { TS } from '-/tagspaces.namespace';
-import DirectoryListView from '-/components/DirectoryListView';
-import AppConfig from '-/AppConfig';
+import { formatBytes } from '@tagspaces/tagspaces-common/misc';
+import { useEffect, useReducer, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
-import { useIOActionsContext } from '-/hooks/useIOActionsContext';
-import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
-import { getDirProperties } from '-/services/utils-io';
-import { useFileUploadDialogContext } from '-/components/dialogs/hooks/useFileUploadDialogContext';
-import { useEntryExistDialogContext } from '-/components/dialogs/hooks/useEntryExistDialogContext';
+import { useDispatch } from 'react-redux';
interface Props {
open: boolean;
@@ -177,7 +177,7 @@ function MoveCopyFilesDialog(props: Props) {
}
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
return (
<Dialog
open={open}
@@ -185,8 +185,8 @@ function MoveCopyFilesDialog(props: Props) {
keepMounted
scroll="paper"
aria-labelledby="draggable-dialog-title"
- PaperComponent={fullScreen ? Paper : DraggablePaper}
- fullScreen={fullScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
+ fullScreen={smallScreen}
>
<TsDialogTitle
dialogTitle={t('core:copyMoveEntriesTitle')}
diff --git a/src/renderer/components/dialogs/MoveOrCopyFilesDialog.tsx b/src/renderer/components/dialogs/MoveOrCopyFilesDialog.tsx
index 501841d47..a3855dc57 100644
--- a/src/renderer/components/dialogs/MoveOrCopyFilesDialog.tsx
+++ b/src/renderer/components/dialogs/MoveOrCopyFilesDialog.tsx
@@ -21,30 +21,29 @@
* file manager or desktop of the operating system
*/
-import React from 'react';
-import { joinPaths, extractFileName } from '@tagspaces/tagspaces-common/paths';
+import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
-import Paper from '@mui/material/Paper';
-import List from '@mui/material/List';
-import ListItem from '@mui/material/ListItem';
-import ListItemIcon from '@mui/material/ListItemIcon';
-import FileIcon from '@mui/icons-material/InsertDriveFileOutlined';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { useEntryExistDialogContext } from '-/components/dialogs/hooks/useEntryExistDialogContext';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
+import { useEditedEntryMetaContext } from '-/hooks/useEditedEntryMetaContext';
+import { useIOActionsContext } from '-/hooks/useIOActionsContext';
+import { executePromisesInBatches } from '-/services/utils-io';
+import { TS } from '-/tagspaces.namespace';
+import FileIcon from '@mui/icons-material/InsertDriveFileOutlined';
+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 ListItemIcon from '@mui/material/ListItemIcon';
+import Paper from '@mui/material/Paper';
import Typography from '@mui/material/Typography';
-import Dialog from '@mui/material/Dialog';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
-import DraggablePaper from '-/components/DraggablePaper';
+import { extractFileName, joinPaths } from '@tagspaces/tagspaces-common/paths';
import { useTranslation } from 'react-i18next';
-import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
-import { useIOActionsContext } from '-/hooks/useIOActionsContext';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
-import { TS } from '-/tagspaces.namespace';
-import { useEditedEntryMetaContext } from '-/hooks/useEditedEntryMetaContext';
-import { executePromisesInBatches } from '-/services/utils-io';
-import { useEntryExistDialogContext } from '-/components/dialogs/hooks/useEntryExistDialogContext';
interface Props {
open: boolean;
@@ -66,7 +65,7 @@ function MoveOrCopyFilesDialog(props: Props) {
const { findLocation } = useCurrentLocationContext();
const { moveFiles, copyFiles } = useIOActionsContext();
const { currentDirectoryPath } = useDirectoryContentContext();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
const targetDir = props.targetDir ? props.targetDir : currentDirectoryPath;
const targetLocation = findLocation(targetLocationId);
@@ -123,8 +122,8 @@ function MoveOrCopyFilesDialog(props: Props) {
keepMounted
scroll="paper"
aria-labelledby="draggable-dialog-title"
- PaperComponent={fullScreen ? Paper : DraggablePaper}
- fullScreen={fullScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
+ fullScreen={smallScreen}
>
<TsDialogTitle
dialogTitle={t('core:copyMoveEntriesTitle')}
diff --git a/src/renderer/components/dialogs/NewAudioDialog.tsx b/src/renderer/components/dialogs/NewAudioDialog.tsx
index 63d95db68..afee07af5 100644
--- a/src/renderer/components/dialogs/NewAudioDialog.tsx
+++ b/src/renderer/components/dialogs/NewAudioDialog.tsx
@@ -16,17 +16,16 @@
*
*/
-import React from 'react';
-import DialogContent from '@mui/material/DialogContent';
+import DraggablePaper from '-/components/DraggablePaper';
+import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { TargetPathContextProvider } from '-/components/dialogs/hooks/TargetPathContextProvider';
+import { Pro } from '-/pro';
import Dialog from '@mui/material/Dialog';
+import DialogContent from '@mui/material/DialogContent';
import Paper from '@mui/material/Paper';
-import DraggablePaper from '-/components/DraggablePaper';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
-import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
-import { TargetPathContextProvider } from '-/components/dialogs/hooks/TargetPathContextProvider';
import { useTranslation } from 'react-i18next';
-import { Pro } from '-/pro';
interface Props {
open: boolean;
@@ -40,7 +39,7 @@ function NewAudioDialog(props: Props) {
const { t } = useTranslation();
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
function intOnClose(event?: any, reason?: any) {
if (reason === 'escapeKeyDown' || reason === 'backdropClick') {
@@ -55,10 +54,10 @@ function NewAudioDialog(props: Props) {
<Dialog
open={open}
onClose={intOnClose}
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
keepMounted
aria-labelledby="draggable-dialog-title"
- PaperComponent={fullScreen ? Paper : DraggablePaper}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
scroll="paper"
>
<TsDialogTitle
diff --git a/src/renderer/components/dialogs/OnboardingDialog.tsx b/src/renderer/components/dialogs/OnboardingDialog.tsx
index 3da5d2ddb..a103d48d2 100644
--- a/src/renderer/components/dialogs/OnboardingDialog.tsx
+++ b/src/renderer/components/dialogs/OnboardingDialog.tsx
@@ -16,38 +16,37 @@
*
*/
-import React, { useRef } from 'react';
-import { useSelector, useDispatch } from 'react-redux';
-import Slider from 'react-slick';
-import TsButton from '-/components/TsButton';
-import DialogContent from '@mui/material/DialogContent';
-import Typography from '@mui/material/Typography';
-import Radio from '@mui/material/Radio';
-import RadioGroup from '@mui/material/RadioGroup';
-import FormControlLabel from '@mui/material/FormControlLabel';
-import FormControl from '@mui/material/FormControl';
-import ToggleButton from '@mui/material/ToggleButton';
-import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
-import Dialog from '@mui/material/Dialog';
+import ChooseTagging from '-/assets/images/abacus.svg';
import BrowserExtension from '-/assets/images/collectcontent.svg';
import WizardFinished from '-/assets/images/computer-desk.svg';
-import ChooseTagging from '-/assets/images/abacus.svg';
-import Organize from '-/assets/images/organize.svg';
import NewLook from '-/assets/images/desktop.svg';
+import Organize from '-/assets/images/organize.svg';
+import TsButton from '-/components/TsButton';
+import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { AppDispatch } from '-/reducers/app';
import {
+ actions as SettingsActions,
getCurrentTheme,
getPersistTagsInSidecarFile,
- actions as SettingsActions,
} from '-/reducers/settings';
-import Links from 'assets/links';
-import { useTheme } from '@mui/material/styles';
-import useMediaQuery from '@mui/material/useMediaQuery';
import { openURLExternally } from '-/services/utils-io';
-import { AppDispatch } from '-/reducers/app';
-import { useTranslation } from 'react-i18next';
import NavigateBeforeIcon from '@mui/icons-material/NavigateBefore';
import NavigateNextIcon from '@mui/icons-material/NavigateNext';
-import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import Dialog from '@mui/material/Dialog';
+import DialogContent from '@mui/material/DialogContent';
+import FormControl from '@mui/material/FormControl';
+import FormControlLabel from '@mui/material/FormControlLabel';
+import Radio from '@mui/material/Radio';
+import RadioGroup from '@mui/material/RadioGroup';
+import ToggleButton from '@mui/material/ToggleButton';
+import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
+import Typography from '@mui/material/Typography';
+import { useTheme } from '@mui/material/styles';
+import useMediaQuery from '@mui/material/useMediaQuery';
+import Links from 'assets/links';
+import { useTranslation } from 'react-i18next';
+import { useDispatch, useSelector } from 'react-redux';
+import Slider from 'react-slick';
interface Props {
classes: any;
@@ -77,7 +76,7 @@ function OnboardingDialog(props: Props) {
};
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
function NextArrow(props) {
const { className, style, onClick } = props;
@@ -117,7 +116,7 @@ function OnboardingDialog(props: Props) {
open={open}
onClose={onClose}
keepMounted
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
scroll="paper"
>
<TsDialogTitle
diff --git a/src/renderer/components/dialogs/ProTeaserDialog.tsx b/src/renderer/components/dialogs/ProTeaserDialog.tsx
index 9559c9ffe..86ba89fe0 100644
--- a/src/renderer/components/dialogs/ProTeaserDialog.tsx
+++ b/src/renderer/components/dialogs/ProTeaserDialog.tsx
@@ -167,7 +167,7 @@ function ProTeaserDialog(props: Props) {
const { open, onClose, slideIndex } = props;
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
const slides = [];
for (let index in slidesEN) {
@@ -213,7 +213,7 @@ function ProTeaserDialog(props: Props) {
<Dialog
open={open}
onClose={onClose}
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
keepMounted
scroll="paper"
>
diff --git a/src/renderer/components/dialogs/RenameEntryDialog.tsx b/src/renderer/components/dialogs/RenameEntryDialog.tsx
index d86dadcd5..5c7b6ad75 100644
--- a/src/renderer/components/dialogs/RenameEntryDialog.tsx
+++ b/src/renderer/components/dialogs/RenameEntryDialog.tsx
@@ -16,29 +16,30 @@
*
*/
-import React, { useReducer, useRef, useState } from 'react';
+import AppConfig from '-/AppConfig';
+import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
+import TsTextField from '-/components/TsTextField';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
+import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
+import { useIOActionsContext } from '-/hooks/useIOActionsContext';
+import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
+import { dirNameValidation, fileNameValidation } from '-/services/utils-io';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
-import DialogTitle from '@mui/material/DialogTitle';
import FormControl from '@mui/material/FormControl';
import FormHelperText from '@mui/material/FormHelperText';
-import Dialog from '@mui/material/Dialog';
+import { useTheme } from '@mui/material/styles';
+import useMediaQuery from '@mui/material/useMediaQuery';
import {
extractContainingDirectoryPath,
extractDirectoryName,
extractFileName,
} from '@tagspaces/tagspaces-common/paths';
-import DraggablePaper from '-/components/DraggablePaper';
-import AppConfig from '-/AppConfig';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
-import TsTextField from '-/components/TsTextField';
-import { dirNameValidation, fileNameValidation } from '-/services/utils-io';
+import React, { useReducer, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useIOActionsContext } from '-/hooks/useIOActionsContext';
-import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
-import { useSelectedEntriesContext } from '-/hooks/useSelectedEntriesContext';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
interface Props {
open: boolean;
@@ -55,6 +56,8 @@ function RenameEntryDialog(props: Props) {
const lastSelectedEntry = selectedEntries[selectedEntries.length - 1];
const [inputError, setInputError] = useState<boolean>(false);
const disableConfirmButton = useRef<boolean>(true);
+ const theme = useTheme();
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
let defaultName = '';
let originPath;
@@ -80,12 +83,6 @@ function RenameEntryDialog(props: Props) {
currentLocation?.getDirSeparator(),
);
originPath = currentDirectoryPath;
- } else {
- return (
- <Dialog open={open} onClose={onClose}>
- <DialogTitle>{t('core:noSelectedEntryError')}</DialogTitle>
- </Dialog>
- );
}
const name = useRef<string>(defaultName);
@@ -153,10 +150,22 @@ function RenameEntryDialog(props: Props) {
}
};
+ const okButton = (
+ <TsButton
+ disabled={disableConfirmButton.current}
+ onClick={onConfirm}
+ data-tid="confirmRenameEntry"
+ variant="contained"
+ >
+ {t('core:ok')}
+ </TsButton>
+ );
+
return (
<Dialog
open={open}
onClose={onClose}
+ fullScreen={smallScreen}
keepMounted
scroll="paper"
aria-labelledby="draggable-dialog-title"
@@ -171,10 +180,12 @@ function RenameEntryDialog(props: Props) {
}*/
}}
>
- <DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
- {t('core:' + (isFile ? 'renameFile' : 'renameDirectory'))}
- <DialogCloseButton testId="closeRenameEntryTID" onClose={onClose} />
- </DialogTitle>
+ <TsDialogTitle
+ dialogTitle={t('core:' + (isFile ? 'renameFile' : 'renameDirectory'))}
+ closeButtonTestId="closeRenameEntryTID"
+ onClose={onClose}
+ actionSlot={okButton}
+ />
<DialogContent>
<FormControl fullWidth={true} error={inputError}>
<TsTextField
@@ -196,19 +207,14 @@ function RenameEntryDialog(props: Props) {
</FormHelperText>
</FormControl>
</DialogContent>
- <TsDialogActions>
- <TsButton data-tid="closeRenameEntryDialog" onClick={onClose}>
- {t('core:cancel')}
- </TsButton>
- <TsButton
- disabled={disableConfirmButton.current}
- onClick={onConfirm}
- data-tid="confirmRenameEntry"
- variant="contained"
- >
- {t('core:ok')}
- </TsButton>
- </TsDialogActions>
+ {!smallScreen && (
+ <TsDialogActions>
+ <TsButton data-tid="closeRenameEntryDialog" onClick={onClose}>
+ {t('core:cancel')}
+ </TsButton>
+ {okButton}
+ </TsDialogActions>
+ )}
</Dialog>
);
}
diff --git a/src/renderer/components/dialogs/ResolveConflictDialog.tsx b/src/renderer/components/dialogs/ResolveConflictDialog.tsx
index 3ea5c9fbc..f9acbbde0 100644
--- a/src/renderer/components/dialogs/ResolveConflictDialog.tsx
+++ b/src/renderer/components/dialogs/ResolveConflictDialog.tsx
@@ -16,23 +16,23 @@
*
*/
-import React from 'react';
import TsButton from '-/components/TsButton';
+import TsTextField from '-/components/TsTextField';
+import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
+import { TS } from '-/tagspaces.namespace';
+import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
-import TsTextField from '-/components/TsTextField';
-import Dialog from '@mui/material/Dialog';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
-import useMediaQuery from '@mui/material/useMediaQuery';
import { useTheme } from '@mui/material/styles';
+import useMediaQuery from '@mui/material/useMediaQuery';
import {
extractContainingDirectoryPath,
extractFileExtension,
extractFileName,
} from '@tagspaces/tagspaces-common/paths';
+import React from 'react';
import { useTranslation } from 'react-i18next';
-import { TS } from '-/tagspaces.namespace';
interface Props {
open: boolean;
@@ -49,7 +49,7 @@ function ResolveConflictDialog(props: Props) {
const [isSaveAs, setSaveAs] = React.useState<boolean>(false);
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
function getFileName() {
if (openedEntry) {
diff --git a/src/renderer/perspectives/grid/components/GridSettingsDialog.tsx b/src/renderer/perspectives/grid/components/GridSettingsDialog.tsx
index d1b103d86..9bed95d1a 100644
--- a/src/renderer/perspectives/grid/components/GridSettingsDialog.tsx
+++ b/src/renderer/perspectives/grid/components/GridSettingsDialog.tsx
@@ -16,39 +16,39 @@
*
*/
-import React, { useEffect, useReducer } from 'react';
+import DraggablePaper from '-/components/DraggablePaper';
+import TsButton from '-/components/TsButton';
+import TsSelect from '-/components/TsSelect';
+import ZoomComponent from '-/components/ZoomComponent';
+import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
+import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import { usePerspectiveSettingsContext } from '-/hooks/usePerspectiveSettingsContext';
+import { useSortedDirContext } from '-/perspectives/grid/hooks/useSortedDirContext';
+import { Pro } from '-/pro';
+import useFirstRender from '-/utils/useFirstRender';
+import ThumbnailCoverIcon from '@mui/icons-material/PhotoSizeSelectActual';
+import ThumbnailContainIcon from '@mui/icons-material/PhotoSizeSelectLarge';
+import RadioCheckedIcon from '@mui/icons-material/RadioButtonChecked';
+import RadioUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked';
import {
+ Box,
Dialog,
DialogContent,
+ Divider,
FormControl,
FormControlLabel,
FormGroup,
- Switch,
- Divider,
MenuItem,
- Typography,
Paper,
- Box,
+ Switch,
+ Typography,
} from '@mui/material';
-import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
-import useMediaQuery from '@mui/material/useMediaQuery';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
-import ThumbnailCoverIcon from '@mui/icons-material/PhotoSizeSelectActual';
-import ThumbnailContainIcon from '@mui/icons-material/PhotoSizeSelectLarge';
-import RadioCheckedIcon from '@mui/icons-material/RadioButtonChecked';
-import RadioUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked';
-import DraggablePaper from '-/components/DraggablePaper';
-import TsSelect from '-/components/TsSelect';
-import TsButton from '-/components/TsButton';
-import { Pro } from '-/pro';
import { useTheme } from '@mui/material/styles';
+import useMediaQuery from '@mui/material/useMediaQuery';
+import React, { useEffect, useReducer } from 'react';
import { useTranslation } from 'react-i18next';
-import { useSortedDirContext } from '-/perspectives/grid/hooks/useSortedDirContext';
-import ZoomComponent from '-/components/ZoomComponent';
-import { usePerspectiveSettingsContext } from '-/hooks/usePerspectiveSettingsContext';
-import useFirstRender from '-/utils/useFirstRender';
-import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
interface Props {
open: boolean;
@@ -78,7 +78,7 @@ function GridSettingsDialog(props: Props) {
const [ignored, forceUpdate] = useReducer((x: number) => x + 1, 0, undefined);
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
const { open, onClose, openHelpWebPage } = props;
useEffect(() => {
@@ -114,8 +114,8 @@ function GridSettingsDialog(props: Props) {
<Dialog
open={open}
onClose={onClose}
- PaperComponent={fullScreen ? Paper : DraggablePaper}
- fullScreen={fullScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
+ fullScreen={smallScreen}
keepMounted
scroll="paper"
>
@@ -140,14 +140,12 @@ function GridSettingsDialog(props: Props) {
onClick={() => {
resetLocalSetting();
onClose();
- // forceUpdate();
}}
>
{t('core:resetLocalSettings')}
</TsButton>
</>
)}
- {/* <Divider /> */}
<Box style={{ display: 'flex' }}>
<Typography
style={{ color: theme.palette.text.primary, alignSelf: 'center' }}
@@ -157,7 +155,6 @@ function GridSettingsDialog(props: Props) {
</Typography>
<ZoomComponent preview={true} />
</Box>
- {/* <Divider /> */}
<FormGroup>
<FormControlLabel
// labelPlacement="start"