diff --git a/src/browser/modules/Editor/Editor.jsx b/src/browser/modules/Editor/Editor.jsx index 903ce582f56..a1b2089ff16 100644 --- a/src/browser/modules/Editor/Editor.jsx +++ b/src/browser/modules/Editor/Editor.jsx @@ -461,12 +461,6 @@ export class Editor extends Component { const editorIsEmpty = this.getEditorValue().length > 0 const buttons = [ - { - onClick: () => this.setEditorValue(''), - icon: eraser2, - title: 'Clear', - disabled: editorIsEmpty - }, { onClick: this.state.contentId ? () => @@ -486,7 +480,8 @@ export class Editor extends Component { onClick: this.execCurrent, icon: controlsPlay, title: 'Play', - disabled: editorIsEmpty + disabled: editorIsEmpty, + iconColor: this.props.theme.linkHover } ] @@ -496,7 +491,7 @@ export class Editor extends Component { return (
- +
: - const expandCollapseIcon = isCardSize ? : - const buttons = [ { onClick: toggleFullscreen, disabled: false, - title: 'Fullscreen', - Icon: fullscreenIcon + title: isFullscreen ? 'Close fullscreen' : 'Fullscreen', + icon: isFullscreen ? : }, { onClick: toggleCardView, disabled: false, title: isCardSize ? 'Collapse' : 'Cardview', - Icon: expandCollapseIcon + icon: isCardSize ? : }, { onClick: clearEditor, disabled: false, title: 'Clear', - Icon: CloseIcon + icon: } ] @@ -84,21 +81,11 @@ export function EditorFrame({ bus }: EditorFrameProps) { - - - - - - - - - + {buttons.map(({ onClick, icon, title }) => ( + + {icon} + + ))} { diff --git a/src/browser/modules/Editor/styled.tsx b/src/browser/modules/Editor/styled.tsx index 5b5921571a6..d460401832c 100644 --- a/src/browser/modules/Editor/styled.tsx +++ b/src/browser/modules/Editor/styled.tsx @@ -34,30 +34,12 @@ export const BaseBar = styled.div` border-radius: 2px; // minmax(0, 1fr) prevents the editor from growing the text field grid-template-columns: minmax(0, 1fr) auto; - grid-template-areas: ${(props): string => { - if (props.expanded || props.card) { - return "'header' 'editor'" - } - return "'editor header'" - }}; + grid-template-areas: 'editor header'; ` export const Header = styled.div` grid-area: header; border-radius: 4px 4px 0 0; - ${(props): string => { - if (props.expanded) { - return `background-color: #4d4a57; - border-radius: 0; - ` - } - if (props.card) { - return `background-color: #4d4a57; - transition-duration: 0.3s;` - } - return '' - }} - display: flex; justify-content: flex-end; padding-top: 7px @@ -100,7 +82,7 @@ const BaseEditorWrapper = styled.div` return '0' }}; - ${(props): string => (props.expanded ? '' : 'transition-duration: 0.1s;')} + transition-duration: 0.1s; .CodeMirror { color: ${(props): string => props.theme.editorCommandColor}; @@ -124,7 +106,6 @@ export const FrameHeader = styled.div` display: flex; flex-direction: column; margin-left: 7px; - margin-right: 7px; height: 33px; `