Skip to content

Commit

Permalink
Make icons change layout too [#1911]
Browse files Browse the repository at this point in the history
This leads to a slight styling change, but is probably Close Enough™
  • Loading branch information
genehack committed Dec 6, 2024
1 parent f9d7ec7 commit 6c2bfd6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/controls/panel-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { SidebarButton } from "./styles";
const ButtonText = styled.span`
margin: 5px;
position: relative;
top: -1px;
left: 4px;
top: -6px;
`;

const PanelsFullIcon = withTheme(icons.PanelsFull);
Expand All @@ -27,28 +28,27 @@ 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"}
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 6c2bfd6

Please sign in to comment.