-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature: added compact mode * chore: add cross-env to better support different operating systems in dev Co-authored-by: Sekwah <contact@sekwah.com>
- Loading branch information
1 parent
82da7b1
commit 75147e5
Showing
27 changed files
with
290 additions
and
53 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
33 changes: 33 additions & 0 deletions
33
app/renderer/src/routes/Timer/Control/CompactModeButton.tsx
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,33 @@ | ||
import { SVG } from "components"; | ||
import { useRippleEffect } from "hooks"; | ||
import React, { useCallback, useRef } from "react"; | ||
import { StyledMainButton } from "styles"; | ||
|
||
type Props = { flipped?: boolean } & React.HTMLProps<HTMLButtonElement>; | ||
|
||
const CompactModeButton: React.FC<Props> = ({ onClick, flipped }) => { | ||
const buttonRef = useRef<HTMLButtonElement>(null); | ||
|
||
const buttonClickAction = useRippleEffect(); | ||
|
||
const onClickAction = useCallback( | ||
(e) => | ||
buttonClickAction(e, buttonRef, () => { | ||
if (onClick) { | ||
onClick(e); | ||
} | ||
}), | ||
[buttonClickAction, onClick] | ||
); | ||
|
||
return ( | ||
<StyledMainButton ref={buttonRef} onClick={onClickAction}> | ||
<SVG | ||
name="expand" | ||
style={flipped ? { transform: "rotate(180deg)" } : {}} | ||
/> | ||
</StyledMainButton> | ||
); | ||
}; | ||
|
||
export default React.memo(CompactModeButton); |
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
Oops, something went wrong.