Skip to content

Commit

Permalink
Minor code stylistic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinTan-1 committed Feb 19, 2025
1 parent cf14efc commit 43a45d1
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/components/AuthForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const AuthForm: React.FC<LoginFieldProps> = ({
const [email, setEmail] = useState<string>('');
const [password, setPassword] = useState<string>('');
const [staySignedIn, setStaySignedIn] = useState<boolean>(false)
const [modalVisible, setModalVisible] = useState(false);
const [modalVisible, setModalVisible] = useState<boolean>(false);

const { signin } = useContext(AuthContext);

Expand All @@ -34,14 +34,11 @@ const AuthForm: React.FC<LoginFieldProps> = ({
}
};

const handleStaySignInToggle = () => {
if (staySignedIn) {
setStaySignedIn(false)
}else {
setStaySignedIn(true)
setModalVisible(true)
}
}
const handleStaySignInToggle = () => {
setStaySignedIn(!staySignedIn);
if (!staySignedIn) setModalVisible(true);
};

return (
<>
<TextInput
Expand Down

0 comments on commit 43a45d1

Please sign in to comment.