mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
NewPanelEditor: Make variables wrap and small layout refactor (#23862)
* NewPanelEditor: Make variables wrap and small layout refactor * review fix
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react';
|
||||
import { renderOrCallToRender, Icon, stylesFactory, useTheme } from '@grafana/ui';
|
||||
import { renderOrCallToRender, Icon, stylesFactory, useTheme, HorizontalGroup } from '@grafana/ui';
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
import { css } from 'emotion';
|
||||
import { useUpdateEffect } from 'react-use';
|
||||
@@ -54,17 +54,19 @@ export const QueryOperationRow: React.FC<QueryOperationRowProps> = ({
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<div className={styles.header}>
|
||||
<div
|
||||
className={styles.titleWrapper}
|
||||
onClick={() => {
|
||||
setIsContentVisible(!isContentVisible);
|
||||
}}
|
||||
aria-label="Query operation row title"
|
||||
>
|
||||
<Icon name={isContentVisible ? 'angle-down' : 'angle-right'} className={styles.collapseIcon} />
|
||||
{title && <span className={styles.title}>{titleElement}</span>}
|
||||
</div>
|
||||
{actions && actionsElement}
|
||||
<HorizontalGroup justify="space-between">
|
||||
<div
|
||||
className={styles.titleWrapper}
|
||||
onClick={() => {
|
||||
setIsContentVisible(!isContentVisible);
|
||||
}}
|
||||
aria-label="Query operation row title"
|
||||
>
|
||||
<Icon name={isContentVisible ? 'angle-down' : 'angle-right'} className={styles.collapseIcon} />
|
||||
{title && <span className={styles.title}>{titleElement}</span>}
|
||||
</div>
|
||||
{actions && actionsElement}
|
||||
</HorizontalGroup>
|
||||
</div>
|
||||
{isContentVisible && <div className={styles.content}>{children}</div>}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user