Fix: Home design

This commit is contained in:
2025-07-10 14:57:42 +05:30
parent e3391315dd
commit df3fa3532f
4 changed files with 240 additions and 203 deletions

View File

@@ -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>