Fix: Home design
This commit is contained in:
@@ -40,13 +40,10 @@ export default function Login() {
|
||||
|
||||
async function handleLogin(e: React.FormEvent) {
|
||||
e.preventDefault();
|
||||
setIsLogging(true);
|
||||
|
||||
const onlyDigit = /^\d{11}$/;
|
||||
if (!onlyDigit.test(CIF)) {
|
||||
setError('Input value must be 11 digit');
|
||||
}
|
||||
|
||||
if (inputCaptcha !== captcha) {
|
||||
notifications.show({
|
||||
withBorder: true,
|
||||
@@ -68,6 +65,7 @@ export default function Login() {
|
||||
}),
|
||||
});
|
||||
const data = await response.json();
|
||||
setIsLogging(true);
|
||||
if (response.ok) {
|
||||
console.log(data);
|
||||
const token = data.token;
|
||||
@@ -81,6 +79,7 @@ export default function Login() {
|
||||
|
||||
}
|
||||
else {
|
||||
setIsLogging(false);
|
||||
notifications.show({
|
||||
withBorder: true,
|
||||
color: "red",
|
||||
@@ -255,7 +254,7 @@ export default function Login() {
|
||||
/>
|
||||
<Button type="submit" disabled={isLogging} fullWidth variant="filled" mt="md">
|
||||
{/* Login */}
|
||||
{isLogging ? "Logging.." : "Login"}
|
||||
{isLogging ? "Logging...." : "Login"}
|
||||
</Button>
|
||||
</form>
|
||||
</Flex>
|
||||
|
Reference in New Issue
Block a user