refactor: support i18n
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useSyncExternalStore } from "react";
|
||||
|
||||
/** 与 Tailwind 默认 `lg` 断点一致(1024px) */
|
||||
/** Matches Tailwind's default `lg` breakpoint (1024px). */
|
||||
const LG_MEDIA_QUERY = "(min-width: 1024px)";
|
||||
|
||||
function subscribe(onStoreChange: () => void) {
|
||||
@@ -19,7 +19,7 @@ function getServerSnapshot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** 仅客户端在 lg 及以上为 true;SSR 恒为 false,与 mobile-first 一致 */
|
||||
/** Client-only true at lg and above. SSR always returns false for mobile-first rendering. */
|
||||
export function useIsLgUp() {
|
||||
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user