Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 21463ed501 | |||
| f450d0e868 | |||
| c880cccb5a | |||
| c776419dcf | |||
| 80d5c8ea12 | |||
| df6d2b570c | |||
| a802c1ca39 | |||
| 1a054a9fbc | |||
| 33eacecacf | |||
| a71017fae6 | |||
| 8969234fe5 | |||
| a0da97e14d | |||
| 4d1de18713 |
@@ -1,15 +1,15 @@
|
|||||||
SKIP_PREFLIGHT_CHECK=true
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
REACT_APP_NODE_ENV="development"
|
REACT_APP_NODE_ENV="development"
|
||||||
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
|
REACT_APP_SOCKET_URL="https://socket.mermsemr.com"
|
||||||
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
REACT_APP_MAIN_API="https://api.mermsemr.com"
|
||||||
REACT_APP_MEDIA_SERVER="https://qa-media.mermsemr.com"
|
REACT_APP_MEDIA_SERVER="https://media.mermsemr.com"
|
||||||
REACT_APP_MAIN_SOCKET="https://devsocket.mermsemr.com"
|
REACT_APP_MAIN_SOCKET="https://dsocket.mermsemr.com"
|
||||||
|
|
||||||
# login footer links
|
# login footer links
|
||||||
REACT_APP_HOME_LINK='https://qa-www.mermsemr.com/'
|
REACT_APP_HOME_LINK='https://www.mermsemr.com/'
|
||||||
REACT_APP_ABOUT_LINK='https://qa-www.mermsemr.com/about'
|
REACT_APP_ABOUT_LINK='https://www.mermsemr.com/about'
|
||||||
REACT_APP_CONTACTS_LINK='https://qa-www.mermsemr.com/contacts'
|
REACT_APP_CONTACTS_LINK='https://www.mermsemr.com/contacts'
|
||||||
REACT_APP_TERMS_LINK='https://qa-www.mermsemr.com/terms'
|
REACT_APP_TERMS_LINK='https://www.mermsemr.com/terms'
|
||||||
|
|
||||||
# Inactivity timeout/logout AT 10MINS
|
# Inactivity timeout/logout AT 10MINS
|
||||||
REACT_APP_TIMEOUT=600000
|
REACT_APP_TIMEOUT=600000
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import HelpPage from './views/HelpPage';
|
|||||||
import SubscriptionPage from './views/SubscriptionPage';
|
import SubscriptionPage from './views/SubscriptionPage';
|
||||||
import OnboardPage from "./views/OnboardPage";
|
import OnboardPage from "./views/OnboardPage";
|
||||||
import AccPWDResetPage from './views/AccPWDResetPage';
|
import AccPWDResetPage from './views/AccPWDResetPage';
|
||||||
|
import ProfileCompletePage from './views/ProfileCompletePage';
|
||||||
|
|
||||||
|
|
||||||
function AppRouters() {
|
function AppRouters() {
|
||||||
@@ -44,6 +45,7 @@ function AppRouters() {
|
|||||||
<Route element={<SocketIOContextProvider />}>
|
<Route element={<SocketIOContextProvider />}>
|
||||||
<Route element={<UserExist />}>
|
<Route element={<UserExist />}>
|
||||||
<Route path={siteLinks.dash} element={<HomePage />} />
|
<Route path={siteLinks.dash} element={<HomePage />} />
|
||||||
|
<Route path={siteLinks.profile_complete} element={<ProfileCompletePage />} />
|
||||||
<Route path={siteLinks.product} element={<ProductPage />} />
|
<Route path={siteLinks.product} element={<ProductPage />} />
|
||||||
<Route path={siteLinks.reports} element={<ReportsPage />} />
|
<Route path={siteLinks.reports} element={<ReportsPage />} />
|
||||||
<Route path={siteLinks.comments} element={<CommentsPage />} />
|
<Route path={siteLinks.comments} element={<CommentsPage />} />
|
||||||
|
|||||||
@@ -2,20 +2,29 @@ import React, {memo, useState} from 'react'
|
|||||||
import { useMutation } from "@tanstack/react-query";
|
import { useMutation } from "@tanstack/react-query";
|
||||||
import { pageSettings } from "../../../services/services";
|
import { pageSettings } from "../../../services/services";
|
||||||
import SiteTemplateSelector from './SiteTemplateSelector';
|
import SiteTemplateSelector from './SiteTemplateSelector';
|
||||||
|
import NoYesBooleanDropdown from './NoYesBooleanDropdown';
|
||||||
|
import { IoMdArrowDropdown } from 'react-icons/io';
|
||||||
|
|
||||||
const GeneralTab = memo(({name='Full Name', data, isCustom, productData}) =>{
|
const GeneralTab = memo(({name='Full Name', data, isCustom, productData, backendValues, setFieldsChanged}) =>{
|
||||||
// console.log("Page data == ", data)
|
|
||||||
|
|
||||||
const [reqStatus, setReqStatus] = useState({error: null, message: ''})
|
const [reqStatus, setReqStatus] = useState({error: null, message: ''})
|
||||||
|
|
||||||
const fieldData = {}
|
const fieldData = {}
|
||||||
Object.entries(data)?.forEach(([key, value]) => { // LOOP TO POPULATE FIELDDATA PROPERTIES WITH DATA OF EACH TAB
|
Object.entries(data)?.forEach(([key, value]) => { // LOOP TO POPULATE FIELDDATA PROPERTIES WITH DATA OF EACH TAB
|
||||||
fieldData[value?.name?.toLowerCase().replace(" ", "_")] = ''
|
fieldData[value?.name?.toLowerCase().replaceAll(" ", "_")] = ''
|
||||||
})
|
})
|
||||||
const [fields, setFields] = useState(fieldData)
|
backendValues.forEach(item => { //LOOPING THROUGH USER ALREADY ADDED DATA FROM BACKEND IF ANY AND UPDATING THE FIELDDATA OBJECT
|
||||||
const handleChange = ({target:{name, value}}) => {
|
fieldData[item?.setting_key?.toLowerCase().replaceAll(" ", "_")] = item?.setting_value
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log('fieldData', fieldData)
|
||||||
|
|
||||||
|
const [fields, setFields] = useState(fieldData)
|
||||||
|
|
||||||
|
const handleChange = ({target:{name, value}}) => {
|
||||||
setFields(prev => ({...prev, [name]:value}))
|
setFields(prev => ({...prev, [name]:value}))
|
||||||
}
|
setFieldsChanged(true)
|
||||||
|
}
|
||||||
|
|
||||||
const submitSettings = useMutation({
|
const submitSettings = useMutation({
|
||||||
mutationFn: (fields) => {
|
mutationFn: (fields) => {
|
||||||
@@ -25,6 +34,7 @@ const GeneralTab = memo(({name='Full Name', data, isCustom, productData}) =>{
|
|||||||
if(res?.data?.resultCode != '0'){
|
if(res?.data?.resultCode != '0'){
|
||||||
return setReqStatus({error: true, message: 'Unable to complete, try again later'})
|
return setReqStatus({error: true, message: 'Unable to complete, try again later'})
|
||||||
}
|
}
|
||||||
|
setFieldsChanged(false)
|
||||||
setReqStatus({error: false, message: 'Completed successfully'})
|
setReqStatus({error: false, message: 'Completed successfully'})
|
||||||
},
|
},
|
||||||
onError: (err) => {
|
onError: (err) => {
|
||||||
@@ -62,18 +72,33 @@ const GeneralTab = memo(({name='Full Name', data, isCustom, productData}) =>{
|
|||||||
<form id='tab_form'>
|
<form id='tab_form'>
|
||||||
<div className="form-row">
|
<div className="form-row">
|
||||||
<>
|
<>
|
||||||
{Object.entries(data)?.map(([key, value]) => (
|
{Object.entries(data)?.map(([key, value]) => {
|
||||||
<div key={key} className="form-group col-md-12">
|
let fieldName = value.name.toLowerCase().replaceAll(" ", "_")
|
||||||
<label htmlFor="name1">{value.name}</label>
|
let fieldValue = fields[value.name.toLowerCase().replaceAll(" ", "_")]
|
||||||
{value.controls == 'TEXT' ?
|
return (
|
||||||
<input name={value.name.toLowerCase().replace(" ", "_")} type="text" className="form-control" id={key} value={fields[value.name.toLowerCase().replace(" ", "_")]} onChange={handleChange} />
|
<div key={key} className="form-group col-md-12">
|
||||||
:value.controls == 'TEXTAREA' ?
|
<label htmlFor="name1">{value.name}</label>
|
||||||
<textarea name={value.name.toLowerCase().replace(" ", "_")} rows={5} style={{resize: 'none'}} type="text" className="form-control" id={key} value={fields[value.name.toLowerCase().replace(" ", "_")]} onChange={handleChange} />
|
{value.controls == 'TEXT' ?
|
||||||
:
|
<input name={fieldName} type="text" className="form-control" id={key} value={fieldValue} onChange={handleChange} />
|
||||||
null
|
:value.controls == 'TEXTAREA' ?
|
||||||
}
|
<textarea name={fieldName} rows={5} style={{resize: 'none'}} type="text" className="form-control" id={key} value={fieldValue} onChange={handleChange} />
|
||||||
</div>
|
: value.controls == 'SELECT_NO_YES' ?
|
||||||
))}
|
// <NoYesBooleanDropdown name={fieldName} value={fieldValue} onChange={handleChange} />
|
||||||
|
<div className='position-relative'>
|
||||||
|
<select onChange={handleChange} name={fieldName} value={fieldValue} className="form-control">
|
||||||
|
<option value=''>Select</option>
|
||||||
|
<option value='0'>No</option>
|
||||||
|
<option value='1'>Yes</option>
|
||||||
|
</select>
|
||||||
|
<IoMdArrowDropdown className='position-absolute w-auto' style={{top: '50%', right: '2px', transform: 'translateY(-50%)'}} />
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
null
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
{reqStatus.message &&
|
{reqStatus.message &&
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import React, {memo} from 'react'
|
||||||
|
|
||||||
|
export default function NoYesBooleanDropdown(name, value, onChange) {
|
||||||
|
return (
|
||||||
|
<select onChange={onChange} name={name} value={value} className="form-control">
|
||||||
|
<option value=''>Select</option>
|
||||||
|
<option value='0'>No</option>
|
||||||
|
<option value='1'>Yes</option>
|
||||||
|
</select>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -30,10 +30,12 @@ const Settings = memo(({productData}) => {
|
|||||||
|
|
||||||
const footerFields ={
|
const footerFields ={
|
||||||
footer_description: { name: 'Footer Description', controls: 'TEXTAREA', active: true },
|
footer_description: { name: 'Footer Description', controls: 'TEXTAREA', active: true },
|
||||||
|
boolean_footer_show_email: { name: 'Show email in footer', controls: 'SELECT_NO_YES', active: true },
|
||||||
}
|
}
|
||||||
|
|
||||||
const aboutFields ={
|
const aboutFields ={
|
||||||
about_description: { name: 'About us', controls: 'TEXTAREA', active: true },
|
about_title: { name: 'About Title', controls: 'TEXT', active: true },
|
||||||
|
about_description: { name: 'About Details', controls: 'TEXTAREA', active: true },
|
||||||
about_extra_1: { name: 'Extra About us', controls: 'TEXTAREA', active: true },
|
about_extra_1: { name: 'Extra About us', controls: 'TEXTAREA', active: true },
|
||||||
about_extra_2: { name: 'More About us', controls: 'TEXTAREA', active: true },
|
about_extra_2: { name: 'More About us', controls: 'TEXTAREA', active: true },
|
||||||
}
|
}
|
||||||
@@ -49,13 +51,18 @@ const Settings = memo(({productData}) => {
|
|||||||
template_9 : { title: 'Template Name-9', template_id: 'fc8f0738-6500-4775-9895-2047cd275302', banner: 'file-icon/svg.png', active: '' },
|
template_9 : { title: 'Template Name-9', template_id: 'fc8f0738-6500-4775-9895-2047cd275302', banner: 'file-icon/svg.png', active: '' },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const contactFields ={
|
||||||
|
contact_title : { name: 'Contact Title', controls: 'TEXT', active: true },
|
||||||
|
contact_introduction: { name: 'Extra Introduction', controls: 'TEXTAREA', active: true },
|
||||||
|
}
|
||||||
|
|
||||||
const settingsObject = useMemo(()=>{
|
const settingsObject = useMemo(()=>{
|
||||||
return {
|
return {
|
||||||
settings: { title: 'Settings', controls: 'settings', active: 'active show' , custom: false, data: dataFields},
|
settings: { title: 'Settings', controls: 'settings', active: 'active show' , custom: false, data: dataFields},
|
||||||
home_tab: { title: 'Home Page', controls: 'home', active: '', custom: false, data: homeFields},
|
home_tab: { title: 'Home Page', controls: 'home', active: '', custom: false, data: homeFields},
|
||||||
footer_tab: { title: 'Footer', controls: 'footer', active: '', custom: false, data: footerFields },
|
footer_tab: { title: 'Footer', controls: 'footer', active: '', custom: false, data: footerFields },
|
||||||
about_tab: { title: 'About Page', controls: 'about', active: '', custom: false, data: aboutFields },
|
about_tab: { title: 'About Page', controls: 'about', active: '', custom: false, data: aboutFields },
|
||||||
contact_tab: { title: 'Contact Page', controls: 'contact', active: '', custom: false, data: {} },
|
contact_tab: { title: 'Contact Page', controls: 'contact', active: '', custom: false, data: contactFields },
|
||||||
social_tab: { title: 'Socials', controls: 'social', active: '', custom: false, data: socialFields },
|
social_tab: { title: 'Socials', controls: 'social', active: '', custom: false, data: socialFields },
|
||||||
template_tab: { title: 'Template', controls: 'template', active: '', custom: true, data: templateData },
|
template_tab: { title: 'Template', controls: 'template', active: '', custom: true, data: templateData },
|
||||||
color_scheme_tab: { title: 'Color Scheme', controls: 'color-scheme', active: '', custom: true, data: {} },
|
color_scheme_tab: { title: 'Color Scheme', controls: 'color-scheme', active: '', custom: true, data: {} },
|
||||||
@@ -63,8 +70,23 @@ const Settings = memo(({productData}) => {
|
|||||||
},[])
|
},[])
|
||||||
|
|
||||||
|
|
||||||
|
const [fieldsChanged, setFieldsChanged] = useState(false)
|
||||||
|
|
||||||
const [activeTab, setActiveTab] = useState(Object.entries(settingsObject)[0][1]?.controls)
|
const [activeTab, setActiveTab] = useState(Object.entries(settingsObject)[0][1]?.controls)
|
||||||
|
|
||||||
|
const handleChangeTab = (value) => {
|
||||||
|
// if(fieldsChanged){
|
||||||
|
// const proceed = confirm('Continue without saving changes')
|
||||||
|
// if(proceed){
|
||||||
|
// setActiveTab(value)
|
||||||
|
// setFieldsChanged(false)
|
||||||
|
// }
|
||||||
|
// }else{
|
||||||
|
// setActiveTab(value)
|
||||||
|
// }
|
||||||
|
setActiveTab(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const {data, isFetching, isError, error} = useQuery({
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
queryKey: queryKeys.settingsData,
|
queryKey: queryKeys.settingsData,
|
||||||
@@ -78,7 +100,7 @@ const Settings = memo(({productData}) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const settingsData = data?.data
|
const settingsData = data?.data?.settings
|
||||||
// console.log('data', settingsData)
|
// console.log('data', settingsData)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -104,12 +126,14 @@ const Settings = memo(({productData}) => {
|
|||||||
{Object.entries(settingsObject).map(([key, value]) => (
|
{Object.entries(settingsObject).map(([key, value]) => (
|
||||||
<li key={key} className="nav-item">
|
<li key={key} className="nav-item">
|
||||||
<a className={`nav-link ${activeTab == value.controls && 'active show'}`}
|
<a className={`nav-link ${activeTab == value.controls && 'active show'}`}
|
||||||
id={key} data-bs-toggle="pill"
|
id={key}
|
||||||
|
// data-bs-toggle="pill"
|
||||||
// data-bs-target={`#${value.controls}`}
|
// data-bs-target={`#${value.controls}`}
|
||||||
type="button" role="tab"
|
type="button"
|
||||||
|
// role="tab"
|
||||||
// aria-controls={value.controls}
|
// aria-controls={value.controls}
|
||||||
// aria-selected="true"
|
// aria-selected="true"
|
||||||
onClick={()=>setActiveTab(value.controls)}
|
onClick={()=>handleChangeTab(value.controls)}
|
||||||
>
|
>
|
||||||
{value.title}
|
{value.title}
|
||||||
</a>
|
</a>
|
||||||
@@ -124,7 +148,7 @@ const Settings = memo(({productData}) => {
|
|||||||
// id={value.controls} role="tabpanel"
|
// id={value.controls} role="tabpanel"
|
||||||
// aria-labelledby={key}
|
// aria-labelledby={key}
|
||||||
>
|
>
|
||||||
<GeneralTab name={value.title} data={value.data} isCustom={value.custom} productData={productData} />
|
<GeneralTab name={value.title} data={value.data} isCustom={value.custom} productData={productData} backendValues={settingsData} setFieldsChanged={setFieldsChanged} />
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
import React, { useEffect } from "react";
|
||||||
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
import { Form, Formik } from "formik";
|
||||||
|
import * as Yup from "yup";
|
||||||
|
import { useMutation } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
|
||||||
|
const validationSchema = Yup.object().shape({
|
||||||
|
username: Yup.string().min(3, "Minimum 3 characters").max(50, "Maximum 50 characters").required("Email is required"),
|
||||||
|
})
|
||||||
|
|
||||||
|
const initialValues = {
|
||||||
|
username: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default function HomeSections(){
|
||||||
|
|
||||||
|
const {state:{profile_completed}} = useLocation()
|
||||||
|
|
||||||
|
const mutation = useMutation({
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return ()=>{}
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
console.log('res', res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleCompleteProfile = (values, helpers) => {
|
||||||
|
// helpers.resetForm()
|
||||||
|
console.log('values', values, helpers)
|
||||||
|
// mutation.mutate(values)
|
||||||
|
}
|
||||||
|
|
||||||
|
return <>
|
||||||
|
<BreadcrumbComBS title='Update Profile' paths={['Dashboard', 'Profile']} />
|
||||||
|
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-xxl-6 m-b-30">
|
||||||
|
<div className="card card-statistics h-100 mb-0" style={{minHeight: '100px'}}>
|
||||||
|
{/* <div className="card-header d-flex align-items-center justify-content-between">
|
||||||
|
<div className="card-heading">
|
||||||
|
<h4 className="card-title">My Product URLs</h4>
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="col-xxl-6 m-b-30">
|
||||||
|
<div className="card card-statistics h-100 mb-0">
|
||||||
|
{/* <div className="card-header d-flex align-items-center justify-content-between">
|
||||||
|
<div className="card-heading">
|
||||||
|
<h4 className="card-title">My Product URLs</h4>
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
{/* <div style={{minHeight: '400px'}}></div> */}
|
||||||
|
<div className="card-body">
|
||||||
|
<Formik
|
||||||
|
initialValues={initialValues}
|
||||||
|
validationSchema={validationSchema}
|
||||||
|
onSubmit={handleCompleteProfile}
|
||||||
|
>
|
||||||
|
{(props) => {
|
||||||
|
return (
|
||||||
|
<Form className=''>
|
||||||
|
<div className="row">
|
||||||
|
<>
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="form-group">
|
||||||
|
<label className={`text-black fw-bold control-label ${(props.errors.username && props.touched.username) && 'text-danger'}`}>Username*</label>
|
||||||
|
<input type="username" name='username' className="form-control" placeholder="Username" value={props.values.username} onChange={props.handleChange} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* {cSignup.error &&
|
||||||
|
<>
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-danger'>{cSignup.error.message}</p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
} */}
|
||||||
|
|
||||||
|
<div className="col-12 mt-3 text-end">
|
||||||
|
<button type='submit' className="btn btn-primary text-uppercase">{false ? 'loading...' : 'Continue'}</button>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Formik>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
import getImage from "../../utils/getImage";
|
import getImage from "../../utils/getImage";
|
||||||
|
import { getSubscriptions } from '../../services/services';
|
||||||
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
import queryKeys from '../../services/queryKeys';
|
||||||
|
|
||||||
export default function Subscription() {
|
export default function Subscription() {
|
||||||
|
|
||||||
@@ -10,52 +13,66 @@ export default function Subscription() {
|
|||||||
premium: { name: 'Premium', price: 20.00, active: true },
|
premium: { name: 'Premium', price: 20.00, active: true },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
|
queryKey: queryKeys.subscriptions,
|
||||||
|
queryFn: () => {
|
||||||
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
|
return getSubscriptions(reqData)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const currentSubscription = data?.data?.current_product
|
||||||
|
const otherSubscriptions = data?.data?.options
|
||||||
|
console.log('urlData', data?.data)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BreadcrumbComBS title='Subscription' paths={['Dashboard', 'Subscription']} />
|
<BreadcrumbComBS title='Subscription' paths={['Dashboard', 'Subscription']} />
|
||||||
|
|
||||||
|
{isFetching ?
|
||||||
|
<>
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-mute'>Loading...</p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
: isError ?
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-danger'>{error.message}</p>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-xl-3 col-md-6">
|
<div className="col-12 col-lg-6 col-xl-3">
|
||||||
<div className="card card-statistics text-center py-3">
|
<div className="card card-statistics text-center py-3">
|
||||||
<div className="card-body pricing-content">
|
<div className="card-body pricing-content">
|
||||||
<div className="pricing-content-card">
|
<div className="pricing-content-card">
|
||||||
<h5>Current Subscription(s)</h5>
|
<h5>Current Subscription(s)</h5>
|
||||||
<h2 className="text-primary pt-3">Basic</h2>
|
<h2 className="text-primary pt-3">{currentSubscription?.display_name}</h2>
|
||||||
{/*<p className="text-primary pb-3">/ Monthly</p>*/}
|
|
||||||
{/*<ul className="py-2">*/}
|
|
||||||
{/* <li>post jobs</li>*/}
|
|
||||||
{/* <li>advanced instructors search</li>*/}
|
|
||||||
{/* <li>invite candidates</li>*/}
|
|
||||||
{/* <li>post events</li>*/}
|
|
||||||
{/* <li>cancel any time</li>*/}
|
|
||||||
{/*</ul>*/}
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<>
|
<>
|
||||||
{Object.entries(pricingFields)?.map(([key, value]) => (
|
{Object.entries(otherSubscriptions)?.map(([key, value]) => (
|
||||||
|
|
||||||
<div key={key} className="col-xl-3 col-md-6">
|
<div key={key} className="col-12 col-lg-6 col-xl-3">
|
||||||
<div className="card card-statistics text-center py-3">
|
<div className="card card-statistics text-center py-3">
|
||||||
<div className="card-body pricing-content">
|
<div className="card-body pricing-content">
|
||||||
<div className="pricing-content-card">
|
<div className="pricing-content-card">
|
||||||
<h5>{value.name}</h5>
|
<h5>{value.display_name}</h5>
|
||||||
<h2 className="text-primary pt-3">${value.price}</h2>
|
<h2 className="text-primary pt-3">${value.monthly}</h2>
|
||||||
<p className="text-primary pb-3">/ Monthly</p>
|
<p className="text-primary pb-3">/ Monthly</p>
|
||||||
<ul className="py-2">
|
<ul className="py-2">
|
||||||
<li>post jobs</li>
|
{value?.items?.map(item =>(
|
||||||
<li>advanced instructors search</li>
|
<li key={item}>{item}</li>
|
||||||
<li>invite candidates</li>
|
))}
|
||||||
<li>post events</li>
|
|
||||||
<li>cancel any time</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div className="pt-2"><a href="javascript:void(0)" className="btn btn-inverse-secondary btn-round btn-sm">go {value.name}</a></div>
|
<div className="pt-2">
|
||||||
|
<button className="btn btn-inverse-secondary btn-round btn-sm">Go {value.display_name}</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,7 +82,7 @@ export default function Subscription() {
|
|||||||
</>
|
</>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ const siteLinks = {
|
|||||||
help: '/help',
|
help: '/help',
|
||||||
home: '/',
|
home: '/',
|
||||||
dash: '/dash',
|
dash: '/dash',
|
||||||
|
profile_complete: '/profile_complete',
|
||||||
product: '/product/*',
|
product: '/product/*',
|
||||||
contacts: '/contacts',
|
contacts: '/contacts',
|
||||||
comments: '/comments',
|
comments: '/comments',
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const queryKeys = {
|
|||||||
product_page: ['product_page'],
|
product_page: ['product_page'],
|
||||||
recentAction: ['recent-action'],
|
recentAction: ['recent-action'],
|
||||||
settingsData: ['settings_data'],
|
settingsData: ['settings_data'],
|
||||||
|
subscriptions: ['subscriptions'],
|
||||||
|
|
||||||
dashboard: ['dashboard'],
|
dashboard: ['dashboard'],
|
||||||
topBar: ['top-bar'],
|
topBar: ['top-bar'],
|
||||||
|
|||||||
@@ -166,6 +166,14 @@ export const getSettingsData = (reqData) => {
|
|||||||
return postAuxEnd(`/panel/myproduct/settings/values`, postData, false)
|
return postAuxEnd(`/panel/myproduct/settings/values`, postData, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET PRODUCT SUBSCRIPTIONS
|
||||||
|
export const getSubscriptions = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/subscription/products`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,22 @@
|
|||||||
import React from 'react'
|
import React, { useEffect } from 'react'
|
||||||
import ProductFactory from '../component/product/ProductFactory'
|
import ProductFactory from '../component/product/ProductFactory'
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
import siteLinks from '../links/siteLinks';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
|
|
||||||
export default function ProductPage() {
|
export default function ProductPage() {
|
||||||
|
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
const { userDetails: { profile_completed }} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!profile_completed){
|
||||||
|
navigate(siteLinks.profile_complete, {replace: true, state:{profile_completed: false}})
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ProductFactory />
|
<ProductFactory />
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import ProfileCompleteCom from '../component/profile_complete/ProfileCompleteCom';
|
||||||
|
|
||||||
|
|
||||||
|
export default function ProfileCompletePage(){
|
||||||
|
return <ProfileCompleteCom />
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user