Wip : Admin module in progress

This commit is contained in:
2025-09-08 13:15:33 +05:30
parent 686db990ac
commit 833453241c
7 changed files with 205 additions and 46 deletions

View File

@@ -6,7 +6,7 @@ import { Providers } from "@/app/providers";
import { useRouter } from "next/navigation";
import NextImage from "next/image";
import logo from '@/app/image/logo1.jpg';
import { IconLogout, IconPhoneFilled, IconUsers, IconUserScreen } from "@tabler/icons-react";
import { IconEye, IconLogout, IconPhoneFilled, IconUsers, IconUserScreen } from "@tabler/icons-react";
import UserConfiguration from "./UserConfiguration";
export default function Login() {
@@ -19,6 +19,8 @@ export default function Login() {
async function handleLogout(e: React.FormEvent) {
e.preventDefault();
localStorage.removeItem("admin_access_token");
localStorage.clear();
sessionStorage.clear();
router.push("/administrator/login");
}
async function handleFetchUserDetails(e: React.FormEvent) {
@@ -82,7 +84,7 @@ export default function Login() {
if (authorized) {
return (
<Providers>
<div style={{ backgroundColor: "#f8f9fa", width: "100%", height: "100%",}}>
<div style={{ backgroundColor: "#f8f9fa", width: "100%", height: "100%", }}>
{/* Header */}
<Box
style={{
@@ -127,11 +129,11 @@ export default function Login() {
</Text>
</Box>
{/* layout and */}
<Box style={{ display: 'flex', height: '88vh' }}>
<Box style={{ display: 'flex', height: '90vh' }}>
{/* Sidebar manually placed under header */}
<Box
style={{
width: 220,
width: 250,
background: "#ebf5f5ff",
// background: "linear-gradient(90deg,rgba(42, 123, 155, 1) 0%, rgba(87, 199, 133, 1) 30%)",
padding: '1rem',
@@ -142,19 +144,19 @@ export default function Login() {
<Divider my="xs" label="Menu" labelPosition="center" />
<Stack>
<Text td="underline" variant="light" style={{ cursor: 'pointer' }} onClick={() => handleClick('UserConf')}>
<IconUsers /> User Configuration
<IconUsers size ="15"/> User Configuration
</Text>
<Text td="underline" variant="light" style={{ cursor: 'pointer' }} onClick={() => handleClick('ViewUser')}>
<IconUserScreen /> View Users
<IconEye size ="15"/> View User Configuration
</Text>
<Text td="underline" variant="light" style={{ cursor: 'pointer' }} onClick={handleLogout}>
<IconLogout /> Logout
<IconLogout size ="15"/> Logout
</Text>
</Stack>
</Box>
{/* Main Content Area */}
<Stack style={{ flex: 1, padding: '1rem' }}>
<Stack style={{ flex: 1, padding: '1rem'}}>
<Box>
<Text c="Blue" size="lg" fs='italic'>Welcome ,{name} </Text>
<Text size="xs" c="gray" style={{ fontFamily: "inter", fontSize: '13px' }}>
@@ -163,13 +165,14 @@ export default function Login() {
</Box>
<Box>
{view === 'userConf' && <UserConfiguration />}
{view === 'view' && <Text size="xl">view</Text>}
{view === 'view' && <Text size="xl">Feature will be available soon ....</Text>}
{!view &&
<Text size="xl">Welcome To The Admin Portal</Text>
}
</Box>
</Stack>
</Box>
<Text size="sm" style={{textAlign:"center"}}>© 2025 The Kangra Central Co-Operative Bank</Text>
</div>
</Providers>
);