Skip to content

Remove unused editor options code #1872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions client/modules/IDE/actions/ide.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,6 @@ export function closeShareModal() {
};
}

export function showEditorOptions() {
return {
type: ActionTypes.SHOW_EDITOR_OPTIONS
};
}

export function closeEditorOptions() {
return {
type: ActionTypes.CLOSE_EDITOR_OPTIONS
};
}

export function showKeyboardShortcutModal() {
return {
type: ActionTypes.SHOW_KEYBOARD_SHORTCUT_MODAL
Expand Down
15 changes: 1 addition & 14 deletions client/modules/IDE/components/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,20 +362,10 @@ class Editor extends React.Component {
});
}

toggleEditorOptions() {
if (this.props.editorOptionsVisible) {
this.props.closeEditorOptions();
} else {
this.optionsButton.focus();
this.props.showEditorOptions();
}
}

render() {
const editorSectionClass = classNames({
editor: true,
'sidebar--contracted': !this.props.isExpanded,
'editor--options': this.props.editorOptionsVisible
'sidebar--contracted': !this.props.isExpanded
});

const editorHolderClass = classNames({
Expand Down Expand Up @@ -462,9 +452,6 @@ Editor.propTypes = {
fileType: PropTypes.string.isRequired,
url: PropTypes.string
}).isRequired,
editorOptionsVisible: PropTypes.bool.isRequired,
showEditorOptions: PropTypes.func.isRequired,
closeEditorOptions: PropTypes.func.isRequired,
setUnsavedChanges: PropTypes.func.isRequired,
startRefreshSketch: PropTypes.func.isRequired,
autorefresh: PropTypes.bool.isRequired,
Expand Down
5 changes: 0 additions & 5 deletions client/modules/IDE/reducers/ide.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const initialState = {
shareModalProjectId: 'abcd',
shareModalProjectName: 'My Cute Sketch',
shareModalProjectUsername: 'p5_user',
editorOptionsVisible: false,
keyboardShortcutVisible: false,
unsavedChanges: false,
infiniteLoop: false,
Expand Down Expand Up @@ -82,10 +81,6 @@ const ide = (state = initialState, action) => {
});
case ActionTypes.CLOSE_SHARE_MODAL:
return Object.assign({}, state, { shareModalVisible: false });
case ActionTypes.SHOW_EDITOR_OPTIONS:
return Object.assign({}, state, { editorOptionsVisible: true });
case ActionTypes.CLOSE_EDITOR_OPTIONS:
return Object.assign({}, state, { editorOptionsVisible: false });
case ActionTypes.SHOW_KEYBOARD_SHORTCUT_MODAL:
return Object.assign({}, state, { keyboardShortcutVisible: true });
case ActionTypes.CLOSE_KEYBOARD_SHORTCUT_MODAL:
Expand Down
35 changes: 0 additions & 35 deletions client/styles/components/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -372,41 +372,6 @@ pre.CodeMirror-line {
height: #{29 / $base-font-size}rem;
}

.editor__options-button {
@include icon();
position: absolute;
top: #{10 / $base-font-size}rem;
right: #{2 / $base-font-size}rem;
z-index: 1;
}


.editor__options {
display: none;
@extend %modal;
position: absolute;
right: #{0 / $base-font-size}rem;
padding: #{8 / $base-font-size}rem #{20 / $base-font-size}rem;
font-size: #{12 / $base-font-size}rem;
@include themify() {
background-color: getThemifyVariable('modal-background-color');
box-shadow: 0 0 18px getThemifyVariable('shadow-color');
}
.editor--options & {
display: block;
}
}

.editor__options li {
padding: #{4 / $base-font-size}rem 0;
}

.editor__options a {
@include themify() {
color: getThemifyVariable('secondary-text-color');
}
}

.editor__file-name {
@include themify() {
color: getThemifyVariable('primary-text-color');
Expand Down
1 change: 0 additions & 1 deletion client/testData/testReduxStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const initialTestState = {
shareModalProjectId: 'abcd',
shareModalProjectName: 'My Cute Sketch',
shareModalProjectUsername: 'p5_user',
editorOptionsVisible: false,
keyboardShortcutVisible: false,
unsavedChanges: false,
infiniteLoop: false,
Expand Down