Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make icons change layout too [#1911] #1912

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading