Skip to content

Commit 43a45d1

Browse files
committed
Minor code stylistic changes
1 parent cf14efc commit 43a45d1

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

src/components/AuthForm.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const AuthForm: React.FC<LoginFieldProps> = ({
2222
const [email, setEmail] = useState<string>('');
2323
const [password, setPassword] = useState<string>('');
2424
const [staySignedIn, setStaySignedIn] = useState<boolean>(false)
25-
const [modalVisible, setModalVisible] = useState(false);
25+
const [modalVisible, setModalVisible] = useState<boolean>(false);
2626

2727
const { signin } = useContext(AuthContext);
2828

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

37-
const handleStaySignInToggle = () => {
38-
if (staySignedIn) {
39-
setStaySignedIn(false)
40-
}else {
41-
setStaySignedIn(true)
42-
setModalVisible(true)
43-
}
44-
}
37+
const handleStaySignInToggle = () => {
38+
setStaySignedIn(!staySignedIn);
39+
if (!staySignedIn) setModalVisible(true);
40+
};
41+
4542
return (
4643
<>
4744
<TextInput

0 commit comments

Comments
 (0)