Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4876ba80c1 | |||
| 71f799d157 |
@@ -1,67 +1,38 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import CommonHead from "../UserHeader/CommonHead";
|
import CommonHead from "../UserHeader/CommonHead";
|
||||||
import usersService from "../../services/UsersService";
|
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
|
||||||
|
|
||||||
export default function BlogItem(props) {
|
export default function BlogItem(props) {
|
||||||
|
|
||||||
const apiCall = new usersService()
|
|
||||||
const navigate = useNavigate()
|
|
||||||
|
|
||||||
const [blogdata, setBlogdata] = useState({loading: true, data:{}})
|
|
||||||
|
|
||||||
const [selectTab, setValue] = useState("today");
|
const [selectTab, setValue] = useState("today");
|
||||||
const filterHandler = (value) => {
|
const filterHandler = (value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
};
|
};
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
|
||||||
const blog_id = queryParams.get("blog_id");
|
|
||||||
|
|
||||||
useEffect(()=>{
|
|
||||||
if(!blog_id){
|
|
||||||
navigate('/',{replace:true})
|
|
||||||
}
|
|
||||||
apiCall.getSingleBlogData({blog_id}).then(res => {
|
|
||||||
setBlogdata({loading: false, data:res.data})
|
|
||||||
}).catch(error => {
|
|
||||||
setBlogdata({loading: false, data:{}})
|
|
||||||
console.log('ERROR', error)
|
|
||||||
})
|
|
||||||
},[blog_id])
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<CommonHead
|
<CommonHead
|
||||||
commonHeadData={props.commonHeadData}
|
commonHeadData={props.commonHeadData}
|
||||||
/>
|
/>
|
||||||
<div className="notification-page w-full mb-10">
|
<div className="notification-page w-full mb-10">
|
||||||
<div className="notification-wrapper w-full bg-white p-8">
|
<div className="notification-wrapper w-full">
|
||||||
{blogdata.loading ?
|
{/* heading */}
|
||||||
<LoadingSpinner size='8' color='sky-blue' height='h-[100px]' />
|
<div className="sm:flex justify-between items-center mb-6">
|
||||||
:
|
<div className="mb-5 sm:mb-0">
|
||||||
blogdata?.data?.blogdata && blogdata.data?.blogdata.length ?
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||||
<div className="w-full">
|
<span
|
||||||
{/* heading */}
|
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||||
<div className="sm:flex justify-between items-center mb-6">
|
>
|
||||||
<div className="mb-5 sm:mb-0">
|
Title of this Blog Items
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
</span>
|
||||||
<span
|
</h1>
|
||||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
</div>
|
||||||
>
|
<div className="slider-btns flex space-x-4">
|
||||||
{blogdata.data?.blogdata?.[0]?.post_title}
|
|
||||||
</span>
|
</div>
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
{/* <div className="slider-btns flex space-x-4">
|
|
||||||
</div> */}
|
|
||||||
</div>
|
|
||||||
<div dangerouslySetInnerHTML={{__html: blogdata.data?.blogdata?.[0]?.post_content}}>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
:
|
<div>
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">No Blog Found!</h1>
|
Blog Items Details need implenet
|
||||||
}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ export default function SearchCom({
|
|||||||
placeholder,
|
placeholder,
|
||||||
handleSearch,
|
handleSearch,
|
||||||
value,
|
value,
|
||||||
name,
|
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -23,7 +22,6 @@ export default function SearchCom({
|
|||||||
className={`w-full h-full focus:outline-0 focus:ring-0 dark:bg-dark-white dark:text-white ${
|
className={`w-full h-full focus:outline-0 focus:ring-0 dark:bg-dark-white dark:text-white ${
|
||||||
inputClasses || ""
|
inputClasses || ""
|
||||||
}`}
|
}`}
|
||||||
name={name}
|
|
||||||
type="text"
|
type="text"
|
||||||
onInput={handleSearch}
|
onInput={handleSearch}
|
||||||
value={value}
|
value={value}
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ function AddFundDollars(props) {
|
|||||||
|
|
||||||
{/* Postal Code and State */}
|
{/* Postal Code and State */}
|
||||||
<div className="sm:grid gap-5 grid-cols-3 my-2">
|
<div className="sm:grid gap-5 grid-cols-3 my-2">
|
||||||
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
<div className="field w-full xl:mb-0 col-span-1">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
spanTag="*"
|
spanTag="*"
|
||||||
@@ -521,7 +521,7 @@ function AddFundDollars(props) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="md:px-8 md:pt-4 px-4 pt-2 add-fund-btn flex justify-end items-center gap-3">
|
<div className="md:px-8 add-fund-btn flex justify-end items-center gap-3">
|
||||||
<button
|
<button
|
||||||
className="px-4 py-1 h-11 max-w-[100px] w-full flex justify-center items-center border-gradient text-base rounded-full"
|
className="px-4 py-1 h-11 max-w-[100px] w-full flex justify-center items-center border-gradient text-base rounded-full"
|
||||||
onClick={handleClose}
|
onClick={handleClose}
|
||||||
|
|||||||
@@ -291,6 +291,17 @@ function ConfirmAddFund({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getBack = () => {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
awaitConfirm: { loader: false, state: false },
|
||||||
|
acceptConfirm: { loader: false, state: false },
|
||||||
|
},
|
||||||
|
data: {},
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="content-wrapper w-full h-[32rem]">
|
<div className="content-wrapper w-full h-[32rem]">
|
||||||
<div className="w-full mb-10">
|
<div className="w-full mb-10">
|
||||||
@@ -359,9 +370,9 @@ function ConfirmAddFund({
|
|||||||
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
||||||
<button
|
<button
|
||||||
className="px-4 h-11 flex justify-center items-center border-gradient text-base rounded-full"
|
className="px-4 h-11 flex justify-center items-center border-gradient text-base rounded-full"
|
||||||
onClick={onClose}
|
onClick={getBack}
|
||||||
>
|
>
|
||||||
Cancel
|
Back
|
||||||
</button>
|
</button>
|
||||||
{__confirmCountry === "US" && (
|
{__confirmCountry === "US" && (
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -89,11 +89,11 @@ function ConfirmNairaWithdraw({
|
|||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
}),
|
}),
|
||||||
1500
|
5000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
message: "transfer successful",
|
message: "Transfer Successful!",
|
||||||
loading: false,
|
loading: false,
|
||||||
status: true,
|
status: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -60,14 +60,6 @@ function ConfirmTransfer({ payment, wallet }) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
// what happens if not state redirect user
|
|
||||||
if (!state) {
|
|
||||||
navigate("/my-wallet/transfer-fund", { replace: true });
|
|
||||||
} else {
|
|
||||||
setPageLoading(false);
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
return (
|
return (
|
||||||
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
|
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
|
||||||
{pageLoading ? (
|
{pageLoading ? (
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Form, Formik } from "formik";
|
import { Form, Formik } from "formik";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import ModalCom from "../../Helpers/ModalCom";
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
@@ -13,7 +12,7 @@ function NairaWithdraw({
|
|||||||
state,
|
state,
|
||||||
setShowConfirmNairaWithdraw,
|
setShowConfirmNairaWithdraw,
|
||||||
}) {
|
}) {
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
const [tab, setTab] = useState("previous");
|
const [tab, setTab] = useState("previous");
|
||||||
let [requestStatus, setRequestStatus] = useState(false);
|
let [requestStatus, setRequestStatus] = useState(false);
|
||||||
|
|
||||||
@@ -630,7 +629,9 @@ function NairaWithdraw({
|
|||||||
className="text-slate-500 text-lg"
|
className="text-slate-500 text-lg"
|
||||||
value=""
|
value=""
|
||||||
>
|
>
|
||||||
No Options Found!
|
{allCountries.data?.length
|
||||||
|
? "Select..."
|
||||||
|
: "No Options Found!"}
|
||||||
</option>
|
</option>
|
||||||
)}
|
)}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -1,65 +1,9 @@
|
|||||||
import { useEffect, useState } from "react";
|
|
||||||
|
|
||||||
import ProductCardStyleTwo from "../../Cards/ProductCardStyleTwo";
|
import ProductCardStyleTwo from "../../Cards/ProductCardStyleTwo";
|
||||||
import DataIteration from "../../Helpers/DataIteration";
|
import DataIteration from "../../Helpers/DataIteration";
|
||||||
import SearchCom from "../../Helpers/SearchCom";
|
import SearchCom from "../../Helpers/SearchCom";
|
||||||
import localImgLoad from "../../../lib/localImgLoad";
|
import localImgLoad from "../../../lib/localImgLoad";
|
||||||
|
|
||||||
import usersService from "../../../services/UsersService";
|
|
||||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
|
||||||
|
|
||||||
export default function QuestionsTab({ className, products }) {
|
export default function QuestionsTab({ className, products }) {
|
||||||
const apiCall = new usersService()
|
|
||||||
|
|
||||||
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`onsale-tab-wrapper w-full ${className || ""}`}>
|
<div className={`onsale-tab-wrapper w-full ${className || ""}`}>
|
||||||
@@ -72,49 +16,29 @@ export default function QuestionsTab({ className, products }) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="p-8 bg-white rounded-2xl h-full">
|
<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">
|
<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">
|
<select 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 className="rounded-full">Find answer on:</option>
|
||||||
<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>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
{error.question && <p className="text-red-500 text-[12px]">{error.question}</p>}
|
|
||||||
{/* filter-search */}
|
{/* filter-search */}
|
||||||
<div className="w-full my-5 border-2 rounded-full">
|
<div className="w-full my-5 border-2 rounded-full">
|
||||||
<SearchCom
|
<SearchCom />
|
||||||
name={'searchPhrase'}
|
|
||||||
value={askQuestion.searchPhrase}
|
|
||||||
handleSearch={changeAskQuestion}
|
|
||||||
/>
|
|
||||||
</div>
|
</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">
|
<div className="w-full flex justify-end items-center border-b-2 pb-4">
|
||||||
<button
|
<button
|
||||||
onClick={onSearch}
|
|
||||||
disabled={requestStatus.loading}
|
|
||||||
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
||||||
>
|
>
|
||||||
Search
|
Search
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
{/* <div className="content-section w-full-width">
|
||||||
|
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-[30px]">
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export default function RecomendedSliders({ className, bannerData }) {
|
|||||||
<div className="slider-content">
|
<div className="slider-content">
|
||||||
<SliderCom settings={settings} selector={sellSlider}>
|
<SliderCom settings={settings} selector={sellSlider}>
|
||||||
{bannerData.map((item, index) => (
|
{bannerData.map((item, index) => (
|
||||||
<Link key={index} to={item.link_path == 'blog-page' ? `/${item.link_path}?blog_id=${item.blog_id}` : `/${item.link_path}`}>
|
<Link key={index} to={`/${item.link_path}`}>
|
||||||
<div className="item">
|
<div className="item">
|
||||||
<div
|
<div
|
||||||
className={`commonHeaderSliderItem flex gap-1 flex-col justify-between items-center ${item.short_style}`}
|
className={`commonHeaderSliderItem flex gap-1 flex-col justify-between items-center ${item.short_style}`}
|
||||||
|
|||||||
@@ -411,19 +411,6 @@ class usersService {
|
|||||||
};
|
};
|
||||||
return this.postAuxEnd("/resources", postData);
|
return this.postAuxEnd("/resources", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ASK QUESTION RESOURCES
|
|
||||||
askResourcesResult(reqData) {
|
|
||||||
var postData = {
|
|
||||||
uuid: localStorage.getItem("uid"),
|
|
||||||
member_id: localStorage.getItem("member_id"),
|
|
||||||
sessionid: localStorage.getItem("session_token"),
|
|
||||||
action: 22010,
|
|
||||||
...reqData,
|
|
||||||
};
|
|
||||||
return this.postAuxEnd("/askresources", postData);
|
|
||||||
}
|
|
||||||
|
|
||||||
getMyWiatingJobList() {
|
getMyWiatingJobList() {
|
||||||
// jobs you have shown inteterest in
|
// jobs you have shown inteterest in
|
||||||
var postData = {
|
var postData = {
|
||||||
@@ -1004,18 +991,6 @@ class usersService {
|
|||||||
return this.postAuxEnd("/payremcard", postData);
|
return this.postAuxEnd("/payremcard", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION TO GET SINGLE BLOG ITEM
|
|
||||||
getSingleBlogData(reqData) {
|
|
||||||
var postData = {
|
|
||||||
uid: localStorage.getItem("uid"),
|
|
||||||
member_id: localStorage.getItem("member_id"),
|
|
||||||
sessionid: localStorage.getItem("session_token"),
|
|
||||||
limit: 4,
|
|
||||||
...reqData,
|
|
||||||
};
|
|
||||||
return this.postAuxEnd("/blogdata", 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)
|
||||||
|
|||||||
Reference in New Issue
Block a user