Skip to content

Commit

Permalink
Make icons change layout too [#1911]
Browse files Browse the repository at this point in the history
  • Loading branch information
genehack committed Dec 5, 2024
1 parent f9d7ec7 commit 400d5ee
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/components/controls/panel-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { analyticsControlsEvent } from "../../util/googleAnalytics";
import { SidebarButton } from "./styles";

const ButtonText = styled.span`
margin: 5px;
position: relative;
top: -1px;
margin-left: 10px;
padding-bottom: 15px;
vertical-align: middle;
`;

const PanelsFullIcon = withTheme(icons.PanelsFull);
Expand All @@ -26,29 +26,28 @@ class PanelLayouts extends React.Component {
const { t } = this.props;

return (
<div style={{marginTop: 0, marginBottom: 10}}>
<PanelsFullIcon width={22} selected={this.props.panelLayout === "full"}/>
<div style={{marginTop: 0, marginBottom: 10, marginLeft: -5}}>
<SidebarButton
selected={this.props.panelLayout === "full"}
onClick={() => {
analyticsControlsEvent("change-layout-full");
this.props.dispatch({ type: CHANGE_PANEL_LAYOUT, data: "full" });
}}
>
<PanelsFullIcon width={22} selected={this.props.panelLayout === "full"}/>
<ButtonText>{t("sidebar:full")}</ButtonText>
</SidebarButton>

<PanelsGridIcon width={22} selected={this.props.panelLayout === "grid"}/>
<SidebarButton
selected={this.props.panelLayout === "grid"}
onClick={() => {
analyticsControlsEvent("change-layout-grid");
this.props.dispatch({ type: CHANGE_PANEL_LAYOUT, data: "grid" });
}}
>
<PanelsGridIcon width={22} selected={this.props.panelLayout === "grid"}/>
<ButtonText>{t("sidebar:grid")}</ButtonText>
</SidebarButton>

</div>
);
}
Expand Down

0 comments on commit 400d5ee

Please sign in to comment.