diff --git a/webpack/assets/javascripts/react_app/components/Editor/components/EditorSettings.js b/webpack/assets/javascripts/react_app/components/Editor/components/EditorSettings.js
index 6d741b37e2..b332a4eeb3 100644
--- a/webpack/assets/javascripts/react_app/components/Editor/components/EditorSettings.js
+++ b/webpack/assets/javascripts/react_app/components/Editor/components/EditorSettings.js
@@ -1,16 +1,76 @@
-import React from 'react';
+import React, { useState } from 'react';
import PropTypes from 'prop-types';
-import { Dropdown, MenuItem, Button } from 'patternfly-react';
import { CogIcon } from '@patternfly/react-icons';
import {
+ Button,
+ Checkbox,
Icon,
+ MenuToggle,
Popover,
PopoverPosition,
+ Select,
+ SelectList,
+ SelectOption,
Tooltip,
TooltipPosition,
} from '@patternfly/react-core';
import { translate as __ } from '../../../common/I18n';
+const SettingsSelect = ({ id, disabled, options, selected, onSelect }) => {
+ const [isOpen, setIsOpen] = useState(false);
+
+ return (
+
+
+
+ );
+};
+
+SettingsSelect.propTypes = {
+ id: PropTypes.string.isRequired,
+ disabled: PropTypes.bool,
+ options: PropTypes.arrayOf(PropTypes.string).isRequired,
+ selected: PropTypes.string.isRequired,
+ onSelect: PropTypes.func.isRequired,
+};
+
+SettingsSelect.defaultProps = {
+ disabled: false,
+};
+
const EditorSettings = ({
selectedView,
changeSetting,
@@ -34,94 +94,74 @@ const EditorSettings = ({
{__('Syntax')}
-
- {mode}
-
- {modes.map((aceMode, i) => (
-
- ))}
-
-
+
changeSetting({ mode: selection })}
+ />
{__('Keybind')}
-
- {keyBinding}
-
- {keyBindings.map((keyBind, i) => (
-
- ))}
-
-
+ disabled={selectedView === 'preview'}
+ options={keyBindings}
+ selected={keyBinding}
+ onSelect={selection => changeSetting({ keyBinding: selection })}
+ />
{__('Theme')}
-
- {theme}
-
- {themes.map((themeKey, i) => (
-
- ))}
-
-
+
changeSetting({ theme: selection })}
+ />
{__('Autocompletion')}
-
-
- changeSetting({ autocompletion: !autocompletion })
- }
- />
-
+
+ changeSetting({ autocompletion: !autocompletion })
+ }
+ />
{__('Live Autocompletion')}
-
-
- changeSetting({ liveAutocompletion: !liveAutocompletion })
- }
- />
-
+
+ changeSetting({ liveAutocompletion: !liveAutocompletion })
+ }
+ />
}
triggerRef={() => document.getElementById('cog-btn')}
/>
-