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 261b86a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

* Bugfix: Clicking on the icons for FULL and GRID layout now changes the layout, just like clicking on the text ([#1911](https://github.com/nextstrain/auspice/issues/1911))

## version 2.61.2 - 2024/11/19


Expand Down
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 261b86a

Please sign in to comment.