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 Nov 20, 2024
1 parent f9d7ec7 commit d4688c0
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/components/controls/panel-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,31 @@ class PanelLayouts extends React.Component {

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

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

</div>
);
Expand Down

0 comments on commit d4688c0

Please sign in to comment.