mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-02-08 07:30:45 +03:00
0399d306c0
* stash * more * cli rename * Remove reference * Fix another reference * Fix scripts * Fix package name * Fix tsconfig
57 lines
1.7 KiB
TypeScript
57 lines
1.7 KiB
TypeScript
import React, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Button, Toolbar, Divider } from 'devui';
|
|
import { MdSave } from 'react-icons/md';
|
|
import ExportButton from './buttons/ExportButton';
|
|
import ImportButton from './buttons/ImportButton';
|
|
import PrintButton from './buttons/PrintButton';
|
|
import DispatcherButton from './buttons/DispatcherButton';
|
|
import SliderButton from './buttons/SliderButton';
|
|
import MonitorSelector from './MonitorSelector';
|
|
import { Options } from '../reducers/instances';
|
|
|
|
interface Props {
|
|
dispatcherIsOpen: boolean;
|
|
sliderIsOpen: boolean;
|
|
options: Options;
|
|
}
|
|
|
|
export default class BottomButtons extends Component<Props> {
|
|
static propTypes = {
|
|
dispatcherIsOpen: PropTypes.bool,
|
|
sliderIsOpen: PropTypes.bool,
|
|
options: PropTypes.object.isRequired,
|
|
};
|
|
|
|
shouldComponentUpdate(nextProps: Props) {
|
|
return (
|
|
nextProps.dispatcherIsOpen !== this.props.dispatcherIsOpen ||
|
|
nextProps.sliderIsOpen !== this.props.sliderIsOpen ||
|
|
nextProps.options !== this.props.options
|
|
);
|
|
}
|
|
|
|
render() {
|
|
const features = this.props.options.features;
|
|
return (
|
|
<Toolbar borderPosition="top">
|
|
{features.export && (
|
|
<Button title="Save a report" tooltipPosition="top-right">
|
|
<MdSave />
|
|
</Button>
|
|
)}
|
|
{features.export && <ExportButton />}
|
|
{features.import && <ImportButton />}
|
|
<PrintButton />
|
|
<Divider />
|
|
<MonitorSelector />
|
|
<Divider />
|
|
{features.jump && <SliderButton isOpen={this.props.sliderIsOpen} />}
|
|
{features.dispatch && (
|
|
<DispatcherButton dispatcherIsOpen={this.props.dispatcherIsOpen} />
|
|
)}
|
|
</Toolbar>
|
|
);
|
|
}
|
|
}
|