@lonli-lokli/react-mosaic-component
Version:
A React Tiling Window Manager
37 lines (36 loc) • 1.01 kB
JavaScript
// libs/react-mosaic-component/src/lib/buttons/TabExpandButton.tsx
import classNames from "classnames";
import React from "react";
import { MosaicContext } from "../contextTypes.mjs";
import { OptionalBlueprint } from "../util/OptionalBlueprint.mjs";
import { DefaultToolbarButton } from "./MosaicButton.mjs";
var TabExpandButton = class extends React.PureComponent {
static contextType = MosaicContext;
render() {
return /* @__PURE__ */ React.createElement(
DefaultToolbarButton,
{
title: "Expand Tab Group",
className: classNames(
"expand-button",
OptionalBlueprint.getIconClass(
this.context.blueprintNamespace,
"MAXIMIZE"
)
),
onClick: this.expand
}
);
}
expand = () => {
const { mosaicActions } = this.context;
const { path } = this.props;
mosaicActions.expand(path);
if (this.props.onClick) {
this.props.onClick();
}
};
};
export {
TabExpandButton
};