Skip to content

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

TSN162 - refactor dialogs

Mladen Sapundshiev990ed45cc1db
diff --git a/app/components/dialogs/AddRemoveTagsDialog.js b/app/components/dialogs/AddRemoveTagsDialog.js
index 2b96bdfe4..b30789091 100644
--- a/app/components/dialogs/AddRemoveTagsDialog.js
+++ b/app/components/dialogs/AddRemoveTagsDialog.js
@@ -51,7 +51,7 @@ type State = {
isConfirmDialogOpened?: boolean
};
-class AddRemoveTagsDialog extends Component<Props, State> {
+class AddRemoveTagsDialog extends React.Component<Props, State> {
state = {
inputError: false,
disableConfirmButton: true,
diff --git a/app/components/dialogs/ColorPickerDialog.js b/app/components/dialogs/ColorPickerDialog.js
index ba3fd53dd..bf79c51e6 100644
--- a/app/components/dialogs/ColorPickerDialog.js
+++ b/app/components/dialogs/ColorPickerDialog.js
@@ -26,7 +26,7 @@ import {
} from 'material-ui/Dialog';
import { withStyles } from 'material-ui/styles';
import { SketchPicker } from 'react-color';
-import GenericDialog from './GenericDialog';
+import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
import i18n from '../../services/i18n';
const presetColors = ['#ffffff', '#000000', '#ac725e', '#d06b64', '#f83a22', '#fa573c',
@@ -52,7 +52,7 @@ const styles = {
}
};
-class ColorPickerDialog extends GenericDialog<Props, State> {
+class ColorPickerDialog extends React.Component<Props, State> {
state = {
color: ''
};
@@ -114,6 +114,19 @@ class ColorPickerDialog extends GenericDialog<Props, State> {
</Button>
</DialogActions>
);
+
+ render() {
+ return (
+ <GenericDialog
+ open={this.props.open}
+ onClose={this.props.onClose}
+ onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
+ renderTitle={this.renderTitle}
+ renderContent={this.renderContent}
+ renderActions={this.renderActions}
+ />
+ );
+ }
}
export default withStyles(styles)(ColorPickerDialog);
diff --git a/app/components/dialogs/CreateLocationDialog.js b/app/components/dialogs/CreateLocationDialog.js
index 1039dd28a..3cd0460fd 100644
--- a/app/components/dialogs/CreateLocationDialog.js
+++ b/app/components/dialogs/CreateLocationDialog.js
@@ -56,7 +56,7 @@ type State = {
isDefault: boolean
};
-class CreateLocationDialog extends GenericDialog<Props, State> {
+class CreateLocationDialog extends React.Component<Props, State> {
state = {
errorTextPath: false,
errorTextName: false,
diff --git a/app/components/dialogs/DateCalendarDialog.js b/app/components/dialogs/DateCalendarDialog.js
index a666c6af1..36f8a5b82 100644
--- a/app/components/dialogs/DateCalendarDialog.js
+++ b/app/components/dialogs/DateCalendarDialog.js
@@ -114,7 +114,7 @@ if (cn) {
const defaultCalendarValue = now.clone();
defaultCalendarValue.add(-1, 'month');
-class EditEntryTagDialog extends GenericDialog<Props, State> {
+class EditEntryTagDialog extends React.Component<Props, State> {
state = {
disableConfirmButton: true,
errorTag: true,