Skip to content

Commit

Permalink
fix(topbar): do not use ToggleButton in drawer (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornwedell authored Mar 22, 2024
1 parent c243ebb commit 7e4ba4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions components/topbar/src/application-drawer.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export const useApplicationDrawrStyles = makeStyles({
justifyContent: "flex-start",
paddingLeft: tokens.spacingHorizontalSNudge,
},
contentButtonChecked: {
color: tokens.colorNeutralForeground2Selected,
backgroundColor: tokens.colorSubtleBackgroundSelected,
},
linkWrapper: {
display: "flex",
justifyContent: "flex-end",
Expand Down
11 changes: 6 additions & 5 deletions components/topbar/src/application-drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
DrawerHeader,
Link,
mergeClasses,
ToggleButton,
tokens,
} from "@fluentui/react-components";
import { useApplicationDrawrStyles as useApplicationDrawerStyles } from "./application-drawer.styles";
Expand Down Expand Up @@ -154,10 +153,12 @@ const SingleApplication = ({
const styles = useApplicationDrawerStyles();

return (
<ToggleButton
checked={application.id === currentSelectionId}
<Button
data-testid={`application-drawer-item-${application.id}`}
className={styles.contentButton}
className={mergeClasses(
styles.contentButton,
application.id === currentSelectionId && styles.contentButtonChecked
)}
appearance="subtle"
icon={iconConverter(
application.icon,
Expand All @@ -169,7 +170,7 @@ const SingleApplication = ({
<Body1 className={styles.applicationButton}>
{application.label}
</Body1>
</ToggleButton>
</Button>
);
};

Expand Down

0 comments on commit 7e4ba4f

Please sign in to comment.