mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
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:
1 parent
d5c5132662
commit
3d42d93ef1
3 files changed
+14
-4
No files matched your search
@@ -98,6 +98,10 @@ export function LoginArea({ className }: LoginAreaProps) {
|
||||
<SimpleSignupDialog
|
||||
isOpen={signupDialogOpen}
|
||||
onClose={() => setSignupDialogOpen(false)}
|
||||
onLogin={() => {
|
||||
setSignupDialogOpen(false);
|
||||
setLoginDialogOpen(true);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -222,6 +222,10 @@ export function NostrSettings() {
|
||||
isOpen={showSignupDialog}
|
||||
onClose={() => setShowSignupDialog(false)}
|
||||
onComplete={handleSignupComplete}
|
||||
onLogin={() => {
|
||||
setShowSignupDialog(false);
|
||||
setShowLoginDialog(true);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user