Skip to content

Commit

Permalink
WindowTopMenuButton renders configured ctrlBtnSelected from props on …
Browse files Browse the repository at this point in the history
…open windows if configured
  • Loading branch information
barmintor committed Oct 27, 2023
1 parent f75e516 commit 1ae96f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/WindowTopMenuButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class WindowTopMenuButton extends Component {
*/
render() {
const {
t, windowId,
classes, t, windowId,
} = this.props;
const { open, anchorEl } = this.state;
const menuId = `window-menu_${windowId}`;
Expand All @@ -59,6 +59,7 @@ export class WindowTopMenuButton extends Component {
aria-haspopup="true"
aria-label={t('windowMenu')}
aria-owns={open ? menuId : undefined}
className={open ? classes.ctrlBtnSelected : undefined}
sx={{
margin: 1,
...(open && {
Expand All @@ -82,10 +83,12 @@ export class WindowTopMenuButton extends Component {
}

WindowTopMenuButton.propTypes = {
classes: PropTypes.objectOf(PropTypes.string),
t: PropTypes.func,
windowId: PropTypes.string.isRequired,
};

WindowTopMenuButton.defaultProps = {
classes: {},
t: key => key,
};

0 comments on commit 1ae96f5

Please sign in to comment.