urbit/pkg/interface/webterm/InfoButton.tsx
tomholford 349033fb12 ux: detect OS for hotkey instructions
Also, ensure changes from this PR are included in the session branch:
https://github.com/urbit/urbit/pull/5529
2022-04-13 08:47:30 -07:00

25 lines
562 B
TypeScript

import React, { useCallback } from 'react';
import { Icon } from '@tlon/indigo-react';
import { useDetectOS } from './lib/useDetectOS';
export const InfoButton = () => {
const { isMacOS } = useDetectOS();
const onInfoClick = useCallback(() => {
const key = isMacOS ? 'alt' : 'shift';
alert(`To select text in the terminal, hold down the ${key} key.`);
}, [isMacOS]);
return (
<>
<button className="info-btn" onClick={onInfoClick}>
<Icon
icon="Info"
size="18px"
/>
</button>
</>
);
};