fix(17): WR-05 IN-03 IN-01 resize-aware useIsPhone hook; OidcRedirect side-effect in effect

This commit is contained in:
Lucas Berger
2026-06-18 13:40:00 -04:00
parent c2ceebf130
commit a4a7438641
6 changed files with 73 additions and 25 deletions
+5 -6
View File
@@ -38,6 +38,7 @@ import {
type AdminCalendar,
} from '../api/client.js';
import { CredentialSheet, type CredentialSheetMode } from '../components/CredentialSheet.js';
import { useIsPhone } from '../hooks/useIsPhone.js';
// ── Styles ─────────────────────────────────────────────────────────────────
@@ -55,8 +56,8 @@ const sectionLabelStyle: React.CSSProperties = {
export function AdminPage() {
const queryClient = useQueryClient();
// Phone detection for toast bottom offset
const phone = typeof window !== 'undefined' && window.matchMedia('(max-width: 767px)').matches;
// Phone detection for toast bottom offset (WR-05: resize-aware)
const phone = useIsPhone();
// Success toast state (D-08)
const [toast, setToast] = useState<string | null>(null);
@@ -1345,6 +1346,8 @@ interface ResetPasswordSheetProps {
}
function ResetPasswordSheet({ isOpen, onClose, onSuccess, member }: ResetPasswordSheetProps) {
// WR-05: resize-aware phone detection.
const sheetPhone = useIsPhone();
const [newPassword, setNewPassword] = useState('');
const [confirmPassword, setConfirmPassword] = useState('');
const [error, setError] = useState<string | null>(null);
@@ -1374,10 +1377,6 @@ function ResetPasswordSheet({ isOpen, onClose, onSuccess, member }: ResetPasswor
onClose();
}
// Phone detection for desktop centering
const sheetPhone =
typeof window !== 'undefined' && window.matchMedia('(max-width: 767px)').matches;
const resetMutation = useMutation({
mutationFn: async () => {
if (newPassword !== confirmPassword) throw new Error('mismatch');