feat: v1.34.0 — Mobile UI Early Preview, Russian 2, macOS network fix

Co-authored-by: kilyabin <kilyabin@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-06 12:46:13 +02:00
parent 29203803de
commit 50ac1b8284
30 changed files with 3141 additions and 123 deletions
+33
View File
@@ -0,0 +1,33 @@
import { useSyncExternalStore } from 'react';
const MOBILE_BREAKPOINT = 800;
const query = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`;
let mql: MediaQueryList | null = null;
function getMql(): MediaQueryList {
if (!mql) mql = window.matchMedia(query);
return mql;
}
function subscribe(cb: () => void): () => void {
const m = getMql();
m.addEventListener('change', cb);
return () => m.removeEventListener('change', cb);
}
function getSnapshot(): boolean {
return getMql().matches;
}
function getServerSnapshot(): boolean {
return false;
}
/**
* Returns `true` when the viewport width is below 800px.
* Updates in real-time on resize via `matchMedia`.
*/
export function useIsMobile(): boolean {
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
}