refactor: sidebar shortcut option key

This commit is contained in:
tglide
2023-03-20 19:29:03 +00:00
parent aa2ca7cfe3
commit 9560f80f2a
2 changed files with 11 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
export function isMac(): boolean {
return window.navigator.platform.toUpperCase().indexOf('MAC') >= 0;
}
+8 -2
View File
@@ -3,6 +3,7 @@
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { tooltip } from '$lib/actions/tooltip';
import { isMac } from '$lib/helpers/platform';
import { slide } from '$lib/helpers/transition';
$: project = $page.params.project;
@@ -132,7 +133,12 @@
href={`${projectPath}/settings`}
on:click={() => trackEvent('click_menu_settings')}
class:is-selected={$page.url.pathname.startsWith(`${projectPath}/settings`)}
title="Settings">
title="Settings"
use:tooltip={{
content: 'Settings',
placement: 'right',
disabled: !narrow
}}>
<span class="icon-cog" aria-hidden="true" />
<span class="text">Settings</span>
</a>
@@ -146,7 +152,7 @@
aria-label="resize menu"
on:click={() => (narrow = !narrow)}
use:tooltip={{
content: 'Alt + S'
content: isMac() ? '⌥ + S' : 'Alt + S'
}}>
<span
class:icon-cheveron-right={narrow}