mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
style: localise labels to user device (#509)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
export function isMacOS() {
|
||||||
|
const userAgent = navigator.userAgent.toLowerCase();
|
||||||
|
return userAgent.includes('macintosh') || userAgent.includes('mac os');
|
||||||
|
}
|
||||||
|
|
||||||
|
export const deviceAlt = isMacOS() ? '⌥' : 'Alt';
|
||||||
@@ -5,6 +5,7 @@ import { SupportedEvent } from 'ontime-types';
|
|||||||
import { useEventAction } from '../../../common/hooks/useEventAction';
|
import { useEventAction } from '../../../common/hooks/useEventAction';
|
||||||
import { useEditorSettings } from '../../../common/stores/editorSettings';
|
import { useEditorSettings } from '../../../common/stores/editorSettings';
|
||||||
import { useEmitLog } from '../../../common/stores/logger';
|
import { useEmitLog } from '../../../common/stores/logger';
|
||||||
|
import { deviceAlt } from '../../../common/utils/deviceUtils';
|
||||||
import { tooltipDelayMid } from '../../../ontimeConfig';
|
import { tooltipDelayMid } from '../../../ontimeConfig';
|
||||||
|
|
||||||
import style from './QuickAddBlock.module.scss';
|
import style from './QuickAddBlock.module.scss';
|
||||||
@@ -82,7 +83,7 @@ const QuickAddBlock = (props: QuickAddBlockProps) => {
|
|||||||
className={style.quickBtn}
|
className={style.quickBtn}
|
||||||
data-testid='quick-add-event'
|
data-testid='quick-add-event'
|
||||||
>
|
>
|
||||||
Event {showKbd && <span className={style.keyboard}>Alt + E</span>}
|
Event {showKbd && <span className={style.keyboard}>{`${deviceAlt} + E`}</span>}
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip label='Add Delay' openDelay={tooltipDelayMid}>
|
<Tooltip label='Add Delay' openDelay={tooltipDelayMid}>
|
||||||
@@ -94,7 +95,7 @@ const QuickAddBlock = (props: QuickAddBlockProps) => {
|
|||||||
className={style.quickBtn}
|
className={style.quickBtn}
|
||||||
data-testid='quick-add-delay'
|
data-testid='quick-add-delay'
|
||||||
>
|
>
|
||||||
Delay {showKbd && <span className={style.keyboard}>Alt + D</span>}
|
Delay {showKbd && <span className={style.keyboard}>{`${deviceAlt} + D`}</span>}
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip label='Add Block' openDelay={tooltipDelayMid}>
|
<Tooltip label='Add Block' openDelay={tooltipDelayMid}>
|
||||||
@@ -106,7 +107,7 @@ const QuickAddBlock = (props: QuickAddBlockProps) => {
|
|||||||
className={style.quickBtn}
|
className={style.quickBtn}
|
||||||
data-testid='quick-add-block'
|
data-testid='quick-add-block'
|
||||||
>
|
>
|
||||||
Block {showKbd && <span className={style.keyboard}>Alt + B</span>}
|
Block {showKbd && <span className={style.keyboard}>{`${deviceAlt} + B`}</span>}
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user