even better
This commit is contained in:
parent
4ae694c9b8
commit
f4d7ec143a
1 changed files with 3 additions and 5 deletions
|
|
@ -1,9 +1,7 @@
|
||||||
/** Attempts to determine if a user is on a Mac using `navigator.userAgent`. */
|
/** Attempts to determine if a user is on a Mac using `navigator.userAgent`. */
|
||||||
export function isMac() {
|
export const isMac = navigator.userAgent.includes('Mac');
|
||||||
return navigator.userAgent.includes('Mac');
|
|
||||||
}
|
|
||||||
|
|
||||||
/** `⌘` for mac or `Ctrl` for windows */
|
/** `⌘` for mac or `Ctrl` for windows */
|
||||||
export const cmdOrCtrl = isMac() ? '⌘' : 'Ctrl';
|
export const cmdOrCtrl = isMac ? '⌘' : 'Ctrl';
|
||||||
/** `⌥` for mac or `Alt` for windows */
|
/** `⌥` for mac or `Alt` for windows */
|
||||||
export const optionOrAlt = isMac() ? '⌥' : 'Alt';
|
export const optionOrAlt = isMac ? '⌥' : 'Alt';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue