- Phones get a bottom tab bar (Studies, Bible, Plans, Prayer, Account); wider screens keep the header nav - The Account menu opens upward from the bar; toasts sit above it - Reader and study pages get a labelled Home button instead of a small arrow Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9893883b19
commit
a2185ba1dd
10 files changed
+125
-16
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
const QUERY = '(max-width: 639px)';
|
||||
const read = () => (typeof window !== 'undefined' && typeof window.matchMedia === 'function' ? window.matchMedia(QUERY).matches : false);
|
||||
|
||||
// True on a phone-width screen (under Tailwind's `sm`). False where matchMedia is missing (tests), so the full
|
||||
// layout is what renders there.
|
||||
export function useIsPhone() {
|
||||
const [phone, setPhone] = useState(read);
|
||||
useEffect(() => {
|
||||
if (typeof window.matchMedia !== 'function') return undefined;
|
||||
const mq = window.matchMedia(QUERY);
|
||||
const update = () => setPhone(mq.matches);
|
||||
update();
|
||||
mq.addEventListener?.('change', update);
|
||||
return () => mq.removeEventListener?.('change', update);
|
||||
}, []);
|
||||
return phone;
|
||||
}
|
||||
Reference in new issue
Block a user