diff --git a/src/ui/ColumnsSelect/Dialog/ColumnsSelectDialog.js b/src/ui/ColumnsSelect/Dialog/ColumnsSelectDialog.js index 3e25a36de..889d10a58 100644 --- a/src/ui/ColumnsSelect/Dialog/ColumnsSelectDialog.js +++ b/src/ui/ColumnsSelect/Dialog/ColumnsSelectDialog.js @@ -1,31 +1,29 @@ -import React from 'react' -import { withTranslation } from 'react-i18next' +import React, { memo } from 'react' +import PropTypes from 'prop-types' +import { useTranslation } from 'react-i18next' import { Button, Classes, Dialog, Intent, } from '@blueprintjs/core' import Icon from 'icons' -import { propTypes, defaultProps } from './ColumnsSelectDialog.props' - -const ColumnsSelectDialog = (props) => { - const { - children, - isOpen, - hasChanges, - onCancel, - onApply, - t, - } = props +const ColumnsSelectDialog = ({ + isOpen, + onApply, + children, + onCancel, + hasChanges, +}) => { + const { t } = useTranslation() return ( } - isCloseButtonShown={false} isOpen={isOpen} onClose={onCancel} + isCloseButtonShown={false} + icon={} title={t('columnsselect.title')} + className='columns-select-dialog' >
{children} @@ -38,9 +36,9 @@ const ColumnsSelectDialog = (props) => { {t('columnsselect.cancel')} @@ -50,7 +48,12 @@ const ColumnsSelectDialog = (props) => { ) } -ColumnsSelectDialog.propTypes = propTypes -ColumnsSelectDialog.defaultProps = defaultProps +ColumnsSelectDialog.propTypes = { + children: PropTypes.element.isRequired, + isOpen: PropTypes.bool.isRequired, + hasChanges: PropTypes.bool.isRequired, + onCancel: PropTypes.func.isRequired, + onApply: PropTypes.func.isRequired, +} -export default withTranslation('translations')(ColumnsSelectDialog) +export default memo(ColumnsSelectDialog) diff --git a/src/ui/ColumnsSelect/Dialog/ColumnsSelectDialog.props.js b/src/ui/ColumnsSelect/Dialog/ColumnsSelectDialog.props.js deleted file mode 100644 index 0276e3e4d..000000000 --- a/src/ui/ColumnsSelect/Dialog/ColumnsSelectDialog.props.js +++ /dev/null @@ -1,12 +0,0 @@ -import PropTypes from 'prop-types' - -export const propTypes = { - children: PropTypes.element.isRequired, - isOpen: PropTypes.bool.isRequired, - hasChanges: PropTypes.bool.isRequired, - onCancel: PropTypes.func.isRequired, - onApply: PropTypes.func.isRequired, - t: PropTypes.func.isRequired, -} - -export const defaultProps = {} diff --git a/src/ui/ColumnsSelect/Dialog/index.js b/src/ui/ColumnsSelect/Dialog/index.js index 811d07ec9..da44dd829 100644 --- a/src/ui/ColumnsSelect/Dialog/index.js +++ b/src/ui/ColumnsSelect/Dialog/index.js @@ -1,3 +1 @@ -import ColumnsSelectDialog from './ColumnsSelectDialog' - -export default ColumnsSelectDialog +export { default } from './ColumnsSelectDialog'