Skip to content

Commit

Permalink
Merge pull request #782 from trash-lobster/next
Browse files Browse the repository at this point in the history
Close sidebar when clicking on bottom icon buttons when in mobile
  • Loading branch information
sphinxrave authored Aug 31, 2024
2 parents d7a137d + 5839ef2 commit e12eaa0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/react/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function Sidebar() {

const floating = useAtomValue(isSidebarFloatingAtom);
const [open, setOpen] = useAtom(isSidebarOpenAtom);
const isMobile = useAtomValue(isMobileAtom);
const toggle = useSetAtom(toggleSidebarAtom);
const fs = useAtomValue(sidebarShouldBeFullscreenAtom);

Expand Down Expand Up @@ -147,7 +148,13 @@ export function Sidebar() {
</Tooltip>
<Tooltip delayDuration={0}>
<TooltipTrigger asChild>
<Button variant="ghost" className="p-2" size="icon-lg" asChild>
<Button
variant="ghost"
className="p-2"
size="icon-lg"
asChild
onClick={isMobile ? toggle : undefined}
>
<Link to="/settings">
<span className="i-heroicons:cog-6-tooth" />
</Link>
Expand All @@ -157,7 +164,13 @@ export function Sidebar() {
</Tooltip>{" "}
<Tooltip delayDuration={0}>
<TooltipTrigger asChild>
<Button variant="ghost" className="p-2" size="icon-lg" asChild>
<Button
variant="ghost"
className="p-2"
size="icon-lg"
asChild
onClick={isMobile ? toggle : undefined}
>
<Link to="/about">
<span className="i-heroicons:question-mark-circle" />
</Link>
Expand Down

0 comments on commit e12eaa0

Please sign in to comment.