feat : upgrade the home screen
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
"use client";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { Text, Button, TextInput, PasswordInput, Title, Card, Group, Flex, Box, Image, Anchor, Stack } from "@mantine/core";
|
||||
import { Text, Button, TextInput, PasswordInput, Title, Card, Group, Flex, Box, Image, Anchor, Stack, Popover, ActionIcon } from "@mantine/core";
|
||||
import { notifications } from "@mantine/notifications";
|
||||
import { Carousel } from '@mantine/carousel';
|
||||
import { Providers } from "@/app/providers";
|
||||
import { useRouter } from "next/navigation";
|
||||
import NextImage from "next/image";
|
||||
import myImage from '@/app/image/ebanking.jpg';
|
||||
import frontPage from '@/app/image/ib_front_page.jpg';
|
||||
import DICGC from '@/app/image/DICGC_image.jpg';
|
||||
import objective from '@/app/image/objective.jpg';
|
||||
import dynamic from 'next/dynamic';
|
||||
|
||||
|
||||
function generateCaptcha(length = 6) {
|
||||
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
return Array.from({ length }, () => chars[Math.floor(Math.random() * chars.length)]).join("");
|
||||
@@ -24,12 +22,9 @@ export default function Login() {
|
||||
const [psw, SetPsw] = useState("");
|
||||
const [captcha, setCaptcha] = useState("");
|
||||
const [inputCaptcha, setInputCaptcha] = useState("");
|
||||
const ClientCarousel =dynamic(() => import ('./clientCarousel'),{ssr:false});
|
||||
// const [isClient,SetIsClient] =useState(false);
|
||||
|
||||
|
||||
// useEffect(()=> SetIsClient(true),[]);
|
||||
|
||||
const [isLogging, setIsLogging] = useState(false);
|
||||
const ClientCarousel = dynamic(() => import('./clientCarousel'), { ssr: false });
|
||||
|
||||
useEffect(() => {
|
||||
setCaptcha(generateCaptcha());
|
||||
}, []);
|
||||
@@ -41,6 +36,7 @@ export default function Login() {
|
||||
|
||||
async function handleLogin(e: React.FormEvent) {
|
||||
e.preventDefault();
|
||||
setIsLogging(false);
|
||||
const onlyDigit = /^\d{11}$/;
|
||||
if (!onlyDigit.test(CIF)) {
|
||||
setError('Input value must be 11 digit');
|
||||
@@ -62,6 +58,7 @@ export default function Login() {
|
||||
localStorage.setItem("customerNumber", CIF);
|
||||
localStorage.setItem("password", psw);
|
||||
localStorage.setItem("access_token", token);
|
||||
setIsLogging(true);
|
||||
router.push("/home");
|
||||
} else {
|
||||
// SetCIF('');
|
||||
@@ -82,13 +79,24 @@ export default function Login() {
|
||||
<div style={{ backgroundColor: "#f8f9fa", width: "100%", height: "auto", paddingTop: "5%" }}>
|
||||
<Box style={{ position: 'fixed', width: '100%', height: '12%', top: 0, left: 0, zIndex: 100 }}>
|
||||
<Image
|
||||
// radius="md"
|
||||
fit="cover"
|
||||
src={myImage}
|
||||
component={NextImage}
|
||||
alt="ebanking"
|
||||
style={{ width: "100%", height: "100%" }}
|
||||
/>
|
||||
<Text
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
left: '64%',
|
||||
color: 'black',
|
||||
textShadow: '1px 1px 2px blue',
|
||||
}}
|
||||
>
|
||||
{/* <IconBuildingBank/> */}
|
||||
Head Office : Dharmshala, District: Kangra(H.P), Pincode: 176215
|
||||
</Text>
|
||||
</Box>
|
||||
<div style={{ marginTop: '10px' }}>
|
||||
<Box
|
||||
@@ -227,8 +235,9 @@ export default function Login() {
|
||||
onChange={(e) => setInputCaptcha(e.currentTarget.value)}
|
||||
required
|
||||
/>
|
||||
<Button type="submit" fullWidth variant="filled" mt="md">
|
||||
Login
|
||||
<Button type="submit" disabled={isLogging} fullWidth variant="filled" mt="md">
|
||||
{/* Login */}
|
||||
{isLogging ? "Logging.." :"Login"}
|
||||
</Button>
|
||||
</form>
|
||||
</Flex>
|
||||
@@ -239,11 +248,12 @@ export default function Login() {
|
||||
</div>
|
||||
<Box style={{
|
||||
width: "100%",
|
||||
height: '60vh',
|
||||
height: '50vh',
|
||||
textAlign: "left",
|
||||
marginTop:0,
|
||||
marginTop: 10,
|
||||
// border: "1px solid blue"
|
||||
}}>
|
||||
<ClientCarousel/>
|
||||
<ClientCarousel />
|
||||
</Box>
|
||||
<Box
|
||||
component="footer"
|
||||
@@ -262,7 +272,8 @@ export default function Login() {
|
||||
<Anchor href="document/disclaimer.pdf" target="_blank" rel="noopener noreferrer">Disclaimer</Anchor> |{" "}
|
||||
<Anchor href="document/privacy_policy.pdf" target="_blank" rel="noopener noreferrer">Privacy Policy</Anchor> |{" "}
|
||||
<Anchor href="document/phishing.pdf" target="_blank" rel="noopener noreferrer">Phishing</Anchor> |{" "}
|
||||
<Anchor href="document/security_tips.pdf" target="_blank" rel="noopener noreferrer">Security Tips</Anchor>
|
||||
<Anchor href="document/security_tips.pdf" target="_blank" rel="noopener noreferrer">Security Tips</Anchor> |{" "}
|
||||
<Anchor href="document/grievance.jpg" target="_blank" rel="noopener noreferrer">Grievances</Anchor>
|
||||
</Text>
|
||||
</Box>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user