diff --git a/src/components/LanguageToggle.tsx b/src/components/LanguageToggle.tsx
index 3a50883..86088b5 100644
--- a/src/components/LanguageToggle.tsx
+++ b/src/components/LanguageToggle.tsx
@@ -22,6 +22,8 @@ interface LanguageToggleProps {
inline?: boolean;
/** Additional class names */
className?: string;
+ /** Called after a locale is chosen (e.g. to close a sheet sub-view). */
+ onSelect?: () => void;
/** Variant style */
variant?: 'default' | 'outline' | 'ghost';
}
@@ -52,7 +54,7 @@ function Flag({ flag, className }: { flag: string; className?: string }) {
/**
* Language toggle dropdown for switching between the available locales
*/
-export function LanguageToggle({ compact = false, inline = false, className, variant = 'ghost' }: LanguageToggleProps) {
+export function LanguageToggle({ compact = false, inline = false, className, variant = 'ghost', onSelect }: LanguageToggleProps) {
const { language, setLanguage, t } = useTranslation();
const [query, setQuery] = useState('');
@@ -89,7 +91,7 @@ export function LanguageToggle({ compact = false, inline = false, className, var
-
+
@@ -827,7 +843,7 @@ export function Layout({ children, noPadding }: LayoutProps) {
/>
)}
-
+
{t('settings.selectLanguage')}
-
+ setMobileLanguageView(false)} />
) : (
@@ -1102,7 +1118,7 @@ export function Layout({ children, noPadding }: LayoutProps) {
{t('chromeUi.loggedOutPrompt')}
-
+
>
)}
@@ -1256,6 +1272,24 @@ export function Layout({ children, noPadding }: LayoutProps) {
/>
+ {/* Header/burger auth — owned here so closing the sheet cannot unmount it
+ and it always sits above the sheet + welcome overlay. */}
+
+ setAuthDialog(null)}
+ onLogin={() => setAuthDialog(null)}
+ onSignup={() => setAuthDialog('signup')}
+ />
+
+
+ setAuthDialog(null)}
+ onUseAmber={() => setAuthDialog('login')}
+ />
+
+
{/* Newsletter: floating pill + Monday admin reminder */}
diff --git a/src/components/auth/LoginArea.tsx b/src/components/auth/LoginArea.tsx
index c231f41..87735d1 100644
--- a/src/components/auth/LoginArea.tsx
+++ b/src/components/auth/LoginArea.tsx
@@ -15,14 +15,31 @@ export interface LoginAreaProps {
className?: string;
/** Compact mode for mobile headers - smaller buttons without text */
compact?: boolean;
+ /**
+ * Open auth in a caller-owned dialog instead of this component's local one.
+ * The mobile burger sheet uses this: its local dialog would portal *behind*
+ * the sheet (z-50 vs z-2100) and leave the menu looking stuck.
+ */
+ onLoginRequest?: () => void;
+ onSignupRequest?: () => void;
}
-export function LoginArea({ className, compact }: LoginAreaProps) {
+export function LoginArea({ className, compact, onLoginRequest, onSignupRequest }: LoginAreaProps) {
const { currentUser } = useLoggedInAccounts();
const { t } = useTranslation();
const [loginDialogOpen, setLoginDialogOpen] = useState(false);
const [signupDialogOpen, setSignupDialogOpen] = useState(false);
+ const globalAuth = !!onLoginRequest && !!onSignupRequest;
+ const openLogin = () => {
+ if (onLoginRequest) onLoginRequest();
+ else setLoginDialogOpen(true);
+ };
+ const openSignup = () => {
+ if (onSignupRequest) onSignupRequest();
+ else setSignupDialogOpen(true);
+ };
+
const handleLogin = () => {
setLoginDialogOpen(false);
setSignupDialogOpen(false);
@@ -31,12 +48,12 @@ export function LoginArea({ className, compact }: LoginAreaProps) {
return (
{currentUser ? (
-
setLoginDialogOpen(true)} />
+
) : compact ? (
// Compact mode for mobile headers - icon only
);
}
\ No newline at end of file
diff --git a/src/components/auth/LoginDialog.tsx b/src/components/auth/LoginDialog.tsx
index 622ddeb..2caa40e 100644
--- a/src/components/auth/LoginDialog.tsx
+++ b/src/components/auth/LoginDialog.tsx
@@ -321,7 +321,7 @@ export const LoginDialog: React.FC = ({ isOpen, onClose, onLog
return (