Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/components/shell/ShellIsland.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ThemeToggle } from './ThemeToggle';
import { CommandPalette } from './CommandPalette';
import { Modal } from '@/components/ui/Modal';
import { initTheme } from '@/stores/theme.store';
import { isTauri } from '@/services/platform';
import { REPO_URL } from '@/config';

/** Opens the command palette from a click (works without a keyboard). */
Expand All @@ -17,10 +18,15 @@ const iconBtn =
export function ShellIsland() {
const [modal, setModal] = useState<null | 'github' | 'bookmark'>(null);
const [isMac, setIsMac] = useState(true);
// Settings only apply to the desktop app; hide the nav link on the web.
// Starts false so SSR and the first client render match, then reveals on
// desktop after mount (avoids a hydration mismatch).
const [isDesktop, setIsDesktop] = useState(false);

useEffect(() => {
initTheme();
setIsMac(/Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent));
setIsDesktop(isTauri());
}, []);

const bookmarkKey = isMac ? '⌘ D' : 'Ctrl + D';
Expand Down Expand Up @@ -48,9 +54,11 @@ export function ShellIsland() {
<kbd className="border-2 border-border bg-background px-1.5 py-0.5 text-xs">⌘K</kbd> to search
</span>
</button>
<a href="/settings" aria-label="Settings" title="Settings" className={iconBtn}>
<Settings className="h-4 w-4" />
</a>
{isDesktop && (
<a href="/settings" aria-label="Settings" title="Settings" className={iconBtn}>
<Settings className="h-4 w-4" />
</a>
)}
<a href="/about" aria-label="About" title="About" className={iconBtn}>
<Info className="h-4 w-4" />
</a>
Expand Down
Loading