fix(ui): hide kbd hints on non-desktop
This commit is contained in:
@@ -118,14 +118,11 @@ const SessionSidebar: Component<SessionSidebarProps> = (props) => (
|
||||
</Show>
|
||||
</div>
|
||||
</div>
|
||||
<Show when={props.keyboardShortcuts().length}>
|
||||
<KeyboardHint
|
||||
class="session-sidebar-shortcuts"
|
||||
shortcuts={props.keyboardShortcuts()}
|
||||
separator=" "
|
||||
showDescription={false}
|
||||
/>
|
||||
</Show>
|
||||
<div class="session-sidebar-shortcuts">
|
||||
<Show when={props.keyboardShortcuts().length}>
|
||||
<KeyboardHint shortcuts={props.keyboardShortcuts()} separator=" " showDescription={false} />
|
||||
</Show>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="session-sidebar flex flex-col flex-1 min-h-0">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component, JSX, For } from "solid-js"
|
||||
import useMediaQuery from "@suid/material/useMediaQuery"
|
||||
import { isMac } from "../lib/keyboard-utils"
|
||||
|
||||
interface KbdProps {
|
||||
@@ -27,6 +28,9 @@ const SPECIAL_KEY_LABELS: Record<string, string> = {
|
||||
}
|
||||
|
||||
const Kbd: Component<KbdProps> = (props) => {
|
||||
const desktopQuery = useMediaQuery("(min-width: 1280px)")
|
||||
if (!desktopQuery()) return null
|
||||
|
||||
const parts = () => {
|
||||
if (props.children) return [{ text: props.children, isModifier: false }]
|
||||
if (!props.shortcut) return []
|
||||
|
||||
Reference in New Issue
Block a user