-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: clean up use os hook (janhq#1418)
Signed-off-by: James <[email protected]> Co-authored-by: James <[email protected]>
- Loading branch information
Showing
4 changed files
with
37 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
import { useOs, type OS } from '@/hooks/useOs' | ||
|
||
export default function ShortCut(props: { menu: string }) { | ||
const os = useOs() | ||
const { menu } = props | ||
const getSymbol = (os: OS) => { | ||
switch (os) { | ||
case 'macos': | ||
return '⌘' | ||
|
||
default: | ||
return 'Ctrl' | ||
} | ||
} | ||
const symbol = isMac ? '⌘' : 'Ctrl' | ||
|
||
return ( | ||
<div className="inline-flex items-center justify-center rounded-full bg-secondary px-1 py-0.5 text-xs font-bold text-muted-foreground"> | ||
<p>{getSymbol(os) + ' + ' + menu}</p> | ||
<p>{symbol + ' + ' + menu}</p> | ||
</div> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.