diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index 7758efe5509..2788dad4d4b 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -556,11 +556,10 @@ export class QueryEditorRow extends PureComponent e.refId === query.refId); // Note: We can't use hooks in class components, so we use static styles - const focusedRowStyle = isFocused ? getFocusedRowStyle() : undefined; - const focusedWrapperStyle = isFocused ? getFocusedWrapperStyle() : undefined; - const rowClasses = classNames('query-editor-row', focusedRowStyle, { + const rowClasses = classNames('query-editor-row', { 'query-editor-row--disabled': isHidden, 'gf-form-disabled': isHidden, + [focusedRowStyle]: isFocused, }); if (!datasource) { @@ -607,10 +606,10 @@ export class QueryEditorRow extends PureComponent {isFocused && hiddenQueriesCount > 0 && ( -
+
@@ -746,26 +745,23 @@ function AdaptiveTelemetryQueryActions({ query }: { query: DataQuery }) { // Static styles for focused state - used in class component // Transitions are handled in parent components where we have theme access -const getFocusedWrapperStyle = () => - css({ - display: 'flex', - flexDirection: 'column', - height: '100%', - flex: '1 1 auto', - }); +const focusedWrapperStyle = css({ + display: 'flex', + flexDirection: 'column', + height: '100%', + flex: '1 1 auto', +}); -const getFocusedRowStyle = () => - css({ - flex: '1 1 100%', - height: '100%', - width: '100%', - display: 'flex', - flexDirection: 'column', - // Remove margins when focused to maximize space - marginBottom: 0, - }); +const focusedRowStyle = css({ + flex: '1 1 100%', + height: '100%', + width: '100%', + display: 'flex', + flexDirection: 'column', + // Remove margins when focused to maximize space + marginBottom: 0, +}); -const getFocusedBannerStyle = () => - css({ - marginBottom: '10px', - }); +const focusedBannerStyle = css({ + marginBottom: '10px', +});