Merge branch 'family-resources' of WrenchBoard/Users-Wrench into master
This commit is contained in:
@@ -18,6 +18,8 @@ export default function FamilyDash({ familyOffers, MyActiveJobList }) {
|
|||||||
|
|
||||||
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
||||||
|
|
||||||
|
const { familyResources:{ tab_categories } } = useSelector((state) => state.familyResources);
|
||||||
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
let [reloadBanner, setReloadBanner] = useState(0)
|
let [reloadBanner, setReloadBanner] = useState(0)
|
||||||
@@ -61,12 +63,11 @@ export default function FamilyDash({ familyOffers, MyActiveJobList }) {
|
|||||||
{/* <CommonHead commonHeadData={props.commonHeadData} /> */}
|
{/* <CommonHead commonHeadData={props.commonHeadData} /> */}
|
||||||
|
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="text-white mb-4 p-2 w-full rounded-xl grid grid-cols-1 sm:grid-cols-2 bg-sky-blue place-content-center">
|
<div className="text-white mb-4 p-2 w-full rounded-xl bg-sky-blue place-content-center">
|
||||||
<div className="w-full flex gap-4">
|
<div className="w-full flex flex-wrap gap-x-4">
|
||||||
<p className="text-lg font-normal">Welcome</p>
|
<p className="text-lg font-normal">Welcome</p>
|
||||||
<div className="self-center">
|
<div className="">
|
||||||
<h1 className="m-0 text-lg font-normal">{`${userDetails?.firstname} ${userDetails?.lastname}`}</h1>
|
<h1 className="text-lg font-normal">{`${userDetails?.firstname} ${userDetails?.lastname}`}</h1>
|
||||||
<p className="-mt-1 text-sm">Email</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full text-sm flex justify-end items-end">
|
<div className="w-full text-sm flex justify-end items-end">
|
||||||
@@ -87,12 +88,10 @@ export default function FamilyDash({ familyOffers, MyActiveJobList }) {
|
|||||||
<div className="h-full w-full">
|
<div className="h-full w-full">
|
||||||
<img className="w-full h-[12rem] object-cover object-left rounded-t-xl" src={content.banner.image} alt='banner image' />
|
<img className="w-full h-[12rem] object-cover object-left rounded-t-xl" src={content.banner.image} alt='banner image' />
|
||||||
<div className="h-[7rem] flex flex-col justify-between">
|
<div className="h-[7rem] flex flex-col justify-between">
|
||||||
<div className="px-2 py-1 border-b border-slate-300 h-[5.4rem] flex flex-col gap-2">
|
<div className="px-2 py-1 border-b border-slate-300 h-[5.4rem] overflow-hidden flex flex-col gap-2">
|
||||||
<h1 className="text-lg text-[#083e21] dark:text-white font-bold tracking-wide">{content.banner.text}</h1>
|
<h1 className="text-lg text-[#083e21] dark:text-white font-bold tracking-wide">{content.banner.text}</h1>
|
||||||
<p className="text-sm text-black dark:text-white">{content.banner.description}</p>
|
<p className="text-sm text-black dark:text-white">{content.banner.description}</p>
|
||||||
</div>
|
</div>
|
||||||
{/* Horizontal Line */}
|
|
||||||
{/* <div className="w-full h-[1px] bg-slate-300"></div> */}
|
|
||||||
|
|
||||||
<div className="px-2 py-1 flex justify-between items-center">
|
<div className="px-2 py-1 flex justify-between items-center">
|
||||||
<span className="text-slate-400 dark:text-slate-200 text-sm">6w ago</span>
|
<span className="text-slate-400 dark:text-slate-200 text-sm">6w ago</span>
|
||||||
@@ -111,36 +110,39 @@ export default function FamilyDash({ familyOffers, MyActiveJobList }) {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{tab_categories?.data &&
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<h1 className="my-4 text-26 font-bold text-dark-gray dark:text-white tracking-wide">Resources</h1>
|
<h1 className="my-4 text-26 font-bold text-dark-gray dark:text-white tracking-wide">Resources</h1>
|
||||||
<div className="w-full grid grid-cols-2 md:grid-cols-3 gap-2 md:gap-4">
|
<div className="w-full grid grid-cols-2 md:grid-cols-3 gap-2 md:gap-4">
|
||||||
{[1,2,3,4,5].map((item, index) => (
|
{tab_categories.data.map((item) => {
|
||||||
<Link key={item} to={`/`} className={`rounded-xl bg-white dark:bg-dark-white shadow-md flex justify-center items-center transition-all duration-300 hover:shadow-sm`}>
|
if(item.enabled){
|
||||||
<div className="h-full w-full">
|
return (
|
||||||
<img className="w-full h-[12rem] object-cover object-left rounded-t-xl" src={''} alt='banner image' />
|
<Link key={item.uid} to={item?.action} className={`rounded-xl bg-white dark:bg-dark-white shadow-md flex justify-center items-center transition-all duration-300 hover:shadow-sm`}>
|
||||||
<div className="h-[7rem] flex flex-col justify-between">
|
<div className="h-full w-full">
|
||||||
<div className="px-2 py-1 border-b border-slate-300 h-[5.4rem] flex flex-col gap-2">
|
<img className="w-full h-[12rem] object-cover rounded-t-xl" src={item?.banner} alt='banner image' />
|
||||||
<h1 className="text-lg text-[#083e21] dark:text-white font-bold tracking-wide">{'Heading'}</h1>
|
<div className="h-[7rem] flex flex-col justify-between">
|
||||||
<p className="text-sm text-black dark:text-white">{'Description'}</p>
|
<div className="px-2 py-1 border-b border-slate-300 h-[5.4rem] overflow-hidden flex flex-col gap-2">
|
||||||
</div>
|
<h1 className="text-lg text-[#083e21] dark:text-white font-bold tracking-wide">{item?.content}</h1>
|
||||||
{/* Horizontal Line */}
|
{/* <p className="text-sm text-black dark:text-white">{'Description'}</p> */}
|
||||||
{/* <div className="w-full h-[1px] bg-slate-300"></div> */}
|
</div>
|
||||||
|
|
||||||
<div className="px-2 py-1 flex justify-between items-center">
|
<div className="px-2 py-1 flex justify-between items-center">
|
||||||
<span className="text-slate-400 dark:text-slate-200 text-sm">6w ago</span>
|
<span className="text-slate-400 dark:text-slate-200 text-sm">6w ago</span>
|
||||||
{/* Dots */}
|
{/* Dots */}
|
||||||
<div className="flex justify-center gap-1">
|
<div className="flex justify-center gap-1">
|
||||||
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
||||||
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
||||||
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Link>
|
||||||
</Link>
|
)}
|
||||||
))}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ export const apiConst = {
|
|||||||
WRENCHBOARD_ACCOUNT_HOMEBANNERS: 11200,
|
WRENCHBOARD_ACCOUNT_HOMEBANNERS: 11200,
|
||||||
WRENCHBOARD_ACCOUNT_PLAYGROUND: 11201,
|
WRENCHBOARD_ACCOUNT_PLAYGROUND: 11201,
|
||||||
WRENCHBOARD_ACCOUNT_FAMILY_BANNERS: 22005,
|
WRENCHBOARD_ACCOUNT_FAMILY_BANNERS: 22005,
|
||||||
|
WRENCHBOARD_ACCOUNT_FAMILY_RESOURCES: 22017,
|
||||||
|
|
||||||
WRENCHBOARD_ACCOUNT_RECENTS: 11202,
|
WRENCHBOARD_ACCOUNT_RECENTS: 11202,
|
||||||
WRENCHBOARD_ACCOUNT_NOTIFICATIONS: 11205,
|
WRENCHBOARD_ACCOUNT_NOTIFICATIONS: 11205,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { updateNotifications } from "../store/notifications";
|
|||||||
import { updateUserJobList } from "../store/userJobList";
|
import { updateUserJobList } from "../store/userJobList";
|
||||||
import { updateWalletDetails } from "../store/walletDetails";
|
import { updateWalletDetails } from "../store/walletDetails";
|
||||||
import { familyBannersList } from "../store/FamilyBannerList";
|
import { familyBannersList } from "../store/FamilyBannerList";
|
||||||
|
import { familyResources } from "../store/FamilyResources";
|
||||||
|
|
||||||
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||||
const apiCall = useMemo(() => new usersService(), []);
|
const apiCall = useMemo(() => new usersService(), []);
|
||||||
@@ -271,6 +272,23 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
getFamilyBanners()
|
getFamilyBanners()
|
||||||
}, [isLogin.status, familyBannersListTable]);
|
}, [isLogin.status, familyBannersListTable]);
|
||||||
|
|
||||||
|
//FUNCTION TO GET FAMILY RESOURCES
|
||||||
|
useEffect(() => {
|
||||||
|
if((!loggedIn && !isLogin.status) || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const getFamilyResourcesList = async () => { // FUNCTION TO GET FAMILY BANNERS
|
||||||
|
try {
|
||||||
|
const res = await apiCall.getFamilyResources();
|
||||||
|
dispatch(familyResources(res?.data?.result_list))
|
||||||
|
// console.log('RESPONSE', res?.data?.result_list)
|
||||||
|
} catch (error) {
|
||||||
|
console.log("Error getting tasks");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
getFamilyResourcesList()
|
||||||
|
}, [isLogin.status, familyBannersListTable]);
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// apiCall
|
// apiCall
|
||||||
// .getHeroJBanners()
|
// .getHeroJBanners()
|
||||||
|
|||||||
@@ -1245,11 +1245,11 @@ class usersService {
|
|||||||
member_id: localStorage.getItem("member_id"),
|
member_id: localStorage.getItem("member_id"),
|
||||||
sessionid: localStorage.getItem("session_token"),
|
sessionid: localStorage.getItem("session_token"),
|
||||||
action: apiConst.WRENCHBOARD_RELATIVE_INVITE,
|
action: apiConst.WRENCHBOARD_RELATIVE_INVITE,
|
||||||
...reqData
|
...reqData,
|
||||||
};
|
};
|
||||||
return this.postAuxEnd("/familyrelinvite", postData);
|
return this.postAuxEnd("/familyrelinvite", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// API FUNCTION TO FAMILY BANNERS
|
// API FUNCTION TO FAMILY BANNERS
|
||||||
getFamilyBannersList() {
|
getFamilyBannersList() {
|
||||||
var postData = {
|
var postData = {
|
||||||
@@ -1258,10 +1258,23 @@ class usersService {
|
|||||||
sessionid: localStorage.getItem("session_token"),
|
sessionid: localStorage.getItem("session_token"),
|
||||||
action: apiConst.WRENCHBOARD_ACCOUNT_FAMILY_BANNERS,
|
action: apiConst.WRENCHBOARD_ACCOUNT_FAMILY_BANNERS,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
offset: 1
|
offset: 1,
|
||||||
};
|
};
|
||||||
return this.postAuxEnd("/familybanners", postData);
|
return this.postAuxEnd("/familybanners", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// API FUNCTION TO FAMILY RESOURCES
|
||||||
|
getFamilyResources() {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: apiConst.WRENCHBOARD_ACCOUNT_FAMILY_RESOURCES,
|
||||||
|
limit: 20,
|
||||||
|
offset: 1,
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/familyresources", postData);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
||||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
familyResources: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const familyResourcesSlice = createSlice({
|
||||||
|
name: "familyResources",
|
||||||
|
initialState,
|
||||||
|
reducers: {
|
||||||
|
familyResources: (state,action) => {
|
||||||
|
state.familyResources = {...action.payload}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Action creators are generated for each case reducer function
|
||||||
|
export const { familyResources } = familyResourcesSlice.actions;
|
||||||
|
|
||||||
|
export default familyResourcesSlice.reducer;
|
||||||
+3
-1
@@ -9,6 +9,7 @@ import notificationsReducer from "./notifications";
|
|||||||
import userJobListReducer from "./userJobList";
|
import userJobListReducer from "./userJobList";
|
||||||
import walletDetails from "./walletDetails";
|
import walletDetails from "./walletDetails";
|
||||||
import familyBannerListReducer from "./FamilyBannerList"
|
import familyBannerListReducer from "./FamilyBannerList"
|
||||||
|
import familyResourcesReducer from './FamilyResources'
|
||||||
|
|
||||||
export default configureStore({
|
export default configureStore({
|
||||||
reducer: {
|
reducer: {
|
||||||
@@ -20,6 +21,7 @@ export default configureStore({
|
|||||||
commonHeadBanner: commonHeadBannerReducer,
|
commonHeadBanner: commonHeadBannerReducer,
|
||||||
notifications: notificationsReducer,
|
notifications: notificationsReducer,
|
||||||
walletDetails: walletDetails,
|
walletDetails: walletDetails,
|
||||||
familyBannersList: familyBannerListReducer
|
familyBannersList: familyBannerListReducer,
|
||||||
|
familyResources: familyResourcesReducer
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user