Compare commits

..

19 Commits

Author SHA1 Message Date
Ebube 8ab3e9ae50 Changed the Name of link 2024-03-21 14:15:28 +01:00
Ebube 66b8c96592 fixed typo on link path 2024-03-21 14:04:34 +01:00
Ebube acc4417835 commit issue fix 2024-03-21 13:51:49 +01:00
Ebube 7da693f298 fix commit issue 2024-03-21 13:49:22 +01:00
ameye 2c2e2b0ca5 Merge branch 'home-banners-dashboard' of WrenchBoard/Users-Wrench into master 2024-03-21 12:33:20 +00:00
Ebube ba3dd91d81 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into home-banners-dashboard 2024-03-21 13:28:42 +01:00
Ebube 3f04c9f9f8 added items to right sidebar 2024-03-21 13:28:03 +01:00
ameye 781f5cc5a6 Merge branch 'add-group-email' of WrenchBoard/Users-Wrench into master 2024-03-21 11:33:48 +00:00
ameye 58097d8b57 Merge branch 'home-banners-dashboard' of WrenchBoard/Users-Wrench into master 2024-03-21 11:33:41 +00:00
victorAnumudu 630ccefa51 Made the email input longer 2024-03-21 12:20:20 +01:00
Ebube ed9f2dec0e fixed link location 2024-03-21 12:01:32 +01:00
Ebube d2ed29c6a6 fixed link location 2024-03-21 11:53:58 +01:00
ameye 4e81156d72 Merge branch 'parent-kid-wallet' of WrenchBoard/Users-Wrench into master 2024-03-21 09:50:41 +00:00
ameye e402c02c1f Merge branch 'assign-task-image' of WrenchBoard/Users-Wrench into master 2024-03-21 09:50:34 +00:00
victorAnumudu 5907b5d872 parent kids wallet bug fixed 2024-03-20 21:04:49 +01:00
victorAnumudu 042cc4110c initial commit 2024-03-20 19:16:16 +01:00
tokslaw 5e6b208513 Merge branch 'family-wallet-refresh' of WrenchBoard/Users-Wrench into master 2024-03-20 13:32:48 +00:00
victorAnumudu 762601a5c3 made kid wallet refresh when parent transfers cash 2024-03-20 13:44:14 +01:00
victorAnumudu 1e28a0e15b made kid wallet refresh when parent transfers cash 2024-03-20 13:43:23 +01:00
15 changed files with 132 additions and 43 deletions
+10 -1
View File
@@ -21,5 +21,14 @@
"emmet.triggerExpansionOnTab": true,
"emmet.includeLanguages": {
"javascript": "javascriptreact"
}
},
"cSpell.words": [
"completesignuplink",
"MOBILEUSER",
"MYFILES",
"mynotifications",
"PASSWORDRESET",
"TRANSFERSTART",
"WRENCHBOARD"
]
}
@@ -65,6 +65,9 @@ export default function SocketIOContextProvider({children}) {
if(message.action == "REFRESH_TASK" && message.audience == "PARENT"){ // for refreshing parent account when child accepts or rejects a job
dispatch(tableReload({type:'PARENTFAMILYTASKLIST'})) // dispatches to update parent family task list on parent side
}
if(message.action == "REFRESH_WALLET" && message.family_uid == user_uid && message.audience == "MEMBER"){ // for refreshing child wallet account when parent sends money to kid
dispatch(tableReload({type:'WALLETTABLE'})) // dispatches to update wallet balance on family side
}
// console.log('DATA', data)
});
}, [socket]);
@@ -15,8 +15,10 @@ function FamilyWallet({familyData}) {
useEffect(()=>{
setFamilyWallet({loading:true, data: []})
apiUrl.getFamilyWallet({family_uid:familyData?.uid}).then(res => {
apiUrl.getKidWallets({family_uid:familyData?.uid}).then(res => {
setFamilyWallet({loading:false, data: res?.data?.result_list || []})
console.log('familyData', familyData, res?.data?.result_list)
}).catch(error => {
setFamilyWallet({loading:false, data: []})
})
@@ -9,8 +9,9 @@ import usersService from "../../../../services/UsersService";
import LoadingSpinner from "../../../Spinners/LoadingSpinner";
import { PriceFormatter } from "../../../Helpers/PriceFormatter";
import { tableReload } from "../../../../store/TableReloads";
import { useDispatch } from "react-redux";
import { useDispatch, useSelector } from "react-redux";
import { apiConst } from "../../../../lib/apiConst";
import { SocketValues } from "../../../Contexts/SocketIOContext";
const validationSchema = Yup.object().shape({
// amount: Yup.string()
@@ -30,6 +31,11 @@ const validationSchema = Yup.object().shape({
});
function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
const {userDetails} = useSelector((state) => state?.userDetails); // Gets User Detail
const { parentAssignJobToKid } = SocketValues() // socket emit event from FULL account
const dispatch = useDispatch();
const apiUrl = new usersService();
@@ -54,6 +60,7 @@ function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
};
// FUNCTION TO PERFORM FAMILY TRANSFER
const handleAddFund = (values) => {
setRequestStatus({ loading: true, status: false, message: "" });
let senderBal = startTransfer?.data?.origing_current_balance || ""; // SENDER'S ACCOUNT BALANCE
@@ -132,6 +139,17 @@ function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
status: true,
message: "Transfer Successful",
});
//SENDS MESSAGE TO SOCKET TO UPDATE CHILD ACCOUNT
// message, room
let socketMsg = {
"audience": "MEMBER",
"action": "REFRESH_WALLET",
"family_uid": reqData.family_uid,
}
let socketRoom = `FAMILY-${userDetails.uid}`
parentAssignJobToKid(socketMsg, socketRoom) //SENDS MESSAGE TO SOCKET TO UPDATE CHILD ACCOUNT
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
dispatch(tableReload({ type: "WALLETTABLE" })); // UPDATES PARENT WALLET ACCOUNT
@@ -170,13 +188,13 @@ function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
return (
<ModalCom action={action} situation={situation}>
<div className="relative logout-modal-wrapper lg:w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
<div className="modal-header-con">
<h1 className="modal-title">
Add Fund
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
className="modal-close-btn"
onClick={action}
>
<svg
@@ -271,7 +289,7 @@ function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
<div className="field w-full mb-[0.5rem]">
<div className="w-full">
<label
htmlFor="Job Delivery Details"
htmlFor="job-label"
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1"
>
Comment
+8 -8
View File
@@ -248,13 +248,13 @@ const FamilyForm = ({
}) => {
return (
<div className="logout-modal-wrapper w-11/12 lg:w-[460px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple dark:border-[#5356fb29] ">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
<div className="modal-header-con">
<h1 className="modal-title">
Add Members
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
className="modal-close-btn"
onClick={popUpHandler}
>
<CloseIcon />
@@ -267,8 +267,8 @@ const FamilyForm = ({
name="first_name"
type="text"
parentClass="flex items-center gap-1 w-full"
labelClass="flex-[0.2] mb-0"
inputClass="flex-[0.8] input-curve lg border border-[#dce4e9]"
labelClass="flex-[0.4] mb-0"
inputClass="flex-[0.6] input-curve lg border border-[#dce4e9]"
fieldClass="px-2"
value={first_name}
inputHandler={inputHandler}
@@ -279,8 +279,8 @@ const FamilyForm = ({
name="last_name"
type="text"
parentClass="flex items-center gap-1 w-full"
labelClass="flex-[0.2] mb-0"
inputClass="flex-[0.8] input-curve lg border border-[#dce4e9]"
labelClass="flex-[0.4] mb-0"
inputClass="flex-[0.6] input-curve lg border border-[#dce4e9]"
fieldClass="px-2"
value={last_name}
inputHandler={inputHandler}
@@ -289,7 +289,7 @@ const FamilyForm = ({
{/* Age dropdown */}
<div className="">
<label
className="input-label text-[#181c32] dark:text-white text-[15px] font-semibold"
className="job-label"
htmlFor="age-selection"
>
Birthday: (Year/Month)
+5 -5
View File
@@ -89,13 +89,13 @@ export default function AddGroup({ action, situation, setUpdateList }) {
return (
<ModalCom action={action} situation={situation}>
<div className="logout-modal-wrapper lg:w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
<div className="modal-header-con">
<h1 className="modal-title">
Add Group
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
className="modal-close-btn"
onClick={action}
>
<svg
@@ -139,9 +139,9 @@ export default function AddGroup({ action, situation, setUpdateList }) {
<button
onClick={action}
type="button"
className="text-base text-light-red tracking-wide "
className="w-[152px] h-[46px] flex justify-center items-center rounded-full text-base text-light-red tracking-wide border border-light-red"
>
<span className="border-b dark:border-[#5356fb29] border-light-red">
<span className="">
Cancel
</span>
</button>
+3 -3
View File
@@ -21,13 +21,13 @@ export default function DeleteMember({action, situation, details}) {
situation={situation}
>
<div className="logout-modal-wrapper lg:w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
<div className="modal-header-con">
<h1 className="modal-title">
Remove Member
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
className="modal-close-btn"
onClick={action}
>
<svg
+5 -3
View File
@@ -229,13 +229,15 @@ export default function MemberList({
// iconName="message"
/>
</div>
<div className="input-item w-full">
</div>
<div className="sm:flex gap-2 items-center">
<div className="input-item my-2 w-full sm:w-9/12">
<InputCom
labelClass="tracking-wider"
fieldClass="sm:px-6 px-2"
value={fields.email}
inputHandler={handleFieldsChange}
inputClass="xl:w-[16rem] 2xl:w-full"
inputClass=""
placeholder="Email"
// label="Email"
name="email"
@@ -243,7 +245,7 @@ export default function MemberList({
// iconName="message"
/>
</div>
<div className="flex justify-end items-end">
<div className="flex justify-end items-end w-full sm:w-3/12">
{requestState.loading ? (
<LoadingSpinner size="8" color="sky-blue" />
) : (
+3 -3
View File
@@ -546,13 +546,13 @@ function ActiveJobs(props) {
{/* MESSAGE SECTION */}
<div className="w-full lg:w-1/2">
<div className="flex justify-between items-center gap-5">
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2">
<div className="flex justify-between items-center gap-5 justify-between">
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2 justify-between">
<span>Message</span>
<button
type="button"
onClick={popUpHandler}
className="text-[12px] tracking-wider text-emerald-600 dark:text-emerald-300"
className="text-[12px] tracking-wider text-gray-400 dark:text-slate-400"
>
View all
</button>
+4 -1
View File
@@ -9,6 +9,9 @@ const FamilyWalletBox = lazy(() => import("./FamilyWalletBox"));
const FamilyWalletCon = () => {
const apiCall = new usersService();
// const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
const {userDetails} = useSelector((state) => state?.userDetails); // GETS USER INFO
const { walletTable } = useSelector((state) => state.tableReload);
const [paymentHistory, setPaymentHistory] = useState({
@@ -23,7 +26,7 @@ const FamilyWalletCon = () => {
const getFamilyWalletBal = () => {
setFamilyWalletBal({loading:true, data: []})
apiCall.getFamilyWallet({family_uid: localStorage.getItem("uid")}).then(res => {
apiCall.getFamilyWallet({family_uid: userDetails.uid}).then(res => {
setFamilyWalletBal({loading:false, data: res?.data?.result_list})
}).catch(error => {
setFamilyWalletBal({loading:false, data: []})
+1
View File
@@ -9,6 +9,7 @@ export default function OffersInterest(props) {
const filterHandler = (value) => {
setValue(value);
};
return (
<Layout>
<CommonHead
+13 -7
View File
@@ -89,7 +89,9 @@ export default function MobileSidebar({
<ul className="flex flex-col space-y-6">
{/* Using mini component reduces the bulk amount of html */}
<ListItem
title= {userDetails?.account_type == "FULL" ? "Dashboard" : "Home"}
title={
userDetails?.account_type == "FULL" ? "Dashboard" : "Home"
}
route="/"
sidebar={sidebar}
iconName="new-dashboard"
@@ -190,17 +192,21 @@ export default function MobileSidebar({
<div className="items">
<ul className="flex flex-col space-y-6">
{[
{ name: "List", path: "/myjobs", iconName: "job-list" },
{
name: "List",
path: "/myjobs",
iconName: "job-list",
},
// {
// name: "Waiting",
// path: "/pend-interest",
// iconName: "pending-job",
// },
{
name: "Offers",
path: "/my-offers",
iconName: "pending-job",
},
{
name: "Waiting",
path: "/pend-interest",
iconName: "pending-job",
},
{
name: "Active",
path: "/my-active-jobs",
+33
View File
@@ -4,6 +4,7 @@ import { NavLink } from "react-router-dom";
//import SideStatistics from "./SideStatistics";
import { localImgLoad } from "../../lib";
import DarkModeContext from "../Contexts/DarkModeContext";
import Icons from "../Helpers/Icons";
export default function RightSideBar({ myJobList }) {
const filterDatas = ["Last 15 days", "Last Month", "Last 6 month"];
@@ -81,6 +82,19 @@ export default function RightSideBar({ myJobList }) {
{/* action */}
</div>
<div className="item flex space-x-3 items-center mb-4">
{/* image */}
<div className="w-8 h-8 rounded-full flex items-center justify-center">
<Icons name="pending-job" />
</div>
{/* name */}
<div>
<p className="text-thin-light-gray text-base font-medium">
<NavLink to="/pend-interest">Waiting</NavLink>
</p>
</div>
{/* action */}
</div>
<div className="item flex space-x-3 items-center mb-4">
{/* image */}
<div className="w-8 h-8 rounded-full">
@@ -235,6 +249,7 @@ export default function RightSideBar({ myJobList }) {
/>
</svg>
)}
</span>
<p className="text-thin-light-gray text-base font-medium">
{darkMode.theme === "light" ? "Dark" : "Light"} Mode
@@ -274,6 +289,24 @@ export default function RightSideBar({ myJobList }) {
{/* action */}
</div>
<div className="px-8 item flex space-x-3 items-center mb-4">
{/* image */}
<div className="w-8 h-8 p-[4px] rounded-full">
<img
src={localImgLoad("images/icons/job_active.svg")}
className="w-full h-full"
alt="Active Task"
/>
</div>
{/* name */}
<div>
<p className="text-thin-light-gray text-base font-medium">
<NavLink to="/offer-interest">Offers Interest</NavLink>
</p>
</div>
{/* action */}
</div>
<div className="px-8 item flex space-x-3 items-center mb-4">
{/* image */}
<div className="w-8 h-8 p-[4px] rounded-full">
+5 -5
View File
@@ -216,11 +216,11 @@ export default function Sidebar({
path: "/myjobs",
iconName: "job-list",
},
{
name: "Waiting",
path: "/pend-interest",
iconName: "pending-job",
},
// {
// name: "Waiting",
// path: "/pend-interest",
// iconName: "pending-job",
// },
{
name: "Offers",
path: "/my-offers",
+13 -1
View File
@@ -1174,7 +1174,7 @@ class usersService {
return this.postAuxEnd("/suggeststatus", postData);
}
// FUNCTION TO GET FAMILY WALLET
// FUNCTION TO GET FAMILY WALLET AS A KID
getFamilyWallet(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
@@ -1186,6 +1186,18 @@ class usersService {
return this.postAuxEnd("/familywallet", postData);
}
// FUNCTION TO GET FAMILY WALLET AS A PARENT
getKidWallets(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: apiConst.WRENCHBOARD_FAMILY_WALLET,
...reqData,
};
return this.postAuxEnd("/kidwallets", postData);
}
// FUNCTION TO START FAMILY TRANSFER
familyTransferStart(reqData) {
var postData = {