TagSpaces is an offline, open source, document manager with tagging support
chore: introducing tsdialogactions component part 2
Ilian Sapundshiev9e164850e906
diff --git a/src/renderer/components/SplitButton.tsx b/src/renderer/components/SplitButton.tsxindex 0fe49f112..9a0b59190 100644--- a/src/renderer/components/SplitButton.tsx+++ b/src/renderer/components/SplitButton.tsx@@ -87,7 +87,6 @@ export default function SplitButton(props: Props) {}}><Paper>- {/* <ClickAwayListener onClickAway={handleClose}> */}<TsMenuList id="split-button-menu">{options.map((option, index) => (<MenuItem@@ -100,7 +99,6 @@ export default function SplitButton(props: Props) {</MenuItem>))}</TsMenuList>- {/* </ClickAwayListener> */}</Paper></Grow>)}@@ -110,4 +108,4 @@ export default function SplitButton(props: Props) {);}-*/\ No newline at end of file+*/diff --git a/src/renderer/components/dialogs/CreateEditLocationDialog.tsx b/src/renderer/components/dialogs/CreateEditLocationDialog.tsxindex 22290b7d2..17623f990 100644--- a/src/renderer/components/dialogs/CreateEditLocationDialog.tsx+++ b/src/renderer/components/dialogs/CreateEditLocationDialog.tsx@@ -22,7 +22,7 @@ import CryptoJS from 'crypto-js';import Paper from '@mui/material/Paper';import TsButton from '-/components/TsButton';import TsSelect from '-/components/TsSelect';-import DialogActions from '@mui/material/DialogActions';+import TsDialogActions from '-/components/dialogs/components/TsDialogActions';import DialogContent from '@mui/material/DialogContent';import DialogTitle from '@mui/material/DialogTitle';import Switch from '@mui/material/Switch';@@ -1181,9 +1181,7 @@ function CreateEditLocationDialog(props: Props) {</Accordion>)}</DialogContent>- <DialogActions- style={fullScreen ? { padding: '10px 30px 30px 30px' } : {}}- >+ <TsDialogActions><TsButton onClick={() => onClose()}>{t('core:cancel')}</TsButton><TsButtondisabled={disableConfirmButton()}@@ -1193,7 +1191,7 @@ function CreateEditLocationDialog(props: Props) {>{t('core:ok')}</TsButton>- </DialogActions>+ </TsDialogActions></StyledDialog>);}diff --git a/src/renderer/components/dialogs/ImportExportTagGroupsDialog.tsx b/src/renderer/components/dialogs/ImportExportTagGroupsDialog.tsxindex 8631ced6c..42bcecff3 100644--- a/src/renderer/components/dialogs/ImportExportTagGroupsDialog.tsx+++ b/src/renderer/components/dialogs/ImportExportTagGroupsDialog.tsx@@ -18,7 +18,7 @@import React, { useRef, useState } from 'react';import TsButton from '-/components/TsButton';-import DialogActions from '@mui/material/DialogActions';+import TsDialogActions from '-/components/dialogs/components/TsDialogActions';import DialogContent from '@mui/material/DialogContent';import DialogTitle from '@mui/material/DialogTitle';import FormControl from '@mui/material/FormControl';@@ -148,9 +148,7 @@ function ImportExportTagGroupsDialog(props: Props) {{tagGroupList.map(renderTagGroups)}</FormControl></DialogContent>- <DialogActions- style={fullScreen ? { padding: '10px 30px 30px 30px' } : {}}- >+ <TsDialogActions><TsButton onClick={props.onClose}>{t('core:cancel')}</TsButton><TsButtondisabled={!isSelected()}@@ -160,7 +158,7 @@ function ImportExportTagGroupsDialog(props: Props) {>{props.dialogModeImport ? 'Import' : 'Export'}</TsButton>- </DialogActions>+ </TsDialogActions></Dialog>);}diff --git a/src/renderer/components/dialogs/KeyboardDialog.tsx b/src/renderer/components/dialogs/KeyboardDialog.tsxindex 0bc9fa08f..7c32f5c6f 100644--- a/src/renderer/components/dialogs/KeyboardDialog.tsx+++ b/src/renderer/components/dialogs/KeyboardDialog.tsx@@ -19,7 +19,7 @@import React from 'react';import { useSelector } from 'react-redux';import TsButton from '-/components/TsButton';-import DialogActions from '@mui/material/DialogActions';+import TsDialogActions from '-/components/dialogs/components/TsDialogActions';import DialogContent from '@mui/material/DialogContent';import DialogTitle from '@mui/material/DialogTitle';import List from '@mui/material/List';@@ -111,9 +111,7 @@ function KeyboardDialog(props: Props) {))}</List></DialogContent>- <DialogActions- style={fullScreen ? { padding: '10px 30px 30px 30px' } : {}}- >+ <TsDialogActions><TsButtondata-tid="closeKeyboardDialog"onClick={onClose}@@ -121,7 +119,7 @@ function KeyboardDialog(props: Props) {>{t('core:ok')}</TsButton>- </DialogActions>+ </TsDialogActions></Dialog>);}diff --git a/src/renderer/components/dialogs/LinkGeneratorDialog.tsx b/src/renderer/components/dialogs/LinkGeneratorDialog.tsxindex 19e15cf11..762100efd 100644--- a/src/renderer/components/dialogs/LinkGeneratorDialog.tsx+++ b/src/renderer/components/dialogs/LinkGeneratorDialog.tsx@@ -18,7 +18,7 @@import React, { ChangeEvent, useRef, useReducer, useEffect } from 'react';import TsButton from '-/components/TsButton';-import DialogActions from '@mui/material/DialogActions';+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';@@ -164,10 +164,9 @@ function LinkGeneratorDialog(props: Props) {}}/></DialogContent>- <DialogActions+ <TsDialogActionsstyle={{justifyContent: 'space-between',- padding: fullScreen ? '10px 30px 30px 30px' : undefined,}}><TsButton@@ -181,7 +180,7 @@ function LinkGeneratorDialog(props: Props) {<TsButton data-tid="closeLinkTID" onClick={onClose} variant="contained">{t('core:close')}</TsButton>- </DialogActions>+ </TsDialogActions></Dialog>);}diff --git a/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx b/src/renderer/components/dialogs/MoveCopyFilesDialog.tsxindex 073f4d1da..f5d0c1f83 100644--- a/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx+++ b/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx@@ -7,7 +7,7 @@ import Box from '@mui/material/Box';import List from '@mui/material/List';import ListItem from '@mui/material/ListItem';import ListItemIcon from '@mui/material/ListItemIcon';-import DialogActions from '@mui/material/DialogActions';+import TsDialogActions from '-/components/dialogs/components/TsDialogActions';import DialogContent from '@mui/material/DialogContent';import DialogTitle from '@mui/material/DialogTitle';import Typography from '@mui/material/Typography';@@ -243,9 +243,7 @@ function MoveCopyFilesDialog(props: Props) {)}</Box></DialogContent>- <DialogActions- style={fullScreen ? { padding: '10px 30px 30px 30px' } : {}}- >+ <TsDialogActions><TsButton data-tid="closeMoveCopyDialog" onClick={() => onClose()}>{t('core:cancel')}</TsButton>@@ -271,7 +269,7 @@ function MoveCopyFilesDialog(props: Props) {>{t('core:copyEntriesButton')}</TsButton>- </DialogActions>+ </TsDialogActions></Dialog>);}diff --git a/src/renderer/components/dialogs/MoveOrCopyFilesDialog.tsx b/src/renderer/components/dialogs/MoveOrCopyFilesDialog.tsxindex 66ba4a85c..7ea69889e 100644--- a/src/renderer/components/dialogs/MoveOrCopyFilesDialog.tsx+++ b/src/renderer/components/dialogs/MoveOrCopyFilesDialog.tsx@@ -29,7 +29,7 @@ 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 DialogActions from '@mui/material/DialogActions';+import TsDialogActions from '-/components/dialogs/components/TsDialogActions';import DialogContent from '@mui/material/DialogContent';import DialogTitle from '@mui/material/DialogTitle';import Typography from '@mui/material/Typography';@@ -159,9 +159,7 @@ function MoveOrCopyFilesDialog(props: Props) {))}</List></DialogContent>- <DialogActions- style={fullScreen ? { padding: '10px 30px 30px 30px' } : {}}- >+ <TsDialogActions><TsButton data-tid="closeMoveOrCopyDialog" onClick={() => onClose()}>{t('core:cancel')}</TsButton>@@ -209,7 +207,7 @@ function MoveOrCopyFilesDialog(props: Props) {>{t('core:copyEntriesButton')}</TsButton>- </DialogActions>+ </TsDialogActions></Dialog>);}diff --git a/src/renderer/components/dialogs/NewFileDialog.tsx b/src/renderer/components/dialogs/NewFileDialog.tsxindex 5ba21ad8e..b56834c74 100644--- a/src/renderer/components/dialogs/NewFileDialog.tsx+++ b/src/renderer/components/dialogs/NewFileDialog.tsx@@ -37,7 +37,7 @@ import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';import { useTargetPathContext } from '-/components/dialogs/hooks/useTargetPathContext';import TsButton from '-/components/TsButton';-import DialogActions from '@mui/material/DialogActions';+import TsDialogActions from '-/components/dialogs/components/TsDialogActions';import AppConfig from '-/AppConfig';import versionMeta from '-/version.json';import { TS } from '-/tagspaces.namespace';@@ -173,9 +173,7 @@ function NewFileDialog(props: Props) {<TargetPath /></DialogContent>{fileType && (- <DialogActions- style={fullScreen ? { padding: '10px 30px 30px 30px' } : {}}- >+ <TsDialogActions><TsButtondata-tid="backTID"onClick={() => {@@ -194,7 +192,7 @@ function NewFileDialog(props: Props) {>{t('core:ok')}</TsButton>- </DialogActions>+ </TsDialogActions>)}</Dialog>);diff --git a/src/renderer/components/dialogs/ResolveConflictDialog.tsx b/src/renderer/components/dialogs/ResolveConflictDialog.tsxindex abdab19ec..3ea5c9fbc 100644--- a/src/renderer/components/dialogs/ResolveConflictDialog.tsx+++ b/src/renderer/components/dialogs/ResolveConflictDialog.tsx@@ -18,7 +18,7 @@import React from 'react';import TsButton from '-/components/TsButton';-import DialogActions from '@mui/material/DialogActions';+import TsDialogActions from '-/components/dialogs/components/TsDialogActions';import DialogContent from '@mui/material/DialogContent';import DialogTitle from '@mui/material/DialogTitle';import TsTextField from '-/components/TsTextField';@@ -92,9 +92,7 @@ function ResolveConflictDialog(props: Props) {t('core:resolveConflictDesc'))}</DialogContent>- <DialogActions- style={fullScreen ? { padding: '10px 30px 30px 30px' } : {}}- >+ <TsDialogActions>{isSaveAs ? (<><TsButton@@ -150,7 +148,7 @@ function ResolveConflictDialog(props: Props) {</TsButton></>)}- </DialogActions>+ </TsDialogActions></Dialog>);}