-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from neilenns/neilenns/issue76
Add restore button to mini mode
- Loading branch information
Showing
4 changed files
with
77 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useCallback } from "react"; | ||
import { Fullscreen, FullscreenExit } from "react-bootstrap-icons"; | ||
|
||
interface MiniModeToggleButtonProps { | ||
showRestoreButton: boolean; | ||
} | ||
|
||
const MiniModeToggleButton: React.FC<MiniModeToggleButtonProps> = ({ | ||
showRestoreButton, | ||
}) => { | ||
const toggleMiniMode = useCallback(() => { | ||
window.api.toggleMiniMode().catch((error: unknown) => { | ||
console.error(error); | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<button | ||
className="btn btn-primary m-2" | ||
style={{ lineHeight: 0, fontSize: "14px" }} | ||
onClick={toggleMiniMode} | ||
> | ||
{showRestoreButton ? ( | ||
<Fullscreen | ||
title={"Switch to large mode"} | ||
style={{ strokeWidth: "0.5px", stroke: "white" }} | ||
/> | ||
) : ( | ||
<FullscreenExit | ||
title={"Switch to mini mode"} | ||
style={{ strokeWidth: "0.5px", stroke: "white" }} | ||
/> | ||
)} | ||
</button> | ||
); | ||
}; | ||
|
||
export default MiniModeToggleButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters