Fix 'I already have an account' button to properly open login dialog

- Add onLogin prop to SimpleSignupDialog interface
- Connect handleLoginClick to onLogin callback
- Update LoginArea and NostrSettings to handle signup->login transition
- Now clicking 'I already have an account' properly closes signup and opens login
- All tests passing
This commit is contained in:
Mary Kate Fain committed 2025-09-21 19:05:40 -05:00
1 parent d5c5132662
commit 3d42d93ef1
3 files changed
+14 -4

No files matched your search

+4
View File
@@ -98,6 +98,10 @@ export function LoginArea({ className }: LoginAreaProps) {
<SimpleSignupDialog
isOpen={signupDialogOpen}
onClose={() => setSignupDialogOpen(false)}
onLogin={() => {
setSignupDialogOpen(false);
setLoginDialogOpen(true);
}}
/>
</div>
);
+6 -4
View File
@@ -14,12 +14,14 @@ interface SimpleSignupDialogProps {
isOpen: boolean;
onClose: () => void;
onComplete?: () => void;
onLogin?: () => void;
}
const SimpleSignupDialog: React.FC<SimpleSignupDialogProps> = ({
isOpen,
onClose,
onComplete
onComplete,
onLogin
}) => {
const [step, setStep] = useState<Step>('key');
const [isLoading, setIsLoading] = useState(false);
@@ -120,9 +122,9 @@ const SimpleSignupDialog: React.FC<SimpleSignupDialogProps> = ({
const handleLoginClick = () => {
onClose();
// This would typically open the login modal
// Since we don't have direct access to the login modal state here,
// we'll rely on the parent component to handle this
if (onLogin) {
onLogin();
}
};
if (step === 'key') {
+4
View File
@@ -222,6 +222,10 @@ export function NostrSettings() {
isOpen={showSignupDialog}
onClose={() => setShowSignupDialog(false)}
onComplete={handleSignupComplete}
onLogin={() => {
setShowSignupDialog(false);
setShowLoginDialog(true);
}}
/>
</div>
);