Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f4d9eb65c6 | |||
| 0baacb3057 | |||
| 9737c02d45 | |||
| 1048e51ddf | |||
| 6545c32326 | |||
| 6ea9078848 | |||
| 735cc0b296 | |||
| 29e058828b | |||
| 5d5542c221 | |||
| b59f92c89f | |||
| e01bfa369b |
@@ -60,6 +60,10 @@ import YourPages from "./views/YourPage_";
|
||||
import ParentWaitingPage from "./views/ParentWaitingPage";
|
||||
import FamilyPendingOfferPage from "./views/FamilyPendingOfferPage";
|
||||
import FamilyPastDuePage from "./views/FamilyPastDuePage";
|
||||
import FamBlogPage from "./views/FamBlogPage"
|
||||
import FamAIQuestionPage from "./views/FamAIQuestionPage"
|
||||
import FamMyFilesPage from "./views/FamMyFilesPage"
|
||||
import FamWorkInProgressPage from "./views/FamWorkInProgressPage";
|
||||
|
||||
export default function Routers() {
|
||||
return (
|
||||
@@ -135,6 +139,11 @@ export default function Routers() {
|
||||
<Route exact path="/suggested" element={<ParentWaitingPage />} />
|
||||
<Route exact path="/pastdue" element={<FamilyPastDuePage />} />
|
||||
<Route exact path="/pending" element={<FamilyPendingOfferPage />} />
|
||||
<Route exact path="/fam-blog" element={<FamBlogPage />} />
|
||||
<Route exact path="/ai-question" element={<FamAIQuestionPage />} />
|
||||
<Route exact path="/myfiles" element={<FamMyFilesPage />} />
|
||||
<Route exact path="/ai-lab" element={<FamAIQuestionPage />} />
|
||||
<Route exact path="/work-in-progress" element={<FamWorkInProgressPage />} />
|
||||
<Route
|
||||
exact
|
||||
path="/familysettings"
|
||||
|
||||
@@ -4,9 +4,15 @@ import usersService from "../../services/UsersService";
|
||||
import Layout from "../Partials/Layout";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import CommonHead from "../UserHeader/CommonHead";
|
||||
import { useSelector } from "react-redux";
|
||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||
|
||||
export default function BlogItem(props) {
|
||||
|
||||
const {
|
||||
userDetails: { account_type },
|
||||
} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details account type
|
||||
|
||||
const apiCall = new usersService()
|
||||
const navigate = useNavigate()
|
||||
|
||||
@@ -33,11 +39,26 @@ export default function BlogItem(props) {
|
||||
},[blog_id])
|
||||
return (
|
||||
<Layout>
|
||||
<CommonHead
|
||||
commonHeadData={props.commonHeadData}
|
||||
/>
|
||||
{account_type == 'FULL' &&
|
||||
<CommonHead
|
||||
commonHeadData={props.commonHeadData}
|
||||
/>
|
||||
}
|
||||
{ account_type == 'FAMILY' &&
|
||||
<div className="mb-5">
|
||||
<CustomBreadcrumb
|
||||
title = {blogdata?.data?.blogdata?.length > 0 ? blogdata?.data?.blogdata[0]?.post_title : 'Blog'}
|
||||
breadcrumb={
|
||||
[
|
||||
{ link: "/", title: "Home" },
|
||||
{ link: "/fam-blog", title: "Blogs", active: true},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
<div className="notification-page w-full mb-10">
|
||||
<div className="mb-5">
|
||||
{/* <div className="mb-5">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||
<span
|
||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||
@@ -45,7 +66,7 @@ export default function BlogItem(props) {
|
||||
{blogdata.data?.blogdata?.[0]?.post_title}
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="notification-wrapper w-full bg-white p-8 rounded-2xl">
|
||||
{blogdata?.loading ?
|
||||
<LoadingSpinner size='8' color='sky-blue' height='h-[100px]' />
|
||||
@@ -53,8 +74,8 @@ export default function BlogItem(props) {
|
||||
blogdata?.data?.blogdata && blogdata.data?.blogdata.length ?
|
||||
<div className="w-full">
|
||||
{/* heading */}
|
||||
<div className="sm:flex justify-between items-center mb-6">
|
||||
{/* <div className="mb-5">
|
||||
{/* <div className="sm:flex justify-between items-center mb-6">
|
||||
<div className="mb-5">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||
<span
|
||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||
@@ -62,10 +83,10 @@ export default function BlogItem(props) {
|
||||
{blogdata.data?.blogdata?.[0]?.post_title}
|
||||
</span>
|
||||
</h1>
|
||||
</div> */}
|
||||
{/* <div className="slider-btns flex space-x-4">
|
||||
</div> */}
|
||||
</div>
|
||||
</div>
|
||||
<div className="slider-btns flex space-x-4">
|
||||
</div>
|
||||
</div> */}
|
||||
<div dangerouslySetInnerHTML={{__html: blogdata.data?.blogdata?.[0]?.post_content}}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@ import SearchCom from "../Helpers/SearchCom";
|
||||
import FamilyMarketCard from "../Cards/FamilyMarketCard";
|
||||
import usersService from "../../services/UsersService";
|
||||
import SuggestTask from "../FamilyPopup/SuggestTask";
|
||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||
|
||||
export default function FamilyMarket() {
|
||||
const [popUp, setPopUp] = useState(false);
|
||||
@@ -53,12 +54,23 @@ export default function FamilyMarket() {
|
||||
<div className="notification-page w-full mb-10">
|
||||
<div className="notification-wrapper w-full">
|
||||
{/* heading */}
|
||||
<div className="sm:flex justify-between items-center mb-6">
|
||||
{/* <div className="sm:flex justify-between items-center mb-6">
|
||||
<div className="mb-5 sm:mb-0">
|
||||
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
|
||||
<span>Suggest Task to the Parents</span>
|
||||
</h1>
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="mb-5">
|
||||
<CustomBreadcrumb
|
||||
title = {'Suggest Task to the Parents'}
|
||||
breadcrumb={
|
||||
[
|
||||
{ link: "/", title: "Home" },
|
||||
{ link: "/familymarket", title: "Family Market", active: true},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{/* Body */}
|
||||
<div className="filter-section w-full items-center sm:flex justify-between mb-6">
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
import React from 'react'
|
||||
import Layout from '../Partials/Layout'
|
||||
import CustomBreadcrumb from '../Breadcrumb/CustomBreadcrumb'
|
||||
|
||||
export default function FamilyPastDue() {
|
||||
return (
|
||||
<Layout>
|
||||
<div>Family PastDue Page Here</div>
|
||||
<div className="mb-5">
|
||||
<CustomBreadcrumb
|
||||
title = {'Past Due'}
|
||||
breadcrumb={
|
||||
[
|
||||
{ link: "/", title: "Home" },
|
||||
{ link: "/pastdue", title: "Past Due", active: true},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className='w-full h-[20rem] rounded-2xl flex justify-center items-center text-black dark:text-white bg-white dark:bg-dark-white transition-all duration-300'>Family PastDue Page Here</div>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import Layout from '../Partials/Layout'
|
||||
import MyOffersFamilyTable from '../MyTasks/MyOffersFamilyTable'
|
||||
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
||||
import usersService from '../../services/UsersService';
|
||||
import CustomBreadcrumb from '../Breadcrumb/CustomBreadcrumb';
|
||||
|
||||
export default function FamilyPendingOffer() {
|
||||
const userApi = new usersService();
|
||||
@@ -25,8 +26,21 @@ export default function FamilyPendingOffer() {
|
||||
},[])
|
||||
return (
|
||||
<Layout>
|
||||
<div className="mb-5">
|
||||
<CustomBreadcrumb
|
||||
title = {'Ready to Start'}
|
||||
breadcrumb={
|
||||
[
|
||||
{ link: "/", title: "Home" },
|
||||
{ link: "/pending", title: "Pending", active: true},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{myOffersList.loading ?
|
||||
<div className='w-full flex justify-center items-center rounded-2xl bg-white'>
|
||||
<LoadingSpinner size='10' color='sky-blue' height='h-[20rem]' />
|
||||
</div>
|
||||
:
|
||||
myOffersList?.data?.result_list && myOffersList?.data?.result_list.length > 0 ?
|
||||
<MyOffersFamilyTable
|
||||
|
||||
@@ -112,29 +112,10 @@ export default function FamilyDash({ MyActiveJobList, serverImg }) {
|
||||
<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-4 gap-2 md:gap-4">
|
||||
{tab_categories.data.map((item) => {
|
||||
// onClick={()=>navigate('/resources', {state:{tab:'created'}})}
|
||||
let resourceState = ''
|
||||
switch(item?.action){
|
||||
case 'fam-blog':
|
||||
resourceState = 'blog'
|
||||
break
|
||||
case 'ai-question':
|
||||
resourceState = 'onsale'
|
||||
break
|
||||
case 'myfiles':
|
||||
resourceState = 'created'
|
||||
break
|
||||
case 'ai-lab':
|
||||
resourceState = 'onsale'
|
||||
break
|
||||
default:
|
||||
resourceState = 'blog'
|
||||
break
|
||||
}
|
||||
// console.log('EX', item.enabled, item?.action, resourceState)
|
||||
if(item.enabled){
|
||||
// if(item.enabled){
|
||||
// }
|
||||
return (
|
||||
<Link key={item.uid} to={'/resources'} state={{tab:resourceState}} className={`group rounded-xl bg-white dark:bg-dark-white shadow-md flex justify-center items-center transition-all duration-300 hover:shadow-sm`}>
|
||||
<Link key={item.uid} to={`/${item?.action}`} className={`group 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-full w-full">
|
||||
<div className="w-full h-[8rem] rounded-t-xl overflow-hidden">
|
||||
<img className="w-full h-full group-hover:scale-110 object-cover transition-all duration-300" src={item?.banner} alt='banner image' />
|
||||
@@ -151,7 +132,7 @@ export default function FamilyDash({ MyActiveJobList, serverImg }) {
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
)}
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Link } from "react-router-dom";
|
||||
import { toast } from "react-toastify";
|
||||
import activeAidsBanner from "../../assets/images/kids-waiting.jpg";
|
||||
import ParentWaitingTable from "./ParentWaitingTable";
|
||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||
|
||||
export default function ParentWaiting({ className }) {
|
||||
const [addFavorite, setValue] = useState(false);
|
||||
@@ -19,9 +20,20 @@ export default function ParentWaiting({ className }) {
|
||||
<>
|
||||
<div className={`overview-section w-full ${className || ""}`}>
|
||||
<div className="w-full mb-3 flex justify-between items-center gap-1">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||
{/* <h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||
Waiting for Parent to Get Started...
|
||||
</h1>
|
||||
</h1> */}
|
||||
|
||||
<CustomBreadcrumb
|
||||
title = {'Waiting for Parent to Get Started...'}
|
||||
breadcrumb={
|
||||
[
|
||||
{ link: "/", title: "Home" },
|
||||
{ link: "/suggested", title: "Suggested", active: true},
|
||||
]
|
||||
}
|
||||
/>
|
||||
|
||||
<Link
|
||||
to='/familymarket'
|
||||
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import Layout from '../Partials/Layout'
|
||||
|
||||
import usersService from '../../services/UsersService'
|
||||
import SearchCom from '../Helpers/SearchCom'
|
||||
import LoadingSpinner from '../Spinners/LoadingSpinner'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import CustomBreadcrumb from '../Breadcrumb/CustomBreadcrumb'
|
||||
import { localImgLoad } from '../../lib'
|
||||
|
||||
export default function FamAIQuestion() {
|
||||
const apiCall = new usersService()
|
||||
|
||||
const {pathname} = useLocation()
|
||||
|
||||
const [requestStatus, setRequestStatus] = useState({loading: false, status: false, message: ''})
|
||||
|
||||
const [error, setError] = useState({question: '', searchPhrase: ''})
|
||||
|
||||
const [questions, setQuestions] = useState({loading: true, data: []})
|
||||
|
||||
const [askQuestion, setAskQuestion] = useState({question: '', searchPhrase: ''})
|
||||
|
||||
const changeAskQuestion = ({target: {name, value}}) => {
|
||||
setAskQuestion(prev => ({...prev, [name]: value}))
|
||||
setRequestStatus({loading: false, status: false, message: ''})
|
||||
}
|
||||
|
||||
const onSearch = () => {
|
||||
setError({question: '', searchPhrase: ''}) // sets error to false
|
||||
if(!askQuestion.question){
|
||||
return setError(prev => ({...prev, question: 'Select a question'}))
|
||||
}
|
||||
if(!askQuestion.searchPhrase){
|
||||
return setError(prev => ({...prev, searchPhrase: 'Enter search parameter'}))
|
||||
}
|
||||
if(askQuestion.searchPhrase.length > 60){
|
||||
return setError(prev => ({...prev, searchPhrase: 'Max of 60 characters'}))
|
||||
}
|
||||
|
||||
setRequestStatus({loading: true, status: false, message: ''})
|
||||
let reqData = {
|
||||
question_key: '',
|
||||
question: ''
|
||||
}
|
||||
apiCall.askResourcesResult().then(res => {
|
||||
console.log(res.data.choices[0].text)
|
||||
if(!res.data || res.data?.choices?.length < 1){
|
||||
setRequestStatus({loading: false, status: false, message: 'No result found!'})
|
||||
}
|
||||
setRequestStatus({loading: false, status: false, message: res.data?.choices[0].text})
|
||||
}).catch(error => {
|
||||
setRequestStatus({loading: false, status: false, message: 'No result found!'})
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
apiCall.getResourceList().then(res => {
|
||||
setQuestions({loading: false, data: res.data?.ask_categories?.data})
|
||||
}).catch(error => {
|
||||
setQuestions({loading: false, data: []})
|
||||
console.log('ERROR', error)
|
||||
})
|
||||
}, [])
|
||||
return (
|
||||
<Layout>
|
||||
<>
|
||||
<div className='mb-4'>
|
||||
<CustomBreadcrumb
|
||||
title={pathname == '/ai-question' ? 'Questions' : 'AI Lab'}
|
||||
breadcrumb = {
|
||||
[
|
||||
{ link: "/", title: "Home" },
|
||||
{ link: pathname == '/ai-question' ? '/ai-question' : '/ai-lab', title: pathname == '/ai-question' ? 'Questions' : 'AI Lab', active: true},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className={`w-full`}>
|
||||
<div className="main-container w-full">
|
||||
<div className="filter-section w-fullmb-6">
|
||||
{/* <h1 className="text-xl lg:text-2xl font-bold text-dark-gray dark:text-white tracking-wide">Ask our A.I</h1> */}
|
||||
<div className="mt-2 lg:grid grid-cols-2 gap-2 h-full lg:h-[500px]">
|
||||
<div className="h-full mb-5 lg:mb-0">
|
||||
<img className="w-full h-full rounded-2xl" src={localImgLoad(`images/resources-ask.jpg`)} alt='AI' />
|
||||
</div>
|
||||
<div className="p-8 bg-white rounded-2xl h-full">
|
||||
<div className="input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base">
|
||||
<select value={askQuestion.question} name='question' onChange={changeAskQuestion} className="input-field px-2 placeholder:text-base text-dark-gray w-full h-full tracking-wide dark:bg-[#11131F] bg-[#fafafa] focus:ring-0 focus:outline-none">
|
||||
{questions.loading ?
|
||||
<option value='' className="">Loading...</option>
|
||||
:
|
||||
<>
|
||||
<option value='' className="">Find answer on:</option>
|
||||
{questions.data.length > 0 && questions.data.map((item, index)=>(
|
||||
<option key={index} value={item.question_key} className="">{item.name}</option>
|
||||
))}
|
||||
</>
|
||||
}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
{error.question && <p className="text-red-500 text-[12px]">{error.question}</p>}
|
||||
{/* filter-search */}
|
||||
<div className="w-full my-5 border-2 rounded-full">
|
||||
<SearchCom
|
||||
name={'searchPhrase'}
|
||||
value={askQuestion.searchPhrase}
|
||||
handleSearch={changeAskQuestion}
|
||||
/>
|
||||
</div>
|
||||
{error.searchPhrase && <p className="text-red-500 text-[12px]">{error.searchPhrase}</p>}
|
||||
<div className="w-full flex justify-end items-center border-b-2 pb-4">
|
||||
<button
|
||||
onClick={onSearch}
|
||||
disabled={requestStatus.loading}
|
||||
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
||||
>
|
||||
Search
|
||||
</button>
|
||||
</div>
|
||||
<div className="search_result my-2 max-h-[400px] overflow-auto">
|
||||
{requestStatus.loading ?
|
||||
<LoadingSpinner size='8' color='sky-blue' height='h-[100px]' />
|
||||
:
|
||||
<p className="py-2 text-sm font-bold text-dark-gray dark:text-white tracking-wide">{requestStatus.message}</p>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import Layout from '../Partials/Layout'
|
||||
import SearchCom from '../Helpers/SearchCom'
|
||||
import DataIteration from '../Helpers/DataIteration'
|
||||
import FamBlogItem from './FamBlogItem'
|
||||
import CustomBreadcrumb from '../Breadcrumb/CustomBreadcrumb'
|
||||
import usersService from '../../services/UsersService'
|
||||
import LoadingSpinner from '../Spinners/LoadingSpinner'
|
||||
|
||||
export default function FamBlog() {
|
||||
|
||||
const [blogData, setBlogData] = useState({loading: true, data: []});
|
||||
|
||||
const [filteredBlog, setFilteredBlog] = useState({value: '', data:[]}) // State to hold filter blog
|
||||
|
||||
const handleFilterBlog = ({target}) => {
|
||||
let filterWord = target.value
|
||||
let filteredData = []
|
||||
if(!filterWord){
|
||||
filteredData = blogData?.data?.blogdata
|
||||
}else{
|
||||
filteredData = blogData?.data?.blogdata?.filter(item => item.post_title.toLowerCase().startsWith(filterWord.toLowerCase()))
|
||||
}
|
||||
setFilteredBlog({value:target.value, data: filteredData})
|
||||
}
|
||||
|
||||
const api = new usersService();
|
||||
const getFamilyBlog = async () => {
|
||||
setBlogData({loading: true, data: []})
|
||||
try {
|
||||
const res = await api.getFamilyBlogData();
|
||||
setBlogData({loading: false, data:res.data});
|
||||
setFilteredBlog(prev => ({...prev, data:res.data?.blogdata}))
|
||||
} catch (error) {
|
||||
setBlogData({loading: false, data: []})
|
||||
throw new Error("Error getting mode");
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getFamilyBlog();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<>
|
||||
<div className='mb-4'>
|
||||
<CustomBreadcrumb
|
||||
title='Blog'
|
||||
breadcrumb = {
|
||||
[
|
||||
{ link: "/", title: "Home" },
|
||||
{ link: "/fam-blog", title: "Blogs", active: true},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className={`w-full`}>
|
||||
<div className="main-container w-full">
|
||||
<div className="filter-section w-full items-center sm:flex justify-between mb-6">
|
||||
{/* filter-search */}
|
||||
{blogData?.data?.blogdata?.length > 0 &&
|
||||
<div className="sm:w-1/2 w-full sm:pr-20 pr-0 mb-5 sm:mb-0">
|
||||
<SearchCom
|
||||
placeholder='Search Blog Items...'
|
||||
value={filteredBlog.value}
|
||||
handleSearch={handleFilterBlog}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div className="content-section w-full-width">
|
||||
{blogData.loading ?
|
||||
<div className='flex justify-center items-center bg-white rounded-2xl'>
|
||||
<LoadingSpinner size='10' color='sky-blue' height='h-[20rem]' />
|
||||
</div>
|
||||
: blogData?.data?.blogdata?.length > 0 && filteredBlog?.data?.length > 0?
|
||||
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-[30px]">
|
||||
<DataIteration
|
||||
datas={filteredBlog?.data}
|
||||
startLength={process.env.REACT_APP_ZERO_STATE}
|
||||
endLength={filteredBlog?.data?.length}
|
||||
>
|
||||
{({ datas }) => (
|
||||
<div key={Math.random()}>
|
||||
<FamBlogItem
|
||||
datas={datas}
|
||||
bg={blogData?.data?.image_url && blogData?.data?.image_url}
|
||||
className=''
|
||||
hidden={false}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</DataIteration>
|
||||
</div>
|
||||
:
|
||||
<div className='h-[30rem] flex justify-center items-center bg-white rounded-2xl'>
|
||||
<p>No Blog Found</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import React from 'react'
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
export default function FamBlogItem({datas, className, bg, hidden=false}) {
|
||||
return (
|
||||
<div
|
||||
className={`card-style-two w-full h-[336px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
<div className="flex flex-col justify-between w-full h-full">
|
||||
<div className="thumbnail-area w-full">
|
||||
<div
|
||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden bg-sky-200"
|
||||
style={{
|
||||
background: `url(${`${bg}${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
||||
}}
|
||||
>
|
||||
<div className="product-two-options flex justify-between mb-5 relative">
|
||||
<div className="status">
|
||||
{datas?.isActive && (
|
||||
<span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">
|
||||
Active
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{hidden && <div className="flex justify-center"></div>}
|
||||
</div>
|
||||
</div>
|
||||
<div className="details-area">
|
||||
{/* title */}
|
||||
<Link to={`/blog-page?blog_id=${datas?.ID ? datas.ID : '1'}`} className="mb-2.5" rel="noreferrer">
|
||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
{datas?.post_title ? datas?.post_title : "dummy title..."}
|
||||
</h1>
|
||||
</Link>
|
||||
<div className="flex justify-between">
|
||||
<div className="flex items-center space-x-2"></div>
|
||||
<div className="my-1">
|
||||
<Link
|
||||
to={`/blog-page?blog_id=${datas?.ID ? datas.ID : '1'}`}
|
||||
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
|
||||
rel="noreferrer"
|
||||
>
|
||||
View
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
import Layout from '../Partials/Layout'
|
||||
|
||||
export default function FamGames() {
|
||||
return (
|
||||
<Layout>
|
||||
<div>Family Games Page</div>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
import Layout from '../Partials/Layout'
|
||||
|
||||
export default function FamInterest() {
|
||||
return (
|
||||
<Layout>
|
||||
<div>Fam Interesting Dummy Page</div>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
import React, { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import defaultImg from "../../assets/images/myfiles/default.svg";
|
||||
import localImgLoad from "../../lib/localImgLoad";
|
||||
import { PaginatedList, handlePagingFunc } from "../../components/Pagination";
|
||||
import Layout from "../Partials/Layout";
|
||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||
|
||||
export default function FamMyFiles() {
|
||||
|
||||
let uploadedFiles = [] // To be updated Later from replaced with real data from API CALL
|
||||
|
||||
const [currentPage, setCurrentPage] = useState(0);
|
||||
const indexOfFirstItem = Number(currentPage);
|
||||
const indexOfLastItem =
|
||||
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||
const currentFiles = uploadedFiles?.data?.slice(
|
||||
indexOfFirstItem,
|
||||
indexOfLastItem
|
||||
);
|
||||
const handlePagination = (e) => {
|
||||
handlePagingFunc(e, setCurrentPage);
|
||||
};
|
||||
return (
|
||||
<Layout>
|
||||
<>
|
||||
<div className=''>
|
||||
<CustomBreadcrumb
|
||||
title='My Files'
|
||||
breadcrumb = {
|
||||
[
|
||||
{ link: "/", title: "Home" },
|
||||
{ link: "/myfiles", title: "My Files", active: true},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-4 w-full flex justify-end item-center">
|
||||
<Link
|
||||
to="/my-uploads"
|
||||
className="btn-gradient lg:flex hidden w-[153px] h-[46px] rounded-full text-white justify-center items-center"
|
||||
>
|
||||
Add My Item
|
||||
</Link>
|
||||
</div>
|
||||
<div
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow relative min-h-[520px]`}
|
||||
>
|
||||
<div className="header w-full sm:flex justify-between items-center mb-5">
|
||||
<div className="flex space-x-2 items-center mb-2 sm:mb-0">
|
||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
My Uploads
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className="relative w-full overflow-x-auto sm:rounded-lg">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<tbody>
|
||||
<>
|
||||
{uploadedFiles?.data && uploadedFiles?.data.length ? (
|
||||
currentFiles.map((value, idx) => {
|
||||
let addedDate = value?.added?.split(" ")[0];
|
||||
let formattedSize = formatFileSize(value?.file_size);
|
||||
let imageLink = `${uploadedFiles?.image}${localStorage.getItem('session_token')}/myfile/${value.file_uid}`
|
||||
return (
|
||||
<tr
|
||||
key={value?.file_uid}
|
||||
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
||||
>
|
||||
<td className=" py-4">
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
<div className="w-[60px] h-[60px] p-2 bg-alice-blue rounded-full overflow-hidden flex justify-center items-center">
|
||||
<img
|
||||
src={
|
||||
localImgLoad(
|
||||
`images/myfiles/${value.banner}`
|
||||
) || defaultImg
|
||||
}
|
||||
alt="data"
|
||||
className="w-full h-full rounded-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col flex-[0.9]">
|
||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||
{value.title || "Dummy Text"}
|
||||
</h1>
|
||||
<div>
|
||||
{value.description || "Dummy Description"}
|
||||
</div>
|
||||
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
|
||||
Added:{" "}
|
||||
<span className="text-purple">{addedDate}</span>
|
||||
</span>
|
||||
<div className="flex gap-4 items-center">
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
File Name:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{value.file_name}
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
File Size:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{formattedSize}
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
File Type:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{value?.file_type}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="text-right py-4 px-2">
|
||||
<div className="flex justify-center items-center">
|
||||
<a
|
||||
href={imageLink}
|
||||
title="download"
|
||||
// className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
>
|
||||
<img
|
||||
src={localImgLoad('images/icons/download-arrow.svg')}
|
||||
alt='download-link'
|
||||
className="w-auto h-6 flex justify-center items-center"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})
|
||||
) : (
|
||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<td className="p-2" colSpan={3}>
|
||||
No Files Currently!
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</>
|
||||
</tbody>
|
||||
</table>
|
||||
{/* PAGINATION BUTTON */}
|
||||
<PaginatedList
|
||||
onClick={handlePagination}
|
||||
prev={currentPage == 0 ? true : false}
|
||||
next={
|
||||
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
|
||||
uploadedFiles?.data?.length
|
||||
? true
|
||||
: false
|
||||
}
|
||||
data={uploadedFiles?.data}
|
||||
start={indexOfFirstItem}
|
||||
stop={indexOfLastItem}
|
||||
/>
|
||||
{/* END OF PAGINATION BUTTON */}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
const formatFileSize = (sizeInBytes) => {
|
||||
if (sizeInBytes < 1024) {
|
||||
return `${sizeInBytes} bytes`;
|
||||
} else if (sizeInBytes < 1024 * 1024) {
|
||||
const sizeInKB = (sizeInBytes / 1024).toFixed(2);
|
||||
return `${sizeInKB} KB`;
|
||||
} else {
|
||||
const sizeInMB = (sizeInBytes / (1024 * 1024)).toFixed(2);
|
||||
return `${sizeInMB} MB`;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
import React from 'react'
|
||||
import Layout from '../Partials/Layout'
|
||||
import CustomBreadcrumb from '../Breadcrumb/CustomBreadcrumb'
|
||||
|
||||
export default function FamWorkInProgress() {
|
||||
return (
|
||||
<Layout>
|
||||
<>
|
||||
<div className='mb-4'>
|
||||
<CustomBreadcrumb
|
||||
title='Games and Interest'
|
||||
breadcrumb = {
|
||||
[
|
||||
{ link: "/", title: "Home" },
|
||||
{ link: "/work-in-progress", title: "Games and Interest", active: true},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className='h-[20rem] w-full bg-white shadow-lg flex justify-center items-center rounded-2xl'>Work in Progress Coming Soon</div>
|
||||
</>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
@@ -1279,6 +1279,20 @@ class usersService {
|
||||
};
|
||||
return this.postAuxEnd("/familyresources", postData);
|
||||
}
|
||||
|
||||
// API FUNCTION TO GET FAMILY BLOG DATA
|
||||
getFamilyBlogData() {
|
||||
var postData = {
|
||||
uuid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
page: 0,
|
||||
offset: 0,
|
||||
limit: 100,
|
||||
};
|
||||
return this.postAuxEnd("/blogdata", postData);
|
||||
}
|
||||
|
||||
/*
|
||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
import FamAIQuestion from '../components/familyResources/FamAIQuestion'
|
||||
|
||||
export default function FamAIQuestionPage() {
|
||||
return (
|
||||
<>
|
||||
<FamAIQuestion />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
import FamBlog from '../components/familyResources/FamBlog'
|
||||
|
||||
export default function FamBlogPage() {
|
||||
return (
|
||||
<>
|
||||
<FamBlog />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import React from 'react'
|
||||
import FamGames from '../components/familyResources/FamGames'
|
||||
export default function FamGamesPage() {
|
||||
return (
|
||||
<>
|
||||
<FamGames />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
import FamInterest from '../components/familyResources/FamInterest'
|
||||
|
||||
export default function FamInterestPage() {
|
||||
return (
|
||||
<>
|
||||
<FamInterest />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
import FamMyFiles from '../components/familyResources/FamMyFiles'
|
||||
|
||||
export default function FamMyFilesPage() {
|
||||
return (
|
||||
<>
|
||||
<FamMyFiles />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
import FamWorkInProgress from '../components/familyResources/FamWorkInProgress'
|
||||
|
||||
export default function FamWorkInProgressPage() {
|
||||
return (
|
||||
<>
|
||||
<FamWorkInProgress />
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user