TagSpaces is an offline, open source, document manager with tagging support
chore: refactoring create file dialog
Ilian Sapundshiev613b622342e4
diff --git a/src/renderer/components/dialogs/AboutDialog.tsx b/src/renderer/components/dialogs/AboutDialog.tsxindex 343d646ff..60bbb9ce4 100644--- a/src/renderer/components/dialogs/AboutDialog.tsx+++ b/src/renderer/components/dialogs/AboutDialog.tsx@@ -244,7 +244,11 @@ function AboutDialog(props: Props) {{versionInfo}</TsButton></span>- <TsButton data-tid="closeAboutDialog" onClick={onClose}>+ <TsButton+ data-tid="closeAboutDialog"+ variant="contained"+ onClick={onClose}+ >{t('core:ok')}</TsButton></TsDialogActions>diff --git a/src/renderer/components/dialogs/components/CreateFile.tsx b/src/renderer/components/dialogs/components/CreateFile.tsxindex aaa0c059b..1797eaec4 100644--- a/src/renderer/components/dialogs/components/CreateFile.tsx+++ b/src/renderer/components/dialogs/components/CreateFile.tsx@@ -16,17 +16,15 @@**/-import Tooltip from '-/components/Tooltip';+import AppConfig from '-/AppConfig';+import TsButton from '-/components/TsButton';import TsTextField from '-/components/TsTextField';import { useTargetPathContext } from '-/components/dialogs/hooks/useTargetPathContext';import { fileNameValidation } from '-/services/utils-io';import { TS } from '-/tagspaces.namespace';-import { FormControl } from '@mui/material';-import Button from '@mui/material/Button';-import ButtonGroup from '@mui/material/ButtonGroup';+import { Box, FormControl } from '@mui/material';import FormHelperText from '@mui/material/FormHelperText';import Grid from '@mui/material/Grid2';-import Typography from '@mui/material/Typography';import React, { useEffect, useReducer, useState } from 'react';import { useTranslation } from 'react-i18next';@@ -145,46 +143,39 @@ function CreateFile(props: Props) {/></FormControl>) : (- <ButtonGroup style={{ margin: '0 auto' }}>- <Button+ <Box style={{ margin: '0 auto' }}>+ <TsButton+ tooltip={t('createMarkdownTitle')}onClick={() => createFile('md')}data-tid={tid('createMarkdownButton')}disabled={noSuitableLocation}+ style={{+ marginRight: AppConfig.defaultSpaceBetweenButtons,+ fontWeight: 'bold',+ }}>- <Tooltip title={t('createMarkdownTitle')}>- <Typography- variant="button"- style={{ fontWeight: 'bold' }}- display="block"- gutterBottom- >- {t('createMarkdown')}- </Typography>- </Tooltip>- </Button>- <Button+ {t('createMarkdown')}+ </TsButton>+ <TsButton+ tooltip={t('createNoteTitle')}onClick={() => createFile('html')}data-tid={tid('createRichTextFileButton')}disabled={noSuitableLocation}+ style={{+ marginRight: AppConfig.defaultSpaceBetweenButtons,+ }}>- <Tooltip title={t('createNoteTitle')}>- <Typography variant="button" display="block" gutterBottom>- {t('createRichTextFile')}- </Typography>- </Tooltip>- </Button>- <Button+ {t('createRichTextFile')}+ </TsButton>+ <TsButton+ tooltip={t('createTextFileTitle')}onClick={() => createFile('txt')}data-tid={tid('createTextFileButton')}disabled={noSuitableLocation}>- <Tooltip title={t('createTextFileTitle')}>- <Typography variant="button" display="block" gutterBottom>- {t('createTextFile')}- </Typography>- </Tooltip>- </Button>- </ButtonGroup>+ {t('createTextFile')}+ </TsButton>+ </Box>)}</Grid>);