Compare commits

...

5 Commits

Author SHA1 Message Date
cc3943196e added check in out route 2024-12-23 18:39:13 +05:30
71ece53f65 added translation for banner information 2024-12-23 18:29:25 +05:30
7ae4e8dbef enhance animation 2024-12-23 18:25:14 +05:30
a3d4f2b11c added animation to submenu 2024-12-23 17:36:42 +05:30
c1df68b27a edits for other screen sizes 2024-12-23 15:22:20 +05:30
14 changed files with 72 additions and 59 deletions

View File

@@ -78,5 +78,6 @@
"confirmNewKeyId": "Confirm New Key ID", "confirmNewKeyId": "Confirm New Key ID",
"highlightedFieldsInvalid": "Highlighted fields are invalid", "highlightedFieldsInvalid": "Highlighted fields are invalid",
"changeStatus": "Change Status", "changeStatus": "Change Status",
"keySwap": "Key Swap" "keySwap": "Key Swap",
"chargeEdit": "Edit Charges"
} }

View File

@@ -6,7 +6,7 @@ function BannerInfo({info}) {
const {t} = useTranslation(); const {t} = useTranslation();
const infoElements = Object.keys(info).map((key) => ( const infoElements = Object.keys(info).map((key) => (
<BannerInfoElement key={key} title={t(key)} description={info[key]} /> <BannerInfoElement key={key} title={t(key)} description={t(info[key])} />
)) ))
infoElements.push( infoElements.push(
<BannerInfoElement <BannerInfoElement

View File

@@ -5,7 +5,7 @@ import clsx from "clsx";
function FormField({ label, children, icon }) { function FormField({ label, children, icon }) {
return ( return (
<div className="flex"> <div className="flex">
<label className="mr-4 text-lg text-black dark:text-primary-dark w-[17%]"> <label className="mr-4 text-lg text-black dark:text-primary-dark md:w-[30%] xl:w-[20%] 2xl:w-[17%]">
{label} {label}
</label> </label>
<div className="flex w-full gap-4 items-center"> <div className="flex w-full gap-4 items-center">

View File

@@ -12,7 +12,7 @@ function FormInput({
<input <input
readOnly={readOnly} readOnly={readOnly}
value={value} value={value}
className={`w-1/4 h-10 px-2 rounded-full dark:bg-white dark:text-grey border-2 text-grey focus:outline-grey ${className}`} className={`w-1/2 md:w-1/3 lg:w-1/4 h-10 px-2 rounded-full dark:bg-white dark:text-grey border-2 text-grey focus:outline-grey ${className}`}
onChange={onChange} onChange={onChange}
type={type} type={type}
maxLength={maxLength} maxLength={maxLength}

View File

@@ -5,7 +5,7 @@ function FormSelect({ value, onChange, options, className }) {
<select <select
value={value} value={value}
className={ className={
"w-1/4 h-10 px-2 rounded-full dark:bg-white dark:text-grey border-2 text-grey focus:outline-grey " + "w-1/2 md:w-1/3 lg:w-1/4 h-10 px-2 rounded-full dark:bg-white dark:text-grey border-2 text-grey focus:outline-grey " +
className className
} }
onChange={onChange} onChange={onChange}

View File

@@ -3,35 +3,45 @@ import PropTypes from "prop-types";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import clsx from "clsx"; import clsx from "clsx";
import { useState } from "react"; import { useState } from "react";
import { AnimatePresence, motion } from "motion/react";
function SubMenu({ items, isVisible, onLinkClick }) { function SubMenu({ items, isVisible, onLinkClick }) {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<div <AnimatePresence mode="popLayout">
className={clsx( {isVisible && (
"absolute left-0 z-50 shadow-sm top-full border-t-3 border-primary dark:border-primary-dark bg-secondary dark:bg-secondary-dark rounded-2xl shadow-surface-variant-dark dark:shadow-primary", <div>
isVisible ? "block" : "hidden" <motion.div
)} className={clsx(
> "absolute left-0 z-50 shadow-sm top-full border-t-3 border-primary dark:border-primary-dark bg-secondary dark:bg-secondary-dark rounded-2xl shadow-surface-variant-dark dark:shadow-primary"
{items.map((subItem, index) => ( )}
<div initial={{ y: 15, opacity: 0 }}
key={index} animate={{ y: 0, opacity: 1 }}
className="px-6 py-2 cursor-pointer text-nowrap hover:bg-white dark:hover:bg-secondary-variant-dark first:rounded-t-2xl second-last:rounded-b-2xl first:pt-4 last:pb-4" exit={{ y: 15, opacity: 0 }}
onClick={onLinkClick} transition={{ duration: 0.3, type: "spring" }}
> >
<Link to={subItem.path}>{t(subItem.name)}</Link> {items.map((subItem, index) => (
<div
key={index}
className="px-3 py-2 cursor-pointer text-nowrap dark:hover:bg-secondary-variant-dark first:rounded-t-2xl first:pt-4 last:pb-4 second-last:rounded-b-2xl hover:bg-white"
onClick={onLinkClick}
>
<Link to={subItem.path}>{t(subItem.name)}</Link>
</div>
))}
<svg
className="absolute top-0 left-6 mt-[-13px] fill-primary dark:fill-primary-dark"
width="16"
height="13"
viewBox="0 0 16 13"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M6.26795 1C7.03775 -0.333332 8.96225 -0.333334 9.73205 0.999999L14.9282 10C15.698 11.3333 14.7358 13 13.1962 13H2.80385C1.26425 13 0.301996 11.3333 1.0718 10L6.26795 1Z" />
</svg>
</motion.div>
</div> </div>
))} )}
<svg </AnimatePresence>
className="absolute top-0 left-6 mt-[-13px] fill-primary dark:fill-primary-dark"
width="16"
height="13"
viewBox="0 0 16 13"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M6.26795 1C7.03775 -0.333332 8.96225 -0.333334 9.73205 0.999999L14.9282 10C15.698 11.3333 14.7358 13 13.1962 13H2.80385C1.26425 13 0.301996 11.3333 1.0718 10L6.26795 1Z" />
</svg>
</div>
); );
} }
@@ -41,14 +51,20 @@ function MenuBar({ menuItems }) {
return ( return (
<div className="flex justify-between pt-5 pb-2 text-base font-body"> <div className="flex justify-between pt-5 pb-2 text-base font-body">
{menuItems.map((item, index) => ( {menuItems.map((item, index) => (
<div <div
key={index} key={index}
className="relative pb-3 cursor-pointer" className="relative pb-3 cursor-pointer"
onMouseEnter={() => setActiveMenu(index)} onMouseEnter={() => setActiveMenu(index)}
onMouseLeave={() => setActiveMenu(null)} onMouseLeave={() => setActiveMenu(null)}
> >
<Link to={item.path}>{t(item.name)}</Link> <Link to={item.path}>{t(item.name)}</Link>
{item.submenu.length > 0 && <SubMenu items={item.submenu} isVisible={ activeMenu === index } onLinkClick={() => setActiveMenu(null)}/>} {item.submenu.length > 0 && (
<SubMenu
items={item.submenu}
isVisible={activeMenu === index}
onLinkClick={() => setActiveMenu(null)}
/>
)}
</div> </div>
))} ))}
</div> </div>

View File

@@ -14,6 +14,7 @@ import LockerStatus from "./pages/LockerStatus.jsx";
import KeySwap from "./pages/KeySwap.jsx"; import KeySwap from "./pages/KeySwap.jsx";
import ChargeManagement from "./pages/ChargeManagement.jsx"; import ChargeManagement from "./pages/ChargeManagement.jsx";
import ChargeEdit from "./pages/ChargeEdit.jsx"; import ChargeEdit from "./pages/ChargeEdit.jsx";
import Placeholder from "./pages/Placeholder.jsx";
const router = createBrowserRouter([ const router = createBrowserRouter([
@@ -60,6 +61,10 @@ const router = createBrowserRouter([
{ {
path: "operation/charge-management/change", path: "operation/charge-management/change",
element: <ChargeEdit />, element: <ChargeEdit />,
},
{
path: "operation/check-in-out",
element: <Placeholder />
} }
], ],
}, },

View File

@@ -62,16 +62,10 @@ function AccountCreation() {
subType: "number", subType: "number",
readOnly: true, readOnly: true,
validate: (value) => value !== "", validate: (value) => value !== "",
icon: ( icon: {
<PackageSearch icon: <PackageSearch size={18} />,
size={18} onClick: () => setShowProductModal(true),
onClick={() => { },
console.log("Product search clicked");
console.log(showProductModal);
setShowProductModal(true);
}}
/>
),
}, },
{ {
label: t("interestCategory"), label: t("interestCategory"),
@@ -114,7 +108,7 @@ function AccountCreation() {
subType: "number", subType: "number",
maxLength: 17, maxLength: 17,
validate: (value) => /^[0-9]{17}$/.test(value), validate: (value) => /^[0-9]{17}$/.test(value),
icon: <UserSearch size={18} />, icon: { icon: <UserSearch size={18} /> },
}, },
{ {
label: t("nomineeCifNumber"), label: t("nomineeCifNumber"),

View File

@@ -40,7 +40,7 @@ function CabinetCreation() {
<FormBox title={t("cabinetCreation")}> <FormBox title={t("cabinetCreation")}>
<div className="p-2 pt-7 flex flex-col gap-4"> <div className="p-2 pt-7 flex flex-col gap-4">
<div className="flex"> <div className="flex">
<label className="mr-4 text-lg text-black dark:text-primary-dark w-[10%]"> <label className="mr-4 text-lg text-black dark:text-primary-dark w-[15%]">
{t("cabinetId")} {t("cabinetId")}
</label> </label>
<div className="w-full"> <div className="w-full">
@@ -75,7 +75,7 @@ function CabinetCreation() {
</div> </div>
</div> </div>
<div className="flex"> <div className="flex">
<label className="mr-4 text-lg text-black dark:text-primary-dark w-[10%]"> <label className="mr-4 text-lg text-black dark:text-primary-dark w-[15%]">
{t("cabinetKeyId")} {t("cabinetKeyId")}
</label> </label>
<div className="w-full"> <div className="w-full">
@@ -102,7 +102,7 @@ function CabinetCreation() {
</div> </div>
</div> </div>
<div className="flex"> <div className="flex">
<label className="mr-4 text-lg text-black dark:text-primary-dark w-[10%]"> <label className="mr-4 text-lg text-black dark:text-primary-dark w-[15%]">
{t("noOfLockers")} {t("noOfLockers")}
</label> </label>
<div className="w-full"> <div className="w-full">

View File

@@ -41,9 +41,9 @@ function ChargeEdit() {
if (response.status === 200) { if (response.status === 200) {
const { rent, penalty } = response.data; const { rent, penalty } = response.data;
setChargeDetails({ setChargeDetails({
rentAmount: rent, rentAmount: rent.toString(),
rentAmountEdit: false, rentAmountEdit: false,
penaltyAmount: penalty, penaltyAmount: penalty.toString(),
penaltyAmountEdit: false, penaltyAmountEdit: false,
}); });
} else { } else {
@@ -170,7 +170,7 @@ function ChargeEdit() {
animate={{ opacity: 1 }} animate={{ opacity: 1 }}
exit={{ opacity: 0 }} exit={{ opacity: 0 }}
className={clsx( className={clsx(
"p-4 mb-8 font-body text-center text-xl rounded-2xl flex items-center justify-center gap-2", "p-4 mb-8 font-body text-center text-lg 2xl:text-xl rounded-2xl flex items-center justify-center gap-2",
notification.type === "error" notification.type === "error"
? "bg-error-surface text-error" ? "bg-error-surface text-error"
: "bg-success-surface text-success" : "bg-success-surface text-success"

View File

@@ -176,7 +176,7 @@ function KeySwap() {
animate={{ opacity: 1 }} animate={{ opacity: 1 }}
exit={{ opacity: 0 }} exit={{ opacity: 0 }}
className={clsx( className={clsx(
"p-4 mb-8 font-body text-center text-xl rounded-2xl flex items-center justify-center gap-2", "p-4 mb-8 font-body text-center text-lg rounded-2xl flex items-center justify-center gap-2",
notification.type === "error" notification.type === "error"
? "bg-error-surface text-error" ? "bg-error-surface text-error"
: "bg-success-surface text-success" : "bg-success-surface text-success"

View File

@@ -14,7 +14,6 @@ function LockersRegistration() {
const location = useLocation(); const location = useLocation();
const showToast = useToast(); const showToast = useToast();
const { setIsLoading } = useLoading(); const { setIsLoading } = useLoading();
const { noOfLockers, cabinetId } = location.state; const { noOfLockers, cabinetId } = location.state;
const [submitting, setSubmitting] = useState(false); const [submitting, setSubmitting] = useState(false);
const [notification, setNotification] = useState({ const [notification, setNotification] = useState({
@@ -34,7 +33,9 @@ function LockersRegistration() {
keyIdValid: true, keyIdValid: true,
})); }));
const [lockerValues, setLockerValues] = useState(initLockers); const [lockerValues, setLockerValues] = useState(initLockers);
if(!location.state) {
return <></>
}
const handleSubmit = async (e) => { const handleSubmit = async (e) => {
console.log("submitting"); console.log("submitting");
e.preventDefault(); e.preventDefault();
@@ -218,7 +219,7 @@ function LockersRegistration() {
: "bg-success-surface text-success" : "bg-success-surface text-success"
)} )}
> >
{notification.message.split(":").map((msg, index) => { {notification.type === "error" ? notification.message : notification.message.split(":").map((msg, index) => {
return index === 1 ? ( return index === 1 ? (
<span key={index} className="border-b border-dashed"> <span key={index} className="border-b border-dashed">
{msg} {msg}

View File

@@ -1,7 +1,7 @@
function Placeholder() { function Placeholder() {
return ( return (
<div className="flex justify-center items-center h-full"> <div className="text-center h-full">
<p className="text-3xl text-primary">Placeholder</p> <p className="text-3xl text-primary font-bold">Placeholder</p>
</div> </div>
); );
} }

View File

@@ -4,9 +4,5 @@ const productInfo = [
{ productCode: '1101', productCodeDescription: 'SAVINGS DEPOSIT', interestCategory: '1007', interestCategoryDescription: 'NON MEMBER', payableGl: '16301', paidGl: '62117' }, { productCode: '1101', productCodeDescription: 'SAVINGS DEPOSIT', interestCategory: '1007', interestCategoryDescription: 'NON MEMBER', payableGl: '16301', paidGl: '62117' },
{ productCode: '2002', productCodeDescription: 'CASH CERTIFICATE -GENERAL', interestCategory: '1047', interestCategoryDescription: 'COMPOUNDING', payableGl: '16011', paidGl: '62111' }, { productCode: '2002', productCodeDescription: 'CASH CERTIFICATE -GENERAL', interestCategory: '1047', interestCategoryDescription: 'COMPOUNDING', payableGl: '16011', paidGl: '62111' },
{ productCode: '2002', productCodeDescription: 'CASH CERTIFICATE', interestCategory: '1005', interestCategoryDescription: 'NON MEMBER - SENIOR CITIZEN', payableGl: '16011', paidGl: '62111' }, { productCode: '2002', productCodeDescription: 'CASH CERTIFICATE', interestCategory: '1005', interestCategoryDescription: 'NON MEMBER - SENIOR CITIZEN', payableGl: '16011', paidGl: '62111' },
{ productCode: '2001', productCodeDescription: 'MIS', interestCategory: '1003', interestCategoryDescription: 'NON MEMBER - SENIOR CITIZEN', payableGl: '16137', paidGl: '62125' },
{ productCode: '2002', productCodeDescription: 'FIXED DEPOSIT', interestCategory: '1006', interestCategoryDescription: 'NONMEMBER - SENIOR CITIZEN', payableGl: '16009', paidGl: '62109' },
{ productCode: '2002', productCodeDescription: 'CASH CERTIFICATE', interestCategory: '1001', interestCategoryDescription: 'MEMBER', payableGl: '16011', paidGl: '62111' },
{ productCode: '1101', productCodeDescription: 'SAVINGS DEPOSIT- MEMBER', interestCategory: '1347', interestCategoryDescription: 'COMPOUNDING', payableGl: '16301', paidGl: '62117' }
] ]
export default productInfo; export default productInfo;