Skip to content

Commit

Permalink
Add quit button to menu (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffvli committed Sep 23, 2023
1 parent 47dc83f commit f0e518d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/renderer/features/titlebar/components/app-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
RiServerLine,
RiGithubLine,
RiExternalLinkLine,
RiCloseCircleLine,
} from 'react-icons/ri';
import { useNavigate } from 'react-router';
import { Link } from 'react-router-dom';
Expand Down Expand Up @@ -89,7 +90,9 @@ export const AppMenu = () => {
setSideBar({ collapsed: false });
};

const showBrowserDevToolsButton = isElectron();
const handleQuit = () => {
browser?.exit();
};

return (
<>
Expand Down Expand Up @@ -174,7 +177,7 @@ export const AppMenu = () => {
>
Version {packageJson.version}
</DropdownMenu.Item>
{showBrowserDevToolsButton && (
{isElectron() && (
<>
<DropdownMenu.Divider />
<DropdownMenu.Item
Expand All @@ -183,6 +186,12 @@ export const AppMenu = () => {
>
Open browser devtools
</DropdownMenu.Item>
<DropdownMenu.Item
icon={<RiCloseCircleLine />}
onClick={handleQuit}
>
Quit
</DropdownMenu.Item>
</>
)}
</>
Expand Down

0 comments on commit f0e518d

Please sign in to comment.