Skip to content

Commit d6b451b

Browse files
committed
Update ContentSearch.tsx
1 parent 31a7c9c commit d6b451b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.storybook/components/ContentSearch.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { addons, types } from 'storybook/manager-api';
55

66
const ADDON_ID = 'content-search';
77
const TOOL_ID = `${ADDON_ID}/toolbar`;
8+
const isMac = navigator.platform.toUpperCase().includes('MAC');
9+
const shortcut = isMac ? '⌘⇧F' : 'Ctrl+Shift+F';
810

911
function SearchButton() {
1012
const openSearch = React.useCallback(() => {
@@ -27,7 +29,7 @@ function SearchButton() {
2729
}, [openSearch]);
2830

2931
return (
30-
<IconButton key={TOOL_ID} title="Search docs (⌘⇧F)" style={{ order: -2 }} onClick={openSearch}>
32+
<IconButton key={TOOL_ID} title={`Search docs (${shortcut})`} style={{ order: -2 }} onClick={openSearch}>
3133
<SearchIcon />
3234
Search Docs (Beta)
3335
</IconButton>

0 commit comments

Comments
 (0)