mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
 - New `shortcut` prop for `<Tooltip />` - single key ```tsx <Tooltip shortcut="T" /> ``` - multiple ```tsx <Tooltip shortcut={["⌘", "K"]} /> ``` - Round tooltip's arrow - Use new design system colors - Replace some usage - App sidebar switch - Editor mode switch - New tab (new)
11 lines
317 B
TypeScript
11 lines
317 B
TypeScript
import { isMacOS } from './platform';
|
|
|
|
const macOS = isMacOS();
|
|
|
|
export const getCommand = (cmd: '$mod' | '$shift' | '$alt' | string) => {
|
|
if (cmd === '$mod') return macOS ? '⌘' : 'Ctrl';
|
|
if (cmd === '$alt') return macOS ? '⌥' : 'Alt';
|
|
if (cmd === '$shift') return macOS ? '⇧' : 'Shift';
|
|
return cmd;
|
|
};
|