mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 04:34:23 -06:00
f5e351af8b
* button to bring a up a duplicate explore area to compare * side by side rendering of two explore components * right component has close button * left component has page title
34 lines
843 B
TypeScript
34 lines
843 B
TypeScript
import React, { PureComponent } from 'react';
|
|
|
|
import Explore from './Explore';
|
|
|
|
export default class Wrapper extends PureComponent<any, any> {
|
|
state = {
|
|
initialState: null,
|
|
split: false,
|
|
};
|
|
|
|
handleChangeSplit = (split, initialState) => {
|
|
this.setState({ split, initialState });
|
|
};
|
|
|
|
render() {
|
|
// State overrides for props from first Explore
|
|
const { initialState, split } = this.state;
|
|
return (
|
|
<div className="explore-wrapper">
|
|
<Explore {...this.props} position="left" onChangeSplit={this.handleChangeSplit} split={split} />
|
|
{split ? (
|
|
<Explore
|
|
{...this.props}
|
|
initialState={initialState}
|
|
onChangeSplit={this.handleChangeSplit}
|
|
position="right"
|
|
split={split}
|
|
/>
|
|
) : null}
|
|
</div>
|
|
);
|
|
}
|
|
}
|