Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 11dc8fc659 | |||
| 77c538ca79 | |||
| 6aa11793a5 | |||
| 4f8edc3998 | |||
| 7dd805b804 | |||
| 2aa1219ea9 |
@@ -1,38 +1,67 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link, useNavigate } 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">
|
<div className="notification-wrapper w-full bg-white p-8">
|
||||||
{/* heading */}
|
{blogdata.loading ?
|
||||||
<div className="sm:flex justify-between items-center mb-6">
|
<LoadingSpinner size='8' color='sky-blue' height='h-[100px]' />
|
||||||
<div className="mb-5 sm:mb-0">
|
:
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
blogdata?.data?.blogdata && blogdata.data?.blogdata.length ?
|
||||||
<span
|
<div className="w-full">
|
||||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
{/* heading */}
|
||||||
>
|
<div className="sm:flex justify-between items-center mb-6">
|
||||||
Title of this Blog Items
|
<div className="mb-5 sm:mb-0">
|
||||||
</span>
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||||
</h1>
|
<span
|
||||||
</div>
|
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||||
<div className="slider-btns flex space-x-4">
|
>
|
||||||
|
{blogdata.data?.blogdata?.[0]?.post_title}
|
||||||
</div>
|
</span>
|
||||||
|
</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>
|
:
|
||||||
Blog Items Details need implenet
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">No Blog Found!</h1>
|
||||||
</div>
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export default function SearchCom({
|
|||||||
placeholder,
|
placeholder,
|
||||||
handleSearch,
|
handleSearch,
|
||||||
value,
|
value,
|
||||||
|
name,
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -22,6 +23,7 @@ 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}
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ import React from "react";
|
|||||||
|
|
||||||
function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
||||||
const { data } = confirmCredit;
|
const { data } = confirmCredit;
|
||||||
|
|
||||||
|
const backToWallet = () => {
|
||||||
|
onClose();
|
||||||
|
window.location.reload(true);
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div className="logout-modal-body w-full flex flex-col items-center">
|
<div className="logout-modal-body w-full flex flex-col items-center">
|
||||||
<div className="content-wrapper w-full h-[32rem]">
|
<div className="content-wrapper w-full h-[32rem]">
|
||||||
@@ -99,7 +104,7 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
|||||||
<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 btn-gradient text-white text-base rounded-full w-[100px]"
|
className="px-4 h-11 flex justify-center items-center btn-gradient text-white text-base rounded-full w-[100px]"
|
||||||
onClick={onClose}
|
onClick={backToWallet}
|
||||||
>
|
>
|
||||||
Ok
|
Ok
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ function ConfirmNairaWithdraw({
|
|||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
});
|
});
|
||||||
let [pageLoading, setPageLoading] = useState(true);
|
|
||||||
|
|
||||||
//FUNCTION TO HANDLE SUBMIT
|
//FUNCTION TO HANDLE SUBMIT
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
@@ -35,15 +34,17 @@ function ConfirmNairaWithdraw({
|
|||||||
|
|
||||||
if (state?.choice === "prev") {
|
if (state?.choice === "prev") {
|
||||||
reqData.recipient_uid = state.details?.recipient_uid;
|
reqData.recipient_uid = state.details?.recipient_uid;
|
||||||
|
reqData.mode = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state?.choice === "new") {
|
if (state?.choice === "new") {
|
||||||
reqData.account_no = state?.accountNumber;
|
reqData.account_no = state?.details?.accountNumber;
|
||||||
reqData.account_type = state?.accountType;
|
reqData.account_type = Number(state?.details?.accountType);
|
||||||
reqData.bank_uid = state?.bank_uid;
|
reqData.bank_uid = state?.details?.bank_uid;
|
||||||
reqData.country = state?.country;
|
reqData.country = state?.details?.country;
|
||||||
reqData.state = state?.state;
|
reqData.state = state?.details?.state;
|
||||||
reqData.city = state?.city;
|
reqData.city = state?.details?.city;
|
||||||
|
reqData.mode = 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
apiURL
|
apiURL
|
||||||
@@ -64,6 +65,16 @@ function ConfirmNairaWithdraw({
|
|||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
});
|
});
|
||||||
|
} else if (
|
||||||
|
res.data?.status_message
|
||||||
|
?.toLowerCase()
|
||||||
|
.includes("recipient_add_error")
|
||||||
|
) {
|
||||||
|
setRequestStatus({
|
||||||
|
message: res.data?.error,
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
message: "Could not perform transaction",
|
message: "Could not perform transaction",
|
||||||
@@ -105,7 +116,7 @@ function ConfirmNairaWithdraw({
|
|||||||
action();
|
action();
|
||||||
setShowNairaWithdraw({
|
setShowNairaWithdraw({
|
||||||
show: true,
|
show: true,
|
||||||
data: state,
|
data: {},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -249,7 +260,9 @@ function ConfirmNairaWithdraw({
|
|||||||
onClick={state?.choice === "prev" ? getBack : action}
|
onClick={state?.choice === "prev" ? getBack : action}
|
||||||
className="border-gradient text-base tracking-wide px-4 py-2 rounded-full"
|
className="border-gradient text-base tracking-wide px-4 py-2 rounded-full"
|
||||||
>
|
>
|
||||||
<span className="text-gradient">{state?.choice === "prev" ? "Back" : "Cancel"}</span>
|
<span className="text-gradient">
|
||||||
|
{state?.choice === "prev" ? "Back" : "Cancel"}
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
|
|||||||
@@ -243,8 +243,6 @@ function NairaWithdraw({
|
|||||||
(item) => item.bank_uid === bank
|
(item) => item.bank_uid === bank
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(bankDetails);
|
|
||||||
|
|
||||||
// Ensure bankDetails is not empty
|
// Ensure bankDetails is not empty
|
||||||
if (!bankDetails || bankDetails.length === 0) {
|
if (!bankDetails || bankDetails.length === 0) {
|
||||||
// Handle the case when bankDetails is empty or undefined
|
// Handle the case when bankDetails is empty or undefined
|
||||||
|
|||||||
@@ -1,9 +1,65 @@
|
|||||||
|
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 || ""}`}>
|
||||||
@@ -16,29 +72,49 @@ 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 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 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">
|
||||||
<option className="rounded-full">Find answer on:</option>
|
{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>
|
</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}`}>
|
<Link key={index} to={item.link_path == 'blog-page' ? `/${item.link_path}?blog_id=${item.blog_id}` : `/${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,6 +411,19 @@ 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 = {
|
||||||
@@ -480,7 +493,6 @@ 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: 33020,
|
action: 33020,
|
||||||
mode: 100,
|
|
||||||
...reqData,
|
...reqData,
|
||||||
};
|
};
|
||||||
return this.postAuxEnd("/sendmoney", postData);
|
return this.postAuxEnd("/sendmoney", postData);
|
||||||
@@ -992,6 +1004,18 @@ 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