Files
dev-tools/components/ProjectManagerToolbar.js
Exponent GitHub Bot e3f6a67ce5 Initial commit
fbshipit-source-id: 04f171ad7fc354fbc437cd07abdee445323d9a0f
2018-07-17 18:51:11 +00:00

51 lines
1.6 KiB
JavaScript

import styled, { css } from 'react-emotion';
import * as React from 'react';
import * as SVG from 'app/common/svg';
import SmallButton from 'app/components/SmallButton';
import SmallSquareButton from 'app/components/SmallSquareButton';
const STYLES_TOOLBAR = css`
display: flex;
align-items: center;
justify-content: flex-end;
`;
export default class ProjectManagerToolbar extends React.Component {
render() {
return (
<div className={STYLES_TOOLBAR}>
{this.props.count > 1 && (
<SmallSquareButton
onClick={() => this.props.onChangeSectionCount(1)}
isActive={this.props.renderableCount === 1 && !this.props.isPublishing}>
<SVG.One size="32px" />
</SmallSquareButton>
)}
{this.props.count > 1 && (
<SmallSquareButton
onClick={() => this.props.onChangeSectionCount(2)}
isActive={this.props.renderableCount === 2 && !this.props.isPublishing}>
<SVG.Columns size="32px" />
</SmallSquareButton>
)}
{this.props.count > 2 && (
<SmallSquareButton
onClick={() => this.props.onChangeSectionCount(3)}
isActive={this.props.renderableCount === 3 && !this.props.isPublishing}>
<SVG.Three size="32px" />
</SmallSquareButton>
)}
{this.props.count > 3 && (
<SmallSquareButton
onClick={() => this.props.onChangeSectionCount(4)}
isActive={this.props.renderableCount === 4 && !this.props.isPublishing}>
<SVG.Grid size="32px" />
</SmallSquareButton>
)}
</div>
);
}
}