diff --git a/app/renderer/components/MoreOptionsSidebarMenu.tsx b/app/renderer/components/MoreOptionsSidebarMenu.tsx index fb89279..22ae7bc 100644 --- a/app/renderer/components/MoreOptionsSidebarMenu.tsx +++ b/app/renderer/components/MoreOptionsSidebarMenu.tsx @@ -34,7 +34,9 @@ const MoreOptionsSidebarMenu = () => { const previewEnabled = useStore((state) => state.previewEnabled); const setPreviewEnabled = useStore((state) => state.setPreviewEnabled); const setNewBookModalOpen = useStore((state) => state.setNewBookModalOpen); - const setGenerateBookModalOpen = useStore((state) => state.setGenerateBookModalOpen); + const setGenerateBookModalOpen = useStore( + (state) => state.setGenerateBookModalOpen + ); const [menuPosition, setMenuPosition] = useState({ x: 0, y: 0 }); const getMenuPosition = (): Position => { @@ -121,7 +123,7 @@ const MoreOptionsSidebarMenu = () => { altColor onChange={setPreviewEnabled} defaultValue={previewEnabled} - disabled={activeSectionId === ""} + disabled={activeSectionId === ''} /> } label="Preview" @@ -150,6 +152,9 @@ const MoreOptionsSidebarMenu = () => { iconElement={} iconColorOverride={theme.contextMenuExit} label="Exit" + onClick={() => { + window.windowApi.closeWindow(); + }} /> diff --git a/app/renderer/controls/Button.tsx b/app/renderer/controls/Button.tsx index 5a5a6c3..2a4e41a 100644 --- a/app/renderer/controls/Button.tsx +++ b/app/renderer/controls/Button.tsx @@ -5,8 +5,8 @@ import { BounceLoader } from 'react-spinners'; type StyledButtonProps = { hoverBackgroundcolor?: string; activeBackgroundColor?: string; - loading?: boolean; - disabled?: boolean; + isLoading?: boolean; + isDisabled?: boolean; }; const StyledButton = styled.span` @@ -26,8 +26,8 @@ const StyledButton = styled.span` font-size: 0.9em; ${(p) => - !p.loading && - !p.disabled && + !p.isLoading && + !p.isDisabled && css` cursor: pointer; &:hover { @@ -41,8 +41,8 @@ const StyledButton = styled.span` `; type StyledLoaderProps = { - loading: boolean; - disabled: boolean; + isLoading: boolean; + isDisabled: boolean; }; const StyledLoader = styled.div` position: absolute; @@ -58,7 +58,7 @@ const StyledLoader = styled.div` align-content: center; opacity: 0; ${(p) => - (p.loading || p.disabled) && + (p.isLoading || p.isDisabled) && css` opacity: 1; `} @@ -90,11 +90,11 @@ const Button = ({ onClick(); } }} - loading={loading} - disabled={disabled} + isLoading={loading} + isDisabled={disabled} > {children} - +