Compare commits
171 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9cfb4651af | |||
| 2d141b529c | |||
| b418ca7d58 | |||
| 9eea804f71 | |||
| f3ebb0a925 | |||
| 6421eb5b3e | |||
| 971624a358 | |||
| 21463ed501 | |||
| f450d0e868 | |||
| c880cccb5a | |||
| c776419dcf | |||
| 80d5c8ea12 | |||
| df6d2b570c | |||
| a802c1ca39 | |||
| 1a054a9fbc | |||
| 33eacecacf | |||
| a71017fae6 | |||
| 8969234fe5 | |||
| a0da97e14d | |||
| 4d1de18713 | |||
| 4fe66fd161 | |||
| 6028e4c617 | |||
| 398392062c | |||
| b84eac1299 | |||
| 52e3553aaa | |||
| 220e4952d5 | |||
| 59c90ea175 | |||
| 9838fc948e | |||
| cb4c741a90 | |||
| bba38affae | |||
| 9468793d91 | |||
| 44224e23ff | |||
| 5b926300ae | |||
| 9125730d2b | |||
| 00baa0b9bf | |||
| f5018bc6b7 | |||
| 59d9eb3df9 | |||
| 8f78011800 | |||
| 3c3f70fd3f | |||
| 4f62410e6d | |||
| b8c65ee091 | |||
| 5e1e97a2dd | |||
| f794e6d31c | |||
| a4e1376c27 | |||
| 16db88808b | |||
| 2e97ec9857 | |||
| 6ec537bebf | |||
| d84c266653 | |||
| bb5a886e47 | |||
| b5a37c4cc5 | |||
| ddde4bd0d5 | |||
| bf9c6c8b32 | |||
| 14e588b0a9 | |||
| dde01ab79a | |||
| a5f1c4b5bb | |||
| a16dd7af24 | |||
| 54d44e39d3 | |||
| 578a0e4c8f | |||
| d0ac2515a3 | |||
| b26f8b4e0d | |||
| ab6518e2ee | |||
| 563abe6c35 | |||
| 894ed6ea35 | |||
| 71859d9712 | |||
| 6d9a0e5624 | |||
| 0bd0b3ca64 | |||
| 0bef976bca | |||
| 0d6dc40633 | |||
| f50590850b | |||
| 1dcae6b163 | |||
| c06dc93e9a | |||
| 67d67e773a | |||
| 0493ee4f03 | |||
| 866c127135 | |||
| f7d27a3778 | |||
| c7fac54e12 | |||
| f994c7f45e | |||
| b0821981e7 | |||
| a220f2faa4 | |||
| 2e46a56146 | |||
| b7aaff7adc | |||
| d606b5682c | |||
| 25d4751935 | |||
| a8d78c4c3f | |||
| 9c672d4bf2 | |||
| c744eccd15 | |||
| 302a3aa3bb | |||
| 23a295866a | |||
| 487494fbff | |||
| 919594d7b2 | |||
| 7eedae8fc2 | |||
| 51a3c60590 | |||
| ab597039ba | |||
| 6fd2dcdb3d | |||
| 614910e29c | |||
| 2c832699c2 | |||
| c8fe2eadf6 | |||
| 1e174b7432 | |||
| dda8fa7d30 | |||
| d0f1d5ee34 | |||
| a2843d97e2 | |||
| a0e417fc68 | |||
| 10e65fa6ff | |||
| f503422c42 | |||
| bd470ea8bc | |||
| 6c14b2587c | |||
| 085756b8bc | |||
| eb4d5315de | |||
| 8ac742e5d6 | |||
| c2db47cbb8 | |||
| ee787c0740 | |||
| 6136d762a3 | |||
| 2f73e84a84 | |||
| 8c57e94bb6 | |||
| fa7660de29 | |||
| bde30f781a | |||
| 9f9dcc5e37 | |||
| ec11a7b5b3 | |||
| 38c5717667 | |||
| 77eaf15c6a | |||
| 60488524ed | |||
| 3584447c65 | |||
| 58cd232f91 | |||
| 9684e7fcfa | |||
| d4eda11477 | |||
| 1d31507984 | |||
| a3dbc8cab1 | |||
| 29878e3ddf | |||
| 80a40da9df | |||
| 9f7f1b706b | |||
| d878d1d098 | |||
| 3a60d4e12c | |||
| c03c70b07e | |||
| 9d158fe1cb | |||
| ffd80d9888 | |||
| 384da476a6 | |||
| 3576e7f702 | |||
| 5ed94fee53 | |||
| dbf81a4cf5 | |||
| 0984d78f1e | |||
| ade91c4ed8 | |||
| 905e783f76 | |||
| 08665d51a7 | |||
| dff0bd72ed | |||
| 823ff83f88 | |||
| 82f0efe6e5 | |||
| 3eaf99f212 | |||
| 5d93817555 | |||
| 4505a6fbcd | |||
| 4367364d4f | |||
| b2b0bf8af6 | |||
| fcde22d4cb | |||
| 56125b427d | |||
| 16066d030b | |||
| b6c79303ae | |||
| ada406eb3f | |||
| 9479be61f1 | |||
| 9c8405cf1c | |||
| 92ddea329d | |||
| a79ab63163 | |||
| d7fce908cc | |||
| 1708cb893f | |||
| 7ec139c5ad | |||
| 03d395560a | |||
| fa234a7fae | |||
| b869b76602 | |||
| 6f38611606 | |||
| 37774c0aa3 | |||
| 373956da39 | |||
| 397eb7c88b | |||
| 0f0a674fea |
@@ -1,9 +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://dev-socket.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://dev-media.mermsemr.com"
|
REACT_APP_MEDIA_SERVER="https://media.mermsemr.com"
|
||||||
REACT_APP_MAIN_SOCKET="https://dev-socket.mermsemr.com"
|
REACT_APP_MAIN_SOCKET="https://dsocket.mermsemr.com"
|
||||||
|
|
||||||
|
# login footer links
|
||||||
|
REACT_APP_HOME_LINK='https://www.mermsemr.com/'
|
||||||
|
REACT_APP_ABOUT_LINK='https://www.mermsemr.com/about'
|
||||||
|
REACT_APP_CONTACTS_LINK='https://www.mermsemr.com/contacts'
|
||||||
|
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
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
SKIP_PREFLIGHT_CHECK=true
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
REACT_APP_NODE_ENV="development"
|
REACT_APP_NODE_ENV="development"
|
||||||
REACT_APP_SOCKET_URL="https://dev-socket.mermsemr.com"
|
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
|
||||||
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||||
REACT_APP_MEDIA_SERVER="https://dev-media.mermsemr.com"
|
REACT_APP_MEDIA_SERVER="https://qa-media.mermsemr.com"
|
||||||
REACT_APP_MAIN_SOCKET="https://dev-socket.mermsemr.com"
|
REACT_APP_MAIN_SOCKET="https://devsocket.mermsemr.com"
|
||||||
|
|
||||||
|
# login footer links
|
||||||
|
REACT_APP_HOME_LINK='https://qa-www.mermsemr.com/'
|
||||||
|
REACT_APP_ABOUT_LINK='https://qa-www.mermsemr.com/about'
|
||||||
|
REACT_APP_CONTACTS_LINK='https://qa-www.mermsemr.com/contacts'
|
||||||
|
REACT_APP_TERMS_LINK='https://qa-www.mermsemr.com/terms'
|
||||||
|
|
||||||
# Inactivity timeout/logout AT 10MINS
|
# Inactivity timeout/logout AT 10MINS
|
||||||
REACT_APP_TIMEOUT=600000
|
REACT_APP_TIMEOUT=600000
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
SKIP_PREFLIGHT_CHECK=true
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
REACT_APP_NODE_ENV="production"
|
REACT_APP_NODE_ENV="production"
|
||||||
REACT_APP_SOCKET_URL="https://socket.mermsemr.com"
|
REACT_APP_SOCKET_URL="https://socket.mermsemr.com"
|
||||||
REACT_APP_MAIN_API="https://api.mermsemr.com"
|
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||||
REACT_APP_MEDIA_SERVER="https://media.mermsemr.com"
|
REACT_APP_MEDIA_SERVER="https://media.mermsemr.com"
|
||||||
|
REACT_APP_MAIN_SOCKET="https://socket.mermsemr.com"
|
||||||
|
|
||||||
|
# login footer links
|
||||||
|
REACT_APP_HOME_LINK='https://www.mermsemr.com/'
|
||||||
|
REACT_APP_ABOUT_LINK='https://www.mermsemr.com/about'
|
||||||
|
REACT_APP_CONTACTS_LINK='https://www.mermsemr.com/contacts'
|
||||||
|
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
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
|
REACT_APP_NODE_ENV="development"
|
||||||
|
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
|
||||||
|
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
|
||||||
|
REACT_APP_MEDIA_SERVER="https://qa-media.mermsemr.com"
|
||||||
|
REACT_APP_MAIN_SOCKET="https://devsocket.mermsemr.com"
|
||||||
|
|
||||||
|
# login footer links
|
||||||
|
REACT_APP_HOME_LINK='https://qa-www.mermsemr.com/'
|
||||||
|
REACT_APP_ABOUT_LINK='https://qa-www.mermsemr.com/about'
|
||||||
|
REACT_APP_CONTACTS_LINK='https://qa-www.mermsemr.com/contacts'
|
||||||
|
REACT_APP_TERMS_LINK='https://qa-www.mermsemr.com/terms'
|
||||||
|
|
||||||
|
# Inactivity timeout/logout AT 10MINS
|
||||||
|
REACT_APP_TIMEOUT=600000
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
merms-panel:
|
merms-panel:
|
||||||
# image: registry.chiefsoft.net/wrenchboard-users-wrench:latest
|
image: registry.chiefsoft.net/merms-panel-reactjs:latest
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: docker/Dockerfile
|
dockerfile: docker/Dockerfile
|
||||||
@@ -20,7 +20,7 @@ services:
|
|||||||
extra_hosts:
|
extra_hosts:
|
||||||
- api.mermsemr.com:10.10.33.15
|
- api.mermsemr.com:10.10.33.15
|
||||||
- devapi.mermsemr.com:10.10.33.15
|
- devapi.mermsemr.com:10.10.33.15
|
||||||
- dev-socket.mermsemr.com:10.10.33.15
|
- devsocket.mermsemr.com:10.10.33.15
|
||||||
- socket.mermsemr.com:10.10.33.15
|
- socket.mermsemr.com:10.10.33.15
|
||||||
- dev-media.mermsemr.com:10.10.33.15
|
- dev-media.mermsemr.com:10.10.33.15
|
||||||
- media.mermsemr.com:10.10.33.15
|
- media.mermsemr.com:10.10.33.15
|
||||||
|
|||||||
@@ -33,7 +33,8 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start -e .env.development",
|
"start": "react-scripts start -e .env.development",
|
||||||
"build": "GENERATE_SOURCEMAP=false react-scripts build -e .env.production",
|
"build": "react-scripts start -e .env.development",
|
||||||
|
"build_real": "GENERATE_SOURCEMAP=false react-scripts build -e .env.production",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
},
|
},
|
||||||
|
|||||||
|
After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 18 KiB |
@@ -1,5 +1,5 @@
|
|||||||
.custom-bg {
|
.custom-bg {
|
||||||
background-image: url('./assets/bg/bg_1.jpg') !important;
|
background-image: url('./assets/bg/bg_2.jpg') !important;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
@@ -9,3 +9,42 @@
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.register{
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-links{
|
||||||
|
margin-top: 50px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-links a {
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 0px 20px;
|
||||||
|
border-right: 2px solid #6c757d;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-links a:nth-of-type(1){
|
||||||
|
padding-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-links a:last-child{
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button{
|
||||||
|
font-size: 1rem!important;
|
||||||
|
font-weight: 700!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-600 {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion-button, .accordion-button:not(.collapsed) {
|
||||||
|
background-color: transparent!important;
|
||||||
|
}
|
||||||
@@ -1,23 +1,28 @@
|
|||||||
import { QueryClientProvider, QueryClient } from '@tanstack/react-query'
|
import { QueryClientProvider, QueryClient } from '@tanstack/react-query'
|
||||||
|
import { Provider } from 'react-redux';
|
||||||
|
import store from './store/store'
|
||||||
import AppRouters from './AppRouters';
|
import AppRouters from './AppRouters';
|
||||||
|
|
||||||
import './App.css';
|
import './App.css';
|
||||||
|
|
||||||
|
|
||||||
function App() {
|
const queryClient = new QueryClient({
|
||||||
const queryClient = new QueryClient({
|
defaultOptions: {
|
||||||
defaultOptions: {
|
queries: {
|
||||||
queries: {
|
refetchOnWindowFocus: false,
|
||||||
refetchOnWindowFocus: false,
|
retry: 3,
|
||||||
retry: 3,
|
// refetchOnMount: false,
|
||||||
// refetchOnMount: false,
|
staleTime: 10*60*1000 // can also be a number in millisecond
|
||||||
staleTime: 3000
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
function App() {
|
||||||
return (
|
return (
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<AppRouters />
|
<Provider store={store}>
|
||||||
|
<AppRouters />
|
||||||
|
</Provider>
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Routes, Route } from 'react-router-dom';
|
|||||||
|
|
||||||
import UserExist from './component/authorization/UserExist';
|
import UserExist from './component/authorization/UserExist';
|
||||||
import AuthLayout from './component/auth/AuthLayout';
|
import AuthLayout from './component/auth/AuthLayout';
|
||||||
|
import BearerToken from './component/authorization/BearerToken';
|
||||||
import siteLinks from './links/siteLinks';
|
import siteLinks from './links/siteLinks';
|
||||||
|
|
||||||
import LoginPage from './views/LoginPage';
|
import LoginPage from './views/LoginPage';
|
||||||
@@ -17,32 +18,45 @@ import SettingsPage from './views/SettingsPage'
|
|||||||
import ProductPage from './views/ProductPage'
|
import ProductPage from './views/ProductPage'
|
||||||
import SocketIOContextProvider from './component/context/SocketIOContext';
|
import SocketIOContextProvider from './component/context/SocketIOContext';
|
||||||
import CSignupPage from './views/CSignupPage';
|
import CSignupPage from './views/CSignupPage';
|
||||||
|
import HelpPage from './views/HelpPage';
|
||||||
|
import SubscriptionPage from './views/SubscriptionPage';
|
||||||
|
import OnboardPage from "./views/OnboardPage";
|
||||||
|
import AccPWDResetPage from './views/AccPWDResetPage';
|
||||||
|
import ProfileCompletePage from './views/ProfileCompletePage';
|
||||||
|
|
||||||
|
|
||||||
function AppRouters() {
|
function AppRouters() {
|
||||||
return (
|
return (
|
||||||
<div className="">
|
<div className="">
|
||||||
<Routes>
|
<Routes>
|
||||||
{/* auth routes wrapper */}
|
<Route element={<BearerToken />}>
|
||||||
<Route element={<AuthLayout />}>
|
{/* auth routes wrapper */}
|
||||||
<Route path={siteLinks.home} element={<LoginPage />} />
|
<Route element={<AuthLayout />}>
|
||||||
<Route path={siteLinks.login} element={<LoginPage />} />
|
<Route path={siteLinks.home} element={<LoginPage />} />
|
||||||
<Route path={siteLinks.signup} element={<SignupPage />} />
|
<Route path={siteLinks.login} element={<LoginPage />} />
|
||||||
<Route path={siteLinks.forgetpwd} element={<ForgetpwdPage />} />
|
<Route path={siteLinks.signup} element={<SignupPage />} />
|
||||||
<Route path={siteLinks.csignup} element={<CSignupPage />} />
|
<Route path={siteLinks.forgetpwd} element={<ForgetpwdPage />} />
|
||||||
<Route path={siteLinks.error} element={<LoginPage />} />
|
<Route path={siteLinks.csignup} element={<CSignupPage />} />
|
||||||
</Route>
|
<Route path={siteLinks.accreset} element={<AccPWDResetPage />} />
|
||||||
|
<Route path={siteLinks.error} element={<LoginPage />} />
|
||||||
|
</Route>
|
||||||
|
|
||||||
{/* protected routes */}
|
{/* protected routes */}
|
||||||
<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.product} element={<ProductPage />} />
|
<Route path={siteLinks.profile_complete} element={<ProfileCompletePage />} />
|
||||||
<Route path={siteLinks.reports} element={<ReportsPage />} />
|
<Route path={siteLinks.product} element={<ProductPage />} />
|
||||||
<Route path={siteLinks.comments} element={<CommentsPage />} />
|
<Route path={siteLinks.reports} element={<ReportsPage />} />
|
||||||
<Route path={siteLinks.contacts} element={<ContactsPage />} />
|
<Route path={siteLinks.comments} element={<CommentsPage />} />
|
||||||
<Route path={siteLinks.user} element={<UserPage />} />
|
<Route path={siteLinks.contacts} element={<ContactsPage />} />
|
||||||
<Route path={siteLinks.calendar} element={<CalendarPage />} />
|
<Route path={siteLinks.user} element={<UserPage />} />
|
||||||
<Route path={siteLinks.settings} element={<SettingsPage />} />
|
<Route path={siteLinks.subscription} element={<SubscriptionPage />} />
|
||||||
|
<Route path={siteLinks.onboard} element={<OnboardPage />} />
|
||||||
|
<Route path={siteLinks.calendar} element={<CalendarPage />} />
|
||||||
|
<Route path={siteLinks.settings} element={<SettingsPage />} />
|
||||||
|
<Route path={siteLinks.help} element={<HelpPage />} />
|
||||||
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
|
|||||||
|
After Width: | Height: | Size: 390 KiB |
|
After Width: | Height: | Size: 995 B |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 101 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,220 @@
|
|||||||
|
import React, { useEffect, useState } from 'react'
|
||||||
|
import { Form, Formik } from "formik";
|
||||||
|
import * as Yup from "yup";
|
||||||
|
import { useDispatch } from 'react-redux'
|
||||||
|
|
||||||
|
import { Link, useNavigate, useParams } from 'react-router-dom'
|
||||||
|
import siteLinks from '../../links/siteLinks'
|
||||||
|
import { useMutation } from '@tanstack/react-query';
|
||||||
|
import { completePWDReset, verifyResetToken } from '../../services/services';
|
||||||
|
import { updateUserDetails } from '../../store/UserDetails'
|
||||||
|
|
||||||
|
import { IoMdArrowDropdown } from "react-icons/io";
|
||||||
|
import getImage from '../../utils/getImage';
|
||||||
|
|
||||||
|
const validationSchema = Yup.object().shape({
|
||||||
|
password: Yup.string().required("Password is required"),
|
||||||
|
confirmpassword: Yup.string().required("Confirm Password is required").oneOf([Yup.ref('password')], 'Passwords must match')
|
||||||
|
})
|
||||||
|
|
||||||
|
const initialValues = {
|
||||||
|
password: '',
|
||||||
|
confirmpassword: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function AccPWDReset() {
|
||||||
|
|
||||||
|
const {token} = useParams()
|
||||||
|
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
const [user, setUser] = useState(null)
|
||||||
|
|
||||||
|
// API to verify email link
|
||||||
|
const verifyLink = useMutation({
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return verifyResetToken(fields)
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
// console.log('res', res.data)
|
||||||
|
if(res.data.resultCode != '0' || !res?.data?.pending_uid){
|
||||||
|
throw({message: res?.data?.resultDescription})
|
||||||
|
}
|
||||||
|
// setUser({user:'testaccount', ...res.data})
|
||||||
|
setUser(res.data)
|
||||||
|
},
|
||||||
|
// onError: (err) => {
|
||||||
|
// console.log('err', err)
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
|
||||||
|
const resetPWD = useMutation({
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return completePWDReset(fields)
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
if(res?.data?.resultCode != '0'){
|
||||||
|
throw({message: res?.data?.resultDescription})
|
||||||
|
}
|
||||||
|
// const {token, room, uid} = res?.data
|
||||||
|
// if(!token || !room){
|
||||||
|
// throw({message: 'something went wrong, try again!'})
|
||||||
|
// }
|
||||||
|
// localStorage.setItem('token', token)
|
||||||
|
// localStorage.setItem('room', room)
|
||||||
|
// localStorage.setItem('uid', uid)
|
||||||
|
// dispatch(updateUserDetails({ ...res?.data }));
|
||||||
|
// navigate('/dash') // later add redux to dispatch state
|
||||||
|
},
|
||||||
|
// onError: (err) => {
|
||||||
|
// console.log('err', err)
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleCompletePWDReset = (values) => {
|
||||||
|
let reqData = {
|
||||||
|
reset_token: token,
|
||||||
|
reset_uid: user?.pending_uid,
|
||||||
|
new_password: values.password,
|
||||||
|
}
|
||||||
|
resetPWD.mutate(reqData)
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!token){
|
||||||
|
return navigate(siteLinks.login, {replace: true})
|
||||||
|
}
|
||||||
|
verifyLink.mutate({reset_token: token})
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="app">
|
||||||
|
<div className="app-wrap">
|
||||||
|
<div className="app-contant">
|
||||||
|
<div className="vh-100 bg-white custom-bg">
|
||||||
|
<div className="container-fluid p-0">
|
||||||
|
<div className="row no-gutters justify-content-center">
|
||||||
|
<div className="col-11 col-sm-6 col-lg-5 col-xxl-4 align-self-center order-2 order-sm-1" style={{maxWidth: '520px'}}>
|
||||||
|
<div className="mt-5 d-flex">
|
||||||
|
<div className="bg-white register p-5">
|
||||||
|
<h1 className="mb-2">MERMS Panel</h1>
|
||||||
|
{(verifyLink.isSuccess && !resetPWD.isSuccess) && <p>Complete your password reset</p>}
|
||||||
|
<div
|
||||||
|
>
|
||||||
|
<div className='mt-2'>
|
||||||
|
<div className="row">
|
||||||
|
{resetPWD.isSuccess ?
|
||||||
|
<>
|
||||||
|
<div className='col-12'>
|
||||||
|
<div className="rounded-2 d-flex flex-column justify-content-between align-items-center" style={{backgroundColor: '#F2FAF7'}}>
|
||||||
|
<h4 className='p-4 text-black'>Your password reset is completed</h4>
|
||||||
|
<img className='' style={{width: '150px'}} src={getImage('reset-password.png')} alt='reset-icon' />
|
||||||
|
<Link to={siteLinks.login} className='p-2 text-primary' style={{color: '#6FCAEF'}}>Home</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="col-12 mt-3">
|
||||||
|
<p>Go <Link to={siteLinks.home}> Back</Link></p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
{verifyLink.isPending ?
|
||||||
|
<div className='col-12'>
|
||||||
|
<div className="rounded-2 d-flex flex-column justify-content-center align-items-center" style={{height: '200px', backgroundColor: '#F2FAF7'}}>
|
||||||
|
<div className="col-12 d-flex flex-column justify-content-center align-items-center">
|
||||||
|
<p className='text-black'>loading...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
: verifyLink.isSuccess ?
|
||||||
|
<div className='col-12'>
|
||||||
|
<Formik
|
||||||
|
initialValues={initialValues}
|
||||||
|
validationSchema={validationSchema}
|
||||||
|
onSubmit={handleCompletePWDReset}
|
||||||
|
>
|
||||||
|
{(props) => {
|
||||||
|
return (
|
||||||
|
<Form className='mt-2'>
|
||||||
|
<div className="row">
|
||||||
|
<>
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="form-group">
|
||||||
|
<label className={`text-black fw-bold control-label`}>Username: {user?.user}</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="form-group">
|
||||||
|
<label className={`text-black fw-bold control-label ${(props.errors.password && props.touched.password) && 'text-danger'}`}>Password*</label>
|
||||||
|
<input type="password" name='password' className="form-control" placeholder="password" value={props.values.password} onChange={props.handleChange} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="form-group">
|
||||||
|
<label className={`text-black fw-bold control-label`}>Confirm Password* <span className={`${(props.errors.confirmpassword && props.touched.confirmpassword) && 'text-danger'}`}>{(props.errors.confirmpassword && props.touched.confirmpassword) && props.errors.confirmpassword}</span></label>
|
||||||
|
<input type="password" name='confirmpassword' className="form-control" placeholder="confirmpassword" value={props.values.confirmpassword} onChange={props.handleChange} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{resetPWD.error &&
|
||||||
|
<>
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-danger'>{resetPWD.error.message}</p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
|
||||||
|
<div className="col-12 mt-3 text-end">
|
||||||
|
<button type='submit' className="btn btn-primary text-uppercase">{resetPWD.isPending ? 'loading...' : 'reset password'}</button>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Formik>
|
||||||
|
</div>
|
||||||
|
: verifyLink.error ?
|
||||||
|
<>
|
||||||
|
<div className='col-12'>
|
||||||
|
<div className="rounded-2 d-flex flex-column justify-content-between align-items-center" style={{backgroundColor: '#E9D0DD'}}>
|
||||||
|
<h4 className='p-4 text-black'>Unable to continue password reset. Please start again</h4>
|
||||||
|
<img className='' style={{width: '150px'}} src={getImage('reset-password.png')} alt='reset-icon' />
|
||||||
|
<Link to={siteLinks.login} className='p-2 text-primary' style={{color: '#6FCAEF'}}>Home</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="col-12 mt-3">
|
||||||
|
<p>Go <Link to={siteLinks.home}> Back</Link></p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
null
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* <div className="custom-bg col-sm-6 col-xxl-9 col-lg-7 b-gradient o-hidden order-1 order-sm-2">
|
||||||
|
<div className="row align-items-center h-100">
|
||||||
|
<div className="col-7 mx-auto ">
|
||||||
|
<img className="img-fluid" src={LoginImg} alt="" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { Form, Formik } from "formik";
|
import { Form, Formik } from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
|
import { useDispatch } from 'react-redux'
|
||||||
|
|
||||||
import { Link, useNavigate, useParams } from 'react-router-dom'
|
import { Link, useNavigate, useParams } from 'react-router-dom'
|
||||||
import siteLinks from '../../links/siteLinks'
|
import siteLinks from '../../links/siteLinks'
|
||||||
import { useMutation } from '@tanstack/react-query';
|
import { useMutation } from '@tanstack/react-query';
|
||||||
import { completeRegistration, verifyEmail } from '../../services/services';
|
import { completeRegistration, verifyEmail } from '../../services/services';
|
||||||
|
import { updateUserDetails } from '../../store/UserDetails'
|
||||||
|
|
||||||
import { IoMdArrowDropdown } from "react-icons/io";
|
import { IoMdArrowDropdown } from "react-icons/io";
|
||||||
|
|
||||||
@@ -29,6 +31,8 @@ export default function CSignup() {
|
|||||||
|
|
||||||
const {jwt} = useParams()
|
const {jwt} = useParams()
|
||||||
|
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const [user, setUser] = useState(null)
|
const [user, setUser] = useState(null)
|
||||||
@@ -51,15 +55,19 @@ export default function CSignup() {
|
|||||||
return completeRegistration(fields)
|
return completeRegistration(fields)
|
||||||
},
|
},
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
const {token, room} = res?.data?.data
|
if(res?.data?.resultCode != '0'){
|
||||||
if(token){
|
throw({message: res?.data?.resultDescription})
|
||||||
localStorage.setItem('token', token)
|
|
||||||
localStorage.setItem('room', room)
|
|
||||||
// const data = {token}
|
|
||||||
// dispatch(updateUserDetails({ ...data }));
|
|
||||||
navigate('/dash') // later add redux to dispatch state
|
|
||||||
}
|
}
|
||||||
}
|
const {token, room, uid} = res?.data
|
||||||
|
if(!token || !room){
|
||||||
|
throw({message: 'something went wrong, try again!'})
|
||||||
|
}
|
||||||
|
localStorage.setItem('token', token)
|
||||||
|
localStorage.setItem('room', room)
|
||||||
|
localStorage.setItem('uid', uid)
|
||||||
|
dispatch(updateUserDetails({ ...res?.data }));
|
||||||
|
navigate('/dash') // later add redux to dispatch state
|
||||||
|
},
|
||||||
// onError: (err) => {
|
// onError: (err) => {
|
||||||
// console.log('err', err)
|
// console.log('err', err)
|
||||||
// }
|
// }
|
||||||
@@ -70,7 +78,7 @@ export default function CSignup() {
|
|||||||
country : values.country,
|
country : values.country,
|
||||||
username: values.username,
|
username: values.username,
|
||||||
password: values.password,
|
password: values.password,
|
||||||
verify_link: user.verify_link
|
verify_link: jwt
|
||||||
}
|
}
|
||||||
cSignup.mutate(reqData)
|
cSignup.mutate(reqData)
|
||||||
}
|
}
|
||||||
@@ -86,10 +94,10 @@ export default function CSignup() {
|
|||||||
<div className="app">
|
<div className="app">
|
||||||
<div className="app-wrap">
|
<div className="app-wrap">
|
||||||
<div className="app-contant">
|
<div className="app-contant">
|
||||||
<div className="bg-white custom-bg">
|
<div className="vh-100 bg-white custom-bg">
|
||||||
<div className="container-fluid p-0">
|
<div className="container-fluid p-0">
|
||||||
<div className="row no-gutters justify-content-center">
|
<div className="row no-gutters justify-content-center">
|
||||||
<div className="col-sm-6 col-lg-5 col-xxl-3 align-self-center order-2 order-sm-1 h-100-vh">
|
<div className="col-11 col-sm-6 col-lg-5 col-xxl-4 align-self-center order-2 order-sm-1" style={{maxWidth: '520px'}}>
|
||||||
<div className="mt-5 d-flex">
|
<div className="mt-5 d-flex">
|
||||||
<div className="bg-white register p-5">
|
<div className="bg-white register p-5">
|
||||||
<h1 className="mb-2">MERMS Panel</h1>
|
<h1 className="mb-2">MERMS Panel</h1>
|
||||||
@@ -196,7 +204,7 @@ export default function CSignup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div className="col-12 mt-3 text-center">
|
<div className="col-12 mt-3 text-center">
|
||||||
<Link to={siteLinks.login} className='text-primary' style={{color: '#6FCAEF'}}>Need help with logging in or signing up?</Link>
|
<Link to={siteLinks.signup} className='text-primary' style={{color: '#6FCAEF'}}>Need help with logging in or signing up?</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 mt-3 text-center">
|
<div className="col-12 mt-3 text-center">
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export default function ExtFooter() {
|
||||||
|
return <div className="login-links">
|
||||||
|
<a href={process.env.REACT_APP_HOME_LINK}>Home</a>
|
||||||
|
<a href={process.env.REACT_APP_ABOUT_LINK}>About</a>
|
||||||
|
<a href={process.env.REACT_APP_CONTACTS_LINK}>Contact</a>
|
||||||
|
<a href={process.env.REACT_APP_TERMS_LINK}>Terms</a>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
@@ -7,10 +7,11 @@ import { Link } from 'react-router-dom'
|
|||||||
import siteLinks from '../../links/siteLinks'
|
import siteLinks from '../../links/siteLinks'
|
||||||
import { useMutation } from '@tanstack/react-query'
|
import { useMutation } from '@tanstack/react-query'
|
||||||
import { recoverPWD } from '../../services/services';
|
import { recoverPWD } from '../../services/services';
|
||||||
|
import getImage from '../../utils/getImage';
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
username: Yup.string()
|
username: Yup.string()
|
||||||
.email("Wrong email format")
|
// .email("Wrong email format")
|
||||||
// .matches(
|
// .matches(
|
||||||
// /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/,
|
// /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/,
|
||||||
// "Invalid email format"
|
// "Invalid email format"
|
||||||
@@ -43,14 +44,14 @@ export default function Forgetpwd2() {
|
|||||||
<div className="app">
|
<div className="app">
|
||||||
<div className="app-wrap">
|
<div className="app-wrap">
|
||||||
<div className="app-contant">
|
<div className="app-contant">
|
||||||
<div className="bg-white">
|
<div className="vh-100 bg-white custom-bg">
|
||||||
<div className="container-fluid p-0">
|
<div className="container-fluid p-0">
|
||||||
<div className="row no-gutters">
|
<div className="row no-gutters justify-content-center">
|
||||||
<div className="col-sm-6 col-lg-5 col-xxl-3 align-self-center order-2 order-sm-1">
|
<div className="col-11 col-sm-6 col-lg-5 col-xxl-4 align-self-center order-2 order-sm-1h" style={{maxWidth: '520px'}}>
|
||||||
<div className="d-flex align-items-center h-100-vh">
|
<div className="mt-5 d-flex">
|
||||||
<div className="login p-50">
|
<div className="bg-white register p-5">
|
||||||
<h1 className="mb-2">Recover Password</h1>
|
<h1 className="mb-2">MERMS Panel</h1>
|
||||||
<p>Please enter your email.</p>
|
{!mutation.isSuccess && <p>Please enter your username.</p>}
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
validationSchema={validationSchema}
|
validationSchema={validationSchema}
|
||||||
@@ -64,8 +65,8 @@ export default function Forgetpwd2() {
|
|||||||
<>
|
<>
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label className={`text-black fw-bold control-label ${(props.errors.username && props.touched.username) && 'text-danger'}`}>Email*</label>
|
<label className={`text-black fw-bold control-label ${(props.errors.username && props.touched.username) && 'text-danger'}`}>Username*</label>
|
||||||
<input type="email" name='username' className="form-control" placeholder="Email" value={props.values.username} onChange={props.handleChange} />
|
<input type="text" name='username' className="form-control" placeholder="Username" value={props.values.username} onChange={props.handleChange} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{mutation.error &&
|
{mutation.error &&
|
||||||
@@ -81,8 +82,9 @@ export default function Forgetpwd2() {
|
|||||||
</>
|
</>
|
||||||
:
|
:
|
||||||
<div className='col-12'>
|
<div className='col-12'>
|
||||||
<div className="rounded-2 d-flex flex-column justify-content-between align-items-center" style={{height: '200px', backgroundColor: '#F2FAF7'}}>
|
<div className="rounded-2 d-flex flex-column justify-content-between align-items-center" style={{backgroundColor: '#F2FAF7'}}>
|
||||||
<h4 className='p-4 text-black'>Check your email to continue password reset.</h4>
|
<h4 className='p-4 text-black'>Check your email to continue password reset.</h4>
|
||||||
|
<img className='' style={{width: '150px'}} src={getImage('reset-password.png')} alt='reset-icon' />
|
||||||
<Link to={siteLinks.login} className='p-2 text-primary' style={{color: '#6FCAEF'}}>Home</Link>
|
<Link to={siteLinks.login} className='p-2 text-primary' style={{color: '#6FCAEF'}}>Home</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,13 +100,13 @@ export default function Forgetpwd2() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="custom-bg col-sm-6 col-xxl-9 col-lg-7 b-gradient o-hidden order-1 order-sm-2">
|
{/* <div className="custom-bg col-sm-6 col-xxl-9 col-lg-7 b-gradient o-hidden order-1 order-sm-2">
|
||||||
<div className="row align-items-center h-100">
|
<div className="row align-items-center h-100">
|
||||||
<div className="col-7 mx-auto ">
|
<div className="col-7 mx-auto ">
|
||||||
{/* <img className="img-fluid" src={LoginImg} alt="" /> */}
|
<img className="img-fluid" src={LoginImg} alt="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { useMutation } from '@tanstack/react-query'
|
import { useMutation } from '@tanstack/react-query'
|
||||||
import { useDispatch } from 'react-redux'
|
import { useDispatch, useSelector } from 'react-redux'
|
||||||
|
|
||||||
// import LoginImg from '../../assets/bg/login.svg'
|
// import LoginImg from '../../assets/bg/login.svg'
|
||||||
|
|
||||||
@@ -14,14 +14,17 @@ import IOSDownload from '../../assets/img/download/apple.jpg'
|
|||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
|
|
||||||
|
const { userDetails: { token, room }} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
||||||
|
let loggedIn = token && room ? true : false; // variable to determine if user is logged in
|
||||||
|
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const [fields, setFields] = useState({
|
const [fields, setFields] = useState({
|
||||||
username: localStorage.getItem('username') || '',
|
username: '',
|
||||||
password: '',
|
password: '',
|
||||||
remember: localStorage.getItem('username') ? true : false
|
remember: false
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleChange = ({target:{name, value}}) => {
|
const handleChange = ({target:{name, value}}) => {
|
||||||
@@ -37,20 +40,25 @@ export default function Login() {
|
|||||||
throw new Error('Please provide all fields marked *')
|
throw new Error('Please provide all fields marked *')
|
||||||
}
|
}
|
||||||
rememberMe(fields.remember) // FUNCTION TO SAVE USERNAME OF THE USER TO LOCAL STORAGE
|
rememberMe(fields.remember) // FUNCTION TO SAVE USERNAME OF THE USER TO LOCAL STORAGE
|
||||||
|
delete fields.remember // REMOVING REMEMBER FROM THE PAYLOAD
|
||||||
return loginUser(fields)
|
return loginUser(fields)
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
},
|
},
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
const {token, room} = res?.data?.data
|
if(res?.data?.error_message){
|
||||||
if(token){
|
throw({message: res?.data?.error_message})
|
||||||
localStorage.setItem('token', token)
|
|
||||||
localStorage.setItem('room', room)
|
|
||||||
// const data = {token}
|
|
||||||
// dispatch(updateUserDetails({ ...data }));
|
|
||||||
navigate('/dash') // later add redux to dispatch state
|
|
||||||
}
|
}
|
||||||
|
const {token, room, uid} = res?.data
|
||||||
|
if(!token || !room){
|
||||||
|
throw({message: 'something went wrong, try again!'})
|
||||||
|
}
|
||||||
|
localStorage.setItem('token', token)
|
||||||
|
localStorage.setItem('room', room)
|
||||||
|
localStorage.setItem('uid', uid)
|
||||||
|
dispatch(updateUserDetails({ ...res?.data }));
|
||||||
|
navigate('/dash') // later add redux to dispatch state
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -62,16 +70,22 @@ export default function Login() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(()=>{ // NAVIGATES USER TO HOME PAGE IF USER IS ACTIVE
|
||||||
|
if(loggedIn){
|
||||||
|
navigate(siteLinks.dash)
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="app">
|
<div className="app">
|
||||||
<div className="app-wrap">
|
<div className="app-wrap">
|
||||||
<div className="app-contant">
|
<div className="app-contant">
|
||||||
<div className="bg-white">
|
<div className="vh-100 custom-bg">
|
||||||
<div className="container-fluid p-0">
|
<div className="container-fluid p-0">
|
||||||
<div className="row no-gutters">
|
<div className="row no-gutters justify-content-center">
|
||||||
<div className="col-sm-6 col-lg-5 col-xxl-3 align-self-center order-2 order-sm-1">
|
<div className="col-11 col-sm-6 col-lg-5 col-xxl-4 align-self-center order-2 order-sm-1" style={{maxWidth: '520px'}}>
|
||||||
<div className="d-flex align-items-center h-100-vh">
|
<div className="mt-5 d-flex">
|
||||||
<div className="login p-50">
|
<div className="bg-white register px-5 pt-5 pb-3">
|
||||||
<h1 className="mb-2">MERMS Panel</h1>
|
<h1 className="mb-2">MERMS Panel</h1>
|
||||||
<p>Welcome back, please login to your account.</p>
|
<p>Welcome back, please login to your account.</p>
|
||||||
<form className="mt-3 mt-sm-5">
|
<form className="mt-3 mt-sm-5">
|
||||||
@@ -79,19 +93,19 @@ export default function Login() {
|
|||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label className="control-label text-black fw-bold">User Name*</label>
|
<label className="control-label text-black fw-bold">User Name*</label>
|
||||||
<input name='username' value={fields.username} onChange={handleChange} type="text" className="form-control" placeholder="Username" />
|
<input maxLength={55} name='username' value={fields.username} onChange={handleChange} type="text" className="form-control" placeholder="Username" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label className="control-label text-black fw-bold">Password*</label>
|
<label className="control-label text-black fw-bold">Password*</label>
|
||||||
<input name='password' value={fields.password} onChange={handleChange} type="password" className="form-control" placeholder="Password" />
|
<input maxLength={55} name='password' value={fields.password} onChange={handleChange} type="password" className="form-control" placeholder="Password" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<div className="d-block d-sm-flex align-items-center">
|
<div className="d-block d-sm-flex align-items-center">
|
||||||
<div className="form-check">
|
<div className="form-check">
|
||||||
<input className="form-check-input" type="checkbox" id="gridCheck" name='remember' checked={fields.remember} onChange={handleChange} disabled={!fields.username ? true : false} />
|
<input className="form-check-input" type="checkbox" id="gridCheck" name='remember' checked={fields.remember || false} onChange={handleChange} disabled={!fields.username ? true : false} />
|
||||||
<label className="form-check-label text-black" htmlFor="gridCheck">
|
<label className="form-check-label text-black" htmlFor="gridCheck">
|
||||||
Remember Me
|
Remember Me
|
||||||
</label>
|
</label>
|
||||||
@@ -110,7 +124,7 @@ export default function Login() {
|
|||||||
<button type='button' onClick={()=>{login.mutate(fields)}} className="btn btn-primary text-uppercase">{login.isPending ? 'loading...' : 'Sign In'}</button>
|
<button type='button' onClick={()=>{login.mutate(fields)}} className="btn btn-primary text-uppercase">{login.isPending ? 'loading...' : 'Sign In'}</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 mt-3">
|
<div className="col-12 mt-3">
|
||||||
<p>Don't have an account ?<Link to={siteLinks.signup}> Sign Up</Link></p>
|
<p>Don't have an account ?<Link to={siteLinks.signup}><span style={{fontWeight: 'bolder'}}>Sign Up</span></Link></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -119,7 +133,7 @@ export default function Login() {
|
|||||||
<div className="app-store-icons-wrap text-center">
|
<div className="app-store-icons-wrap text-center">
|
||||||
<a className="icon google"
|
<a className="icon google"
|
||||||
href='#' >
|
href='#' >
|
||||||
<img src={IOSDownload} className='w-100 h-auto' alt='IOS Download' />
|
<img src={IOSDownload} className='w-80 h-auto' alt='IOS Download' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -127,21 +141,29 @@ export default function Login() {
|
|||||||
<div className="col-6">
|
<div className="col-6">
|
||||||
<div className="app-store-icons-wrap text-center">
|
<div className="app-store-icons-wrap text-center">
|
||||||
<a className="icon apple" href='#'>
|
<a className="icon apple" href='#'>
|
||||||
<img src={GoogleDownload} className='w-100 h-auto' alt='IOS Download' />
|
<img src={GoogleDownload} className='w-80 h-auto' alt='IOS Download' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="login-links">
|
||||||
|
<a href={process.env.REACT_APP_HOME_LINK}>Home</a>
|
||||||
|
<a href={process.env.REACT_APP_ABOUT_LINK}>About</a>
|
||||||
|
<a href={process.env.REACT_APP_CONTACTS_LINK}>Contact</a>
|
||||||
|
<a href={process.env.REACT_APP_TERMS_LINK}>Terms</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="custom-bg col-sm-6 col-xxl-9 col-lg-7 b-gradient o-hidden order-1 order-sm-2">
|
{/* <div className="custom-bg col-sm-6 col-xxl-9 col-lg-7 b-gradient o-hidden order-1 order-sm-2">
|
||||||
<div className="row align-items-center h-100">
|
<div className="row align-items-center h-100">
|
||||||
<div className="col-7 mx-auto ">
|
<div className="col-7 mx-auto ">
|
||||||
{/* <img className="img-fluid" src={LoginImg} alt="" /> */}
|
<img className="img-fluid" src={LoginImg} alt="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { Link } from 'react-router-dom'
|
|||||||
import siteLinks from '../../links/siteLinks'
|
import siteLinks from '../../links/siteLinks'
|
||||||
import { useMutation } from '@tanstack/react-query';
|
import { useMutation } from '@tanstack/react-query';
|
||||||
import { signUpUser } from '../../services/services';
|
import { signUpUser } from '../../services/services';
|
||||||
|
import getImage from '../../utils/getImage';
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
email: Yup.string()
|
email: Yup.string()
|
||||||
@@ -49,6 +50,7 @@ export default function Signup2() {
|
|||||||
const signUp = (values) => {
|
const signUp = (values) => {
|
||||||
// helpers.resetForm()
|
// helpers.resetForm()
|
||||||
// console.log('values', values, helpers)
|
// console.log('values', values, helpers)
|
||||||
|
delete values.isChecked
|
||||||
mutation.mutate(values)
|
mutation.mutate(values)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,104 +58,105 @@ export default function Signup2() {
|
|||||||
<div className="app">
|
<div className="app">
|
||||||
<div className="app-wrap">
|
<div className="app-wrap">
|
||||||
<div className="app-contant">
|
<div className="app-contant">
|
||||||
<div className="bg-white">
|
<div className="vh-100 bg-white custom-bg">
|
||||||
<div className="container-fluid p-0">
|
<div className="container-fluid p-0">
|
||||||
<div className="row no-gutters">
|
<div className="row no-gutters justify-content-center">
|
||||||
<div className="col-sm-6 col-lg-5 col-xxl-3 align-self-center order-2 order-sm-1">
|
<div className="col-11 col-sm-6 col-lg-5 col-xxl-4 align-self-center order-2 order-sm-1" style={{maxWidth: '520px'}}>
|
||||||
<div className="d-flex align-items-center h-100-vh">
|
<div className="mt-5 d-flex">
|
||||||
<div className="register p-5">
|
<div className="bg-white register p-5">
|
||||||
<h1 className="mb-2">MERMS Panel</h1>
|
<h1 className="mb-2">MERMS Panel</h1>
|
||||||
<p>Welcome, Please create your account.</p>
|
<p>Welcome, Please create your account.</p>
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
validationSchema={validationSchema}
|
validationSchema={validationSchema}
|
||||||
onSubmit={signUp}
|
onSubmit={signUp}
|
||||||
>
|
>
|
||||||
{(props) => {
|
{(props) => {
|
||||||
return (
|
return (
|
||||||
<Form className='mt-2 mt-sm-5'>
|
<Form className='mt-2 mt-sm-5'>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
{!mutation.isSuccess ?
|
{!mutation.isSuccess ?
|
||||||
<>
|
<>
|
||||||
<div className="col-12 col-sm-6">
|
<div className="col-12 col-md-6">
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label className={`text-black fw-bold control-label ${(props.errors.firstname && props.touched.firstname) && 'text-danger'}`}>First Name*</label>
|
<label className={`text-black fw-bold control-label ${(props.errors.firstname && props.touched.firstname) && 'text-danger'}`}>First Name*</label>
|
||||||
<input type="text" name='firstname' className="form-control" placeholder="First Name" value={props.values.firstname} onChange={props.handleChange} />
|
<input type="text" name='firstname' className="form-control" placeholder="First Name" value={props.values.firstname} onChange={props.handleChange} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="col-12 col-md-6">
|
||||||
<div className="col-12 col-sm-6">
|
<div className="form-group">
|
||||||
<div className="form-group">
|
<label className={`text-black fw-bold control-label ${(props.errors.lastname && props.touched.lastname) && 'text-danger'}`}>Last Name*</label>
|
||||||
<label className={`text-black fw-bold control-label ${(props.errors.lastname && props.touched.lastname) && 'text-danger'}`}>Last Name*</label>
|
<input type="text" name='lastname' className="form-control" placeholder="Last Name" value={props.values.lastname} onChange={props.handleChange} />
|
||||||
<input type="text" name='lastname' className="form-control" placeholder="Last Name" value={props.values.lastname} onChange={props.handleChange} />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div className="col-12">
|
|
||||||
<div className="form-group">
|
|
||||||
<label className={`text-black fw-bold control-label ${(props.errors.email && props.touched.email) && 'text-danger'}`}>Email*</label>
|
|
||||||
<input type="email" name='email' className="form-control" placeholder="Email" value={props.values.email} onChange={props.handleChange} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/* <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="text" name='username' className="form-control" placeholder="Username" value={props.values.username} onChange={props.handleChange} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="col-12">
|
|
||||||
<div className="form-group">
|
|
||||||
<label className={`text-black fw-bold control-label ${(props.errors.password && props.touched.password) && 'text-danger'}`}>Password*</label>
|
|
||||||
<input type="password" name='password' className="form-control" placeholder="Password" value={props.values.password} onChange={props.handleChange} />
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
<div className="col-12">
|
|
||||||
<div className="form-check">
|
|
||||||
<input name='isChecked' className="form-check-input" type="checkbox" id="gridCheck" value={props.values.isChecked} onChange={props.handleChange} />
|
|
||||||
<label className="form-check-label" htmlFor="gridCheck">
|
|
||||||
I accept terms & policy
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<span className={`${(props.errors.isChecked && props.touched.isChecked) && 'text-danger'}`}>{props.errors.isChecked}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{mutation.error &&
|
|
||||||
<>
|
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<p className='text-danger'>{mutation.error.message}</p>
|
<div className="form-group">
|
||||||
|
<label className={`text-black fw-bold control-label ${(props.errors.email && props.touched.email) && 'text-danger'}`}>Email*</label>
|
||||||
|
<input type="email" name='email' className="form-control" placeholder="Email" value={props.values.email} onChange={props.handleChange} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* <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="text" name='username' className="form-control" placeholder="Username" value={props.values.username} onChange={props.handleChange} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="form-group">
|
||||||
|
<label className={`text-black fw-bold control-label ${(props.errors.password && props.touched.password) && 'text-danger'}`}>Password*</label>
|
||||||
|
<input type="password" name='password' className="form-control" placeholder="Password" value={props.values.password} onChange={props.handleChange} />
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="form-check">
|
||||||
|
<input name='isChecked' className="form-check-input" type="checkbox" id="gridCheck" value={props.values.isChecked} onChange={props.handleChange} />
|
||||||
|
<label className="form-check-label" htmlFor="gridCheck">
|
||||||
|
I accept terms & policy
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<span className={`${(props.errors.isChecked && props.touched.isChecked) && 'text-danger'}`}>{props.errors.isChecked}</span>
|
||||||
</div>
|
</div>
|
||||||
</>
|
|
||||||
}
|
|
||||||
|
|
||||||
<div className="col-12 mt-3 text-end">
|
{mutation.error &&
|
||||||
<button type='submit' className="btn btn-primary text-uppercase">{mutation.isPending ? 'loading...' : 'Sign up'}</button>
|
<>
|
||||||
</div>
|
<div className="col-12">
|
||||||
</>
|
<p className='text-danger'>{mutation.error.message}</p>
|
||||||
:
|
</div>
|
||||||
<div className='col-12'>
|
</>
|
||||||
<div className="rounded-2 d-flex flex-column justify-content-between align-items-center" style={{height: '200px', backgroundColor: '#F2FAF7'}}>
|
}
|
||||||
<h4 className='p-4 text-black'>Check your email to continue.</h4>
|
|
||||||
<Link to={siteLinks.login} className='p-2 text-primary' style={{color: '#6FCAEF'}}>Home</Link>
|
<div className="col-12 mt-3 text-end">
|
||||||
|
<button type='submit' className="btn btn-primary text-uppercase">{mutation.isPending ? 'loading...' : 'Sign up'}</button>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
<div className='col-12'>
|
||||||
|
<div className="rounded-2 d-flex flex-column justify-content-between align-items-center" style={{backgroundColor: '#F2FAF7'}}>
|
||||||
|
<h4 className='p-4 text-black' style={{marginBottom: '-30px'}}>Check your email to continue.</h4>
|
||||||
|
<img className='' style={{width: '200px'}} src={getImage('check-mail.png')} alt='mail-alert' />
|
||||||
|
<Link to={siteLinks.login} className='p-2 text-primary' style={{color: '#6FCAEF'}}>Home</Link>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<div className="col-12 mt-3">
|
||||||
|
<p>Already have an account ?<Link to={siteLinks.login}> Sign In</Link></p>
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
|
|
||||||
<div className="col-12 mt-3">
|
|
||||||
<p>Already have an account ?<Link to={siteLinks.login}> Sign In</Link></p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Form>
|
||||||
</Form>
|
);
|
||||||
);
|
}}
|
||||||
}}
|
</Formik>
|
||||||
</Formik>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="signup-bg col-sm-6 col-xxl-9 col-lg-7 b-gradient o-hidden order-1 order-sm-2">
|
|
||||||
<div className="row align-items-center h-100">
|
|
||||||
<div className="col-7 mx-auto ">
|
|
||||||
{/* <img className="img-fluid" src={LoginImg} alt="" /> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* <div className="signup-bg col-sm-6 col-xxl-9 col-lg-7 b-gradient o-hidden order-1 order-sm-2">
|
||||||
|
<div className="row align-items-center h-100">
|
||||||
|
<div className="col-7 mx-auto ">
|
||||||
|
<img className="img-fluid" src={LoginImg} alt="" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import {useEffect} from 'react'
|
||||||
|
import { useMutation } from '@tanstack/react-query'
|
||||||
|
import { Outlet } from 'react-router-dom'
|
||||||
|
import MainLoaderBS from '../loaders/MainLoaderBS'
|
||||||
|
|
||||||
|
import { userToken } from '../../services/services'
|
||||||
|
|
||||||
|
export default function BearerToken() {
|
||||||
|
const bearerToken = useMutation({
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return userToken(fields)
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
console.log(error)
|
||||||
|
// window.location.reload(true)
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
if(res?.data?.resultCode != '0'){
|
||||||
|
throw({message: 'Something went wrong'})
|
||||||
|
}
|
||||||
|
const {access_token, refresh_token} = res?.data?.data
|
||||||
|
if(access_token){
|
||||||
|
localStorage.setItem('access_token', access_token)
|
||||||
|
}else{
|
||||||
|
throw({message: 'Something went wrong'})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
let reqData = {
|
||||||
|
"username": "user",
|
||||||
|
"password": "password"
|
||||||
|
}
|
||||||
|
bearerToken.mutate(reqData)
|
||||||
|
},[])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{bearerToken.isPending ?
|
||||||
|
<MainLoaderBS />
|
||||||
|
:
|
||||||
|
<Outlet />
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { Outlet, useNavigate } from 'react-router-dom'
|
import { Outlet, useNavigate } from 'react-router-dom'
|
||||||
|
import { useMutation } from '@tanstack/react-query'
|
||||||
|
|
||||||
import { updateUserDetails } from "../../store/UserDetails";
|
import { updateUserDetails } from "../../store/UserDetails";
|
||||||
|
import { userInfo } from '../../services/services'
|
||||||
import MainLoaderBS from '../loaders/MainLoaderBS'
|
import MainLoaderBS from '../loaders/MainLoaderBS'
|
||||||
import Layout from '../layout/Layout'
|
import Layout from '../layout/Layout'
|
||||||
import siteLinks from '../../links/siteLinks'
|
import siteLinks from '../../links/siteLinks'
|
||||||
|
|
||||||
import debounceFunction from '../../utils/debounceFunction'
|
import debounceFunction from '../../utils/debounceFunction'
|
||||||
import { accountDashboard } from '../../services/services';
|
|
||||||
import { SocketContextValues } from '../context/SocketIOContext';
|
import { SocketContextValues } from '../context/SocketIOContext';
|
||||||
|
|
||||||
|
|
||||||
@@ -23,9 +25,9 @@ export default function UserExist() {
|
|||||||
|
|
||||||
const [lastActivityTime, setLastActivityTime] = useState(Date.now()); // HOLDS THE INITIAL TIME USER LOGS IN
|
const [lastActivityTime, setLastActivityTime] = useState(Date.now()); // HOLDS THE INITIAL TIME USER LOGS IN
|
||||||
|
|
||||||
const { userDetails: { lastname }} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
const { userDetails: { token, room }} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
||||||
|
|
||||||
let loggedIn = lastname ? true : false; // variable to determine if user is logged in
|
let loggedIn = token && room ? true : false; // variable to determine if user is logged in
|
||||||
// console.log('loggedIn', loggedIn)
|
// console.log('loggedIn', loggedIn)
|
||||||
|
|
||||||
// Function to log the user out
|
// Function to log the user out
|
||||||
@@ -40,6 +42,31 @@ export default function UserExist() {
|
|||||||
debounceFunction(setLastActivityTime(Date.now()), 1000)
|
debounceFunction(setLastActivityTime(Date.now()), 1000)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const getUser = useMutation({
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return userInfo(fields)
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
navigate(siteLinks.login)
|
||||||
|
setLoading(false)
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
const {token, room, uid} = res?.data
|
||||||
|
if(!token || !room){
|
||||||
|
navigate(siteLinks.login)
|
||||||
|
setLoading(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
localStorage.setItem('token', token)
|
||||||
|
localStorage.setItem('room', room)
|
||||||
|
localStorage.setItem('uid', uid)
|
||||||
|
dispatch(updateUserDetails({ ...res?.data }));
|
||||||
|
setLoading(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
const timer = setTimeout(()=>{
|
const timer = setTimeout(()=>{
|
||||||
if(Date.now() - Number(lastActivityTime) >= Number(process.env.REACT_APP_TIMEOUT)){
|
if(Date.now() - Number(lastActivityTime) >= Number(process.env.REACT_APP_TIMEOUT)){
|
||||||
@@ -64,35 +91,19 @@ export default function UserExist() {
|
|||||||
},[lastActivityTime])
|
},[lastActivityTime])
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
accountDashboard().then(res => {
|
let token = localStorage.getItem('token') // USER TOKEN
|
||||||
const {dash_data} = res?.data
|
let uid = localStorage.getItem('uid') // USER UID
|
||||||
|
if(token && loggedIn){
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
dispatch(updateUserDetails({ ...dash_data }));
|
}else if(token && uid && !loggedIn){
|
||||||
}).catch(err => {
|
const reqData = {token, uid}
|
||||||
|
getUser.mutate(reqData)
|
||||||
|
}else{
|
||||||
navigate(siteLinks.login)
|
navigate(siteLinks.login)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
})
|
}
|
||||||
},[])
|
},[])
|
||||||
|
|
||||||
|
|
||||||
// useEffect(()=>{
|
|
||||||
// let token = localStorage.getItem('token')
|
|
||||||
// const timer = setTimeout(()=>{
|
|
||||||
// if(token && loggedIn){
|
|
||||||
// setLoading(false)
|
|
||||||
// }else if(token && !loggedIn){
|
|
||||||
// const data = {token}
|
|
||||||
// dispatch(updateUserDetails({ ...data }));
|
|
||||||
// setLoading(false)
|
|
||||||
// // dispatch(updateUserDetails({ ...res.data }));
|
|
||||||
// }else{
|
|
||||||
// navigate('auth/login')
|
|
||||||
// }
|
|
||||||
// },1000)
|
|
||||||
|
|
||||||
// return () => clearTimeout(timer)
|
|
||||||
// },[])
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(localStorage.getItem('room')){
|
if(localStorage.getItem('room')){
|
||||||
joinRoom(localStorage.getItem('room'));
|
joinRoom(localStorage.getItem('room'));
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
import React, { useCallback, useState } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
|
import { useMutation, useQuery } from '@tanstack/react-query'
|
||||||
|
|
||||||
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
import EventCalendar from "./EventCalendar";
|
import EventCalendar from "./EventCalendar";
|
||||||
import ExternalDraggable from "./ExternalDraggable";
|
import ExternalDraggable from "./ExternalDraggable";
|
||||||
|
|
||||||
|
import { getCalendarEvents } from '../../services/services'
|
||||||
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
|
||||||
|
|
||||||
export default function Calendar(){
|
export default function Calendar(){
|
||||||
|
|
||||||
@@ -11,14 +16,46 @@ export default function Calendar(){
|
|||||||
// setDraggedEvent(event)
|
// setDraggedEvent(event)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
const events = [
|
// const {data, isFetching, isError, error} = useQuery({
|
||||||
{id: '1111', title: 'Family Vacation', color: 'fc-event-primary', start: new Date('2025-01-18')},
|
// queryKey: queryKeys.calendar_events,
|
||||||
{id: '2222', title: 'Meeting In Office', color: 'fc-event-warning', start: new Date('2025-01-19')},
|
// queryFn: () => getCalendarEvents()
|
||||||
{id: '3333', title: 'Client Call', color: 'fc-event-danger', start: new Date('2025-01-22')},
|
// })
|
||||||
{id: '4444', title: 'Interview', color: 'fc-event-success', start: new Date('2025-01-1')}
|
|
||||||
]
|
|
||||||
|
|
||||||
const [dummyEvents, setDummyEvents] = useState(events)
|
// const calendarEvents = useMutation({
|
||||||
|
// mutationFn: (reqData) => {
|
||||||
|
// return getCalendarEvents(reqData)
|
||||||
|
// },
|
||||||
|
// onError: (error) => {
|
||||||
|
// console.log(error)
|
||||||
|
// },
|
||||||
|
// onSuccess: (res) => {
|
||||||
|
// if(res?.data?.resultCode != '0'){
|
||||||
|
// throw({message: 'Something went wrong'})
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
// useEffect(()=>{
|
||||||
|
// let reqData = {
|
||||||
|
// token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
// uid: localStorage.getItem('uid') // USER UID
|
||||||
|
// }
|
||||||
|
// calendarEvents.mutate(reqData)
|
||||||
|
// },[])
|
||||||
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
|
queryKey: queryKeys.calendar_events,
|
||||||
|
queryFn: () => getCalendarEvents(reqData)
|
||||||
|
})
|
||||||
|
|
||||||
|
const receievedEvents = data?.data
|
||||||
|
const category = receievedEvents?.category //EVENT CATEGORIES FROM API
|
||||||
|
const eventList = receievedEvents?.list //EVENT LIST FROM API
|
||||||
|
|
||||||
|
const [activeCategory, setActiveCategory] = useState('1')
|
||||||
|
|
||||||
const [removeAfterDrop, setRemoveAfterDrop] = useState(false)
|
const [removeAfterDrop, setRemoveAfterDrop] = useState(false)
|
||||||
|
|
||||||
@@ -33,11 +70,14 @@ export default function Calendar(){
|
|||||||
const handleAddNewEvent = () => {
|
const handleAddNewEvent = () => {
|
||||||
if(newEvent.title && newEvent.color){
|
if(newEvent.title && newEvent.color){
|
||||||
const eventToAdd = {...newEvent}
|
const eventToAdd = {...newEvent}
|
||||||
setDummyEvents(prev => ([...prev, eventToAdd]))
|
// setDefaultCategory(prev => ([...prev, eventToAdd]))
|
||||||
setNewEvent({title: '', color: ''})
|
setNewEvent({title: '', color: ''})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleActiveCategory = (id) => {
|
||||||
|
setActiveCategory(id)
|
||||||
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
@@ -47,45 +87,92 @@ export default function Calendar(){
|
|||||||
<div className="card card-statistics">
|
<div className="card card-statistics">
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<div className="card-heading">
|
<div className="card-heading">
|
||||||
<h4 className="card-title">Event Calendar</h4>
|
<h4 className="card-title">Events</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-xl-3">
|
{isFetching ?
|
||||||
<div id="external-events">
|
<>
|
||||||
<button className="btn btn-primary btn-block" data-bs-toggle="modal" data-bs-target="#eventModal">
|
<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="col-xl-3">
|
||||||
|
|
||||||
|
{/* <button className="btn btn-primary btn-block" data-bs-toggle="modal" data-bs-target="#eventModal">
|
||||||
Add New Event
|
Add New Event
|
||||||
</button>
|
</button>
|
||||||
<p className="mt-3">
|
<p className="mt-3">
|
||||||
Drag and drop your event or click in the calendar.
|
Drag and drop your event or click in the calendar.
|
||||||
</p>
|
</p> */}
|
||||||
{/* {dummyEvents.map((item, index) => (
|
|
||||||
<div key={index} className={`fc-event ${item.color}`} data-color={`${item.color}`}
|
{category?.map((item, index) => {
|
||||||
draggable="true"
|
let color = item?.cid == '1' ? 'fc-event-success' : item?.cid == '2' ? 'fc-event-danger' : item?.cid == '3' ? 'fc-event-warning' : 'fc-event-primary'
|
||||||
onDragStart={() =>
|
let circleColor = item?.cid == '1' ? 'text-success' : item?.cid == '2' ? 'text-danger' : item?.cid == '3' ? 'text-warning' : 'text-primary'
|
||||||
handleDragStart({...item})
|
return (
|
||||||
}
|
// <div key={index} className={`fc-event ${color}`} data-color={`${color}`}
|
||||||
>
|
// // draggable={false}
|
||||||
<span></span> {item.title}
|
// // onDragStart={() =>
|
||||||
</div>
|
// // handleDragStart({...item})
|
||||||
))} */}
|
// // }
|
||||||
<ExternalDraggable dummyEvents={dummyEvents} />
|
// >
|
||||||
<div className="form-check">
|
// <span>{item.description}</span>
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// <div key={index} className={`form-check ${color}`}>
|
||||||
|
// <input className="form-check-input" type="radio" value={item.cid}
|
||||||
|
// id={item.cid} name='category' checked={item.cid == activeCategory} onChange={() => handleActiveCategory(item.cid)} />
|
||||||
|
// <label className={`w-100 form-check-label`} htmlFor={item.cid}>
|
||||||
|
// {item.description}
|
||||||
|
// </label>
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
<div key={index} className={`form-check ${color}`} onClick={() => handleActiveCategory(item.cid)} style={{cursor: 'pointer'}}>
|
||||||
|
<div>
|
||||||
|
<span className="nav align-items-center">
|
||||||
|
<span>
|
||||||
|
<i className={`fa fa-circle-o pr-4 ${item.cid == activeCategory ? circleColor : 'text-light'}`}></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span>{item?.description}</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* <div id="external-events">
|
||||||
|
<ExternalDraggable category={category} />
|
||||||
|
</div> */}
|
||||||
|
|
||||||
|
{/* <div className="form-check">
|
||||||
<input className="form-check-input" type="checkbox" value={removeAfterDrop}
|
<input className="form-check-input" type="checkbox" value={removeAfterDrop}
|
||||||
id="defaultCheck1" onChange={() => setRemoveAfterDrop(prev => !prev)} />
|
id="defaultCheck1" onChange={() => setRemoveAfterDrop(prev => !prev)} />
|
||||||
<label className="form-check-label" htmlFor="defaultCheck1">
|
<label className="form-check-label" htmlFor="defaultCheck1">
|
||||||
Remove After Drop
|
Remove After Drop
|
||||||
</label>
|
</label>
|
||||||
|
</div> */}
|
||||||
|
</div>
|
||||||
|
<div className="col-xl-9">
|
||||||
|
<div className="event-calendar">
|
||||||
|
<EventCalendar
|
||||||
|
removeAfterDrop={removeAfterDrop}
|
||||||
|
eventList={eventList}
|
||||||
|
activeCategory={activeCategory}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</>
|
||||||
<div className="col-xl-9">
|
}
|
||||||
<div className="event-calendar">
|
|
||||||
{/* <EventCalendar draggedEvent={draggedEvent} setDraggedEvent={setDraggedEvent} /> */}
|
|
||||||
<EventCalendar removeAfterDrop={removeAfterDrop} setDummyEvents={setDummyEvents} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { formatDate } from '@fullcalendar/core';
|
import { formatDate } from '@fullcalendar/core';
|
||||||
import FullCalendar from '@fullcalendar/react';
|
import FullCalendar from '@fullcalendar/react';
|
||||||
import dayGridPlugin from '@fullcalendar/daygrid';
|
import dayGridPlugin from '@fullcalendar/daygrid';
|
||||||
@@ -6,9 +6,9 @@ import timeGridPlugin from '@fullcalendar/timegrid';
|
|||||||
import interactionPlugin from '@fullcalendar/interaction';
|
import interactionPlugin from '@fullcalendar/interaction';
|
||||||
import { INITIAL_EVENTS, createEventId } from './event-utils';
|
import { INITIAL_EVENTS, createEventId } from './event-utils';
|
||||||
|
|
||||||
export default function EventCalendar({draggedEvent, setDraggedEvent, removeAfterDrop, setDummyEvents}) {
|
export default function EventCalendar({removeAfterDrop, eventList, activeCategory}) {
|
||||||
const [weekendsVisible, setWeekendsVisible] = useState(true);
|
const [weekendsVisible, setWeekendsVisible] = useState(true);
|
||||||
const [currentEvents, setCurrentEvents] = useState(INITIAL_EVENTS);
|
const [currentEvents, setCurrentEvents] = useState([]);
|
||||||
|
|
||||||
function handleWeekendsToggle() {
|
function handleWeekendsToggle() {
|
||||||
setWeekendsVisible(!weekendsVisible);
|
setWeekendsVisible(!weekendsVisible);
|
||||||
@@ -51,9 +51,9 @@ export default function EventCalendar({draggedEvent, setDraggedEvent, removeAfte
|
|||||||
...event
|
...event
|
||||||
}
|
}
|
||||||
setCurrentEvents(prev => ([...prev, newEvent]))
|
setCurrentEvents(prev => ([...prev, newEvent]))
|
||||||
if(removeAfterDrop){
|
// if(removeAfterDrop){
|
||||||
setDummyEvents(prev => prev.filter(item => item.title != newEvent.title))
|
// setDummyEvents(prev => prev.filter(item => item.title != newEvent.title))
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,27 +64,34 @@ export default function EventCalendar({draggedEvent, setDraggedEvent, removeAfte
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function handleEventClick(clickInfo) {
|
// function handleEventClick(clickInfo) {
|
||||||
if (
|
// if (
|
||||||
confirm(
|
// confirm(
|
||||||
`Are you sure you want to delete the event '${clickInfo.event.title}'`
|
// `Are you sure you want to delete the event '${clickInfo.event.title}'`
|
||||||
)
|
// )
|
||||||
) {
|
// ) {
|
||||||
clickInfo.event.remove();
|
// clickInfo.event.remove();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
function handleEvents(events) {
|
function handleEvents(events) {
|
||||||
// setCurrentEvents(events);
|
// setCurrentEvents(events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
// let newEventList = eventList?.map(item => ({...item, start: new Date(item?.start)}))
|
||||||
|
let newEventList = eventList?.filter(item => (Number(item.category) == Number(activeCategory)))?.map(item => ({...item, start: new Date(item?.start)}))
|
||||||
|
// console.log('newEventList', newEventList)
|
||||||
|
setCurrentEvents(newEventList)
|
||||||
|
},[activeCategory])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="demo-app">
|
<div className="demo-app">
|
||||||
<div className="demo-app-main">
|
<div className="demo-app-main">
|
||||||
<FullCalendar
|
<FullCalendar
|
||||||
plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin]}
|
plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin]}
|
||||||
headerToolbar={{
|
headerToolbar={{
|
||||||
left: 'prev next today',
|
left: 'prev,next,today',
|
||||||
center: 'title',
|
center: 'title',
|
||||||
right: 'dayGridMonth,timeGridWeek,timeGridDay',
|
right: 'dayGridMonth,timeGridWeek,timeGridDay',
|
||||||
}}
|
}}
|
||||||
@@ -96,17 +103,18 @@ export default function EventCalendar({draggedEvent, setDraggedEvent, removeAfte
|
|||||||
weekends={weekendsVisible}
|
weekends={weekendsVisible}
|
||||||
// initialEvents={INITIAL_EVENTS} // alternatively, use the `events` setting to fetch from a feed
|
// initialEvents={INITIAL_EVENTS} // alternatively, use the `events` setting to fetch from a feed
|
||||||
events={currentEvents}
|
events={currentEvents}
|
||||||
select={handleDateSelect}
|
|
||||||
eventContent={renderEventContent} // custom render function
|
eventContent={renderEventContent} // custom render function
|
||||||
eventClick={handleEventClick}
|
|
||||||
eventsSet={handleEvents} // called after events are initialized/added/changed/removed
|
eventsSet={handleEvents} // called after events are initialized/added/changed/removed
|
||||||
|
// select={handleDateSelect}
|
||||||
|
// eventClick={handleEventClick}
|
||||||
/* you can update a remote database when these fire:
|
/* you can update a remote database when these fire:
|
||||||
eventAdd={function(){}}
|
eventAdd={function(){}}
|
||||||
eventChange={function(){}}
|
eventChange={function(){}}
|
||||||
eventRemove={function(){}}
|
eventRemove={function(){}}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
eventRemove={removeEvent}
|
// eventBackgroundColor='purple'
|
||||||
|
// eventRemove={removeEvent}
|
||||||
droppable= {true} // this allows things to be dropped onto the calendar
|
droppable= {true} // this allows things to be dropped onto the calendar
|
||||||
drop={onDrop}
|
drop={onDrop}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
import React, { useEffect, useRef } from "react";
|
import React, { useEffect, useRef } from "react";
|
||||||
import { Draggable } from "@fullcalendar/interaction";
|
import { Draggable } from "@fullcalendar/interaction";
|
||||||
|
|
||||||
const ExternalDraggable = ({dummyEvents}) => {
|
const ExternalDraggable = ({category}) => {
|
||||||
const eventContainerRef = useRef(null);
|
const eventContainerRef = useRef(null);
|
||||||
|
|
||||||
|
const events = [
|
||||||
|
{id: '1111', title: 'Family Vacation', color: 'fc-event-primary', start: new Date('2025-01-18')},
|
||||||
|
{id: '2222', title: 'Meeting In Office', color: 'fc-event-warning', start: new Date('2025-01-19')},
|
||||||
|
{id: '3333', title: 'Client Call', color: 'fc-event-danger', start: new Date('2025-01-22')},
|
||||||
|
{id: '4444', title: 'Interview', color: 'fc-event-success', start: new Date('2025-01-1')}
|
||||||
|
]
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Make the external events draggable
|
// Make the external events draggable
|
||||||
const draggable = new Draggable(eventContainerRef.current, {
|
const draggable = new Draggable(eventContainerRef.current, {
|
||||||
@@ -21,11 +28,15 @@ const ExternalDraggable = ({dummyEvents}) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={eventContainerRef} className="external-events">
|
<div ref={eventContainerRef} className="external-events">
|
||||||
{dummyEvents.map((item, index) => (
|
{category && category.map((item, index) => {
|
||||||
<div key={index} className={`fc-event ${item.color}`} data-color={`${item.color}`} >
|
let color = index % 4 === 0 ? 'fc-event-success' : index % 3 === 0 ? 'fc-event-danger' : index % 2 === 0 ? 'fc-event-warning' : 'fc-event-primary'
|
||||||
{item.title}
|
return (
|
||||||
</div>
|
<div key={item?.cid || index} className={`fc-event ${color}`} data-color={`${color}`} >
|
||||||
))}
|
{item.description}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,19 +2,19 @@ let eventGuid = 0;
|
|||||||
let todayStr = new Date().toISOString().replace(/T.*$/, ''); // YYYY-MM-DD of today
|
let todayStr = new Date().toISOString().replace(/T.*$/, ''); // YYYY-MM-DD of today
|
||||||
|
|
||||||
export const INITIAL_EVENTS = [
|
export const INITIAL_EVENTS = [
|
||||||
// {
|
{
|
||||||
// id: createEventId(),
|
id: createEventId(),
|
||||||
// title: 'All-day event',
|
title: 'All-day event',
|
||||||
// start: new Date('2025-01-19'),
|
start: new Date('2025-01-19'),
|
||||||
// end: new Date('2025-01-20'),
|
end: new Date('2025-01-20'),
|
||||||
// // color: 'blue'
|
// color: 'blue'
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// id: createEventId(),
|
id: createEventId(),
|
||||||
// title: 'Timed event',
|
title: 'Timed event',
|
||||||
// start: todayStr + 'T12:00:00',
|
start: todayStr + 'T12:00:00',
|
||||||
// // color: 'red'
|
// color: 'red'
|
||||||
// },
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export function createEventId() {
|
export function createEventId() {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default function Comments(){
|
|||||||
<div className="row justify-content-center">
|
<div className="row justify-content-center">
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<div className="text-center mail-sidebar-title px-4">
|
<div className="text-center mail-sidebar-title px-4">
|
||||||
<a href="javascript:void(0)" className="btn btn-primary btn-block py-3 font-weight-bold font-18">className= <i className="fa fa-plus pl-2"></i></a>
|
<a href="javascript:void(0)" className="btn btn-primary btn-block py-3 font-weight-bold font-18"><i className="fa fa-plus pl-2"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
|
|||||||
@@ -1,354 +1,300 @@
|
|||||||
import React from "react";
|
"use client"
|
||||||
|
import React, { useEffect, useState } from "react";
|
||||||
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
import getImage from "../../utils/getImage";
|
import getImage from "../../utils/getImage";
|
||||||
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
|
import { contactData } from "../../services/services";
|
||||||
|
import queryKeys from "../../services/queryKeys";
|
||||||
|
import getCustomTime from "../../utils/getCustomTime";
|
||||||
|
|
||||||
export default function Contacts(){
|
export default function Contacts(){
|
||||||
|
|
||||||
|
// const {data:contacts, isFetching, isError, error} = useQuery({
|
||||||
|
// queryKey: queryKeys.contacts,
|
||||||
|
// queryFn: () => contactData()
|
||||||
|
// })
|
||||||
|
|
||||||
|
const [activeCategoryUID, setActiveCategoryUID] = useState('0') // HOLDS VALUE OF THE ACTIVE CATEGORY
|
||||||
|
|
||||||
|
const [activeContactUID, setActiveContactUID] = useState('')
|
||||||
|
const [activeDetail, setActiveDetail] = useState([])
|
||||||
|
|
||||||
|
const [filteredContactData, setFiltererdContactData] = useState([])
|
||||||
|
|
||||||
|
|
||||||
|
const getContactData = useMutation({
|
||||||
|
mutationFn: (reqData) => {
|
||||||
|
return contactData(reqData)
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
console.log(error)
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
if(res?.data?.resultCode != '0'){
|
||||||
|
throw({message: 'Something went wrong'})
|
||||||
|
}
|
||||||
|
setFiltererdContactData(res?.data?.contacts)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const changeActiveUID = (uid) => {
|
||||||
|
setActiveContactUID(uid)
|
||||||
|
let detail = contactsData.filter(item => item.uid == uid)
|
||||||
|
setActiveDetail(detail)
|
||||||
|
}
|
||||||
|
|
||||||
|
const changeActiveCategoryUID = (id) => {
|
||||||
|
let filteredConData = []
|
||||||
|
setActiveCategoryUID(id)
|
||||||
|
if(id == '0'){
|
||||||
|
filteredConData = contactsData
|
||||||
|
}else{
|
||||||
|
filteredConData = contactsData.filter(item => item.category == id)
|
||||||
|
}
|
||||||
|
setFiltererdContactData(filteredConData)
|
||||||
|
changeActiveUID(filteredConData[0]?.uid)
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
|
getContactData.mutate(reqData)
|
||||||
|
},[])
|
||||||
|
|
||||||
|
const contactsData = getContactData?.data?.data?.contacts // LIST OF CONTACTS
|
||||||
|
const contactsCategory = getContactData?.data?.data?.category // LIST OF CATEGORY
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
<BreadcrumbComBS title='Contacts' paths={['Dashboard', 'Contacts']} />
|
<BreadcrumbComBS title='Contacts' paths={['Dashboard', 'Contacts']} />
|
||||||
<div className="row">
|
{getContactData?.isPending ?
|
||||||
{/*<div className="vh-100 col-12 flex align-items-center">Coming Soon</div>*/}
|
<>
|
||||||
<div className="col-12">
|
<div className="row">
|
||||||
<div className="card card-statistics mail-contant">
|
<div className="col-12">
|
||||||
<div className="card-body p-0">
|
<p className='text-mute'>Loading...</p>
|
||||||
<div className="row no-gutters">
|
</div>
|
||||||
<div className="col-md-4 col-xxl-2 col-md-4">
|
</div>
|
||||||
<div className="mail-sidebar">
|
</>
|
||||||
<div className="row justify-content-center">
|
: getContactData?.error ?
|
||||||
<div className="col-12">
|
<div className="row">
|
||||||
<div className="text-center mail-sidebar-title px-4">
|
<div className="col-12">
|
||||||
<a href="javascript:void(0)" className="btn btn-primary btn-block py-3 font-weight-bold font-18">className= <i className="fa fa-plus pl-2"></i></a>
|
<p className='text-danger'>{getContactData?.error?.message}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<div className="row">
|
||||||
|
{/*<div className="vh-100 col-12 flex align-items-center">Coming Soon</div>*/}
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="card card-statistics mail-contant">
|
||||||
|
<div className="card-body p-0">
|
||||||
|
<div className="row no-gutters">
|
||||||
|
<div className="col-md-4 col-xxl-2 col-md-4">
|
||||||
|
<div className="mail-sidebar">
|
||||||
|
<div className="row justify-content-center">
|
||||||
|
<div className="d-none col-12">
|
||||||
|
<div className="text-center mail-sidebar-title px-4">
|
||||||
|
<a href="#" className="btn btn-primary btn-block py-3 font-weight-bold font-18"><i className="fa fa-plus pl-2"></i></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div className="col-12">
|
|
||||||
<div className="px-4 py-4">
|
|
||||||
<ul className="pl-0">
|
|
||||||
<li className="py-2">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<span className="nav align-items-center">
|
|
||||||
<span>
|
|
||||||
<i className="fa fa-envelope-o text-primary pr-4"></i>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<span>Inbox</span>
|
|
||||||
</span>
|
|
||||||
<span className="nav-item ml-auto text-right">
|
|
||||||
<span className="badge badge-pill badge-primary float-right">0+</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li className="py-2">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<span className="nav align-items-center">
|
|
||||||
<span>
|
|
||||||
<i className="fa fa-paper-plane-o pr-4"></i>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<span>Replied Mail</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
<ul className="pl-0 mt-5">
|
|
||||||
<li className="py-2">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<span className="nav align-items-center">
|
|
||||||
<span>
|
|
||||||
<i className="fa fa-circle-o text-danger pr-4"></i>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<span>Personal</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li className="py-2">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<span className="nav align-items-center">
|
|
||||||
<span>
|
|
||||||
<i className="fa fa-circle-o pr-4 text-warning"></i>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<span>Work</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li className="py-2">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<span className="nav align-items-center">
|
|
||||||
<span>
|
|
||||||
<i className="fa fa-plus pr-4"></i>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<span>Add Category</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="col-md-8 col-xxl-4 border-md-t">
|
|
||||||
<div className="mail-content border-right border-n h-100">
|
|
||||||
<div className="mail-search border-bottom">
|
|
||||||
<div className="row align-items-center mx-0">
|
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
{/*<div className="form-group pt-3">*/}
|
<div className="px-4 py-4">
|
||||||
{/* <input type="text" className="form-control" id="search" placeholder="Search.." />*/}
|
<ul className="pl-0">
|
||||||
{/* <i className="fa fa-search"></i>*/}
|
<li className="py-2">
|
||||||
{/*</div>*/}
|
<a href="#">
|
||||||
|
<span className="nav align-items-center">
|
||||||
|
<span>
|
||||||
|
<i className="fa fa-envelope-o text-primary pr-4"></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span>Inbox</span>
|
||||||
|
</span>
|
||||||
|
<span className="nav-item ml-auto text-right">
|
||||||
|
<span className="badge badge-pill badge-primary float-right">{contactsData?.length}</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li className="py-2">
|
||||||
|
<a href="#">
|
||||||
|
<span className="nav align-items-center">
|
||||||
|
<span>
|
||||||
|
<i className="fa fa-paper-plane-o pr-4"></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span>Replied Mail</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul className="pl-0 mt-5">
|
||||||
|
<li className="py-2" onClick={()=>changeActiveCategoryUID('0')} style={{cursor: 'pointer'}}>
|
||||||
|
<div>
|
||||||
|
<span className="nav align-items-center">
|
||||||
|
<span>
|
||||||
|
<i className={`fa fa-circle-o pr-4 ${activeCategoryUID == '0' ? 'text-primary' : 'text-warning'}`}></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span>All</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{contactsCategory && contactsCategory.map(item => (
|
||||||
|
<li key={item?.cid} className="py-2" onClick={()=>changeActiveCategoryUID(`A00000${item?.cid}`)} style={{cursor: 'pointer'}}>
|
||||||
|
<div>
|
||||||
|
<span className="nav align-items-center">
|
||||||
|
<span>
|
||||||
|
<i className={`fa fa-circle-o pr-4 ${activeCategoryUID == `A00000${item?.cid}` ? 'text-primary' : 'text-warning'}`}></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span>{item?.description}</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
{/* <li className="py-2">
|
||||||
|
<a href="#">
|
||||||
|
<span className="nav align-items-center">
|
||||||
|
<span>
|
||||||
|
<i className="fa fa-circle-o pr-4 text-warning"></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span>Work</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li className="py-2">
|
||||||
|
<a href="#">
|
||||||
|
<span className="nav align-items-center">
|
||||||
|
<span>
|
||||||
|
<i className="fa fa-plus pr-4"></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span>Add Category</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li> */}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mail-msg scrollbar scroll_dark">
|
</div>
|
||||||
<div className="mail-msg-item">
|
<div className="col-md-8 col-xxl-4 border-md-t">
|
||||||
<a href="javascript:void(0)">
|
<div className="mail-content border-right border-n h-100">
|
||||||
<div className="media align-items-center">
|
<div className="mail-search border-bottom">
|
||||||
<div className="mr-3">
|
<div className="row align-items-center mx-0">
|
||||||
<div className="bg-img">
|
<div className="col-12">
|
||||||
<img src={getImage("avtar/01.jpg")} className="img-fluid" alt="user" />
|
{/*<div className="form-group pt-3">*/}
|
||||||
</div>
|
{/* <input type="text" className="form-control" id="search" placeholder="Search.." />*/}
|
||||||
</div>
|
{/* <i className="fa fa-search"></i>*/}
|
||||||
<div className="w-100">
|
{/*</div>*/}
|
||||||
<div className="mail-msg-item-titel justify-content-between">
|
|
||||||
<p>Martin smith</p>
|
|
||||||
<p className="d-none d-xl-block">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
<h5 className="mb-0 my-2">Saas Designer</h5>
|
|
||||||
<p>Since there is not an "all the above" category, I'll take the opportunity to enthusiastically congratulate you on the very high quality.</p>
|
|
||||||
<p className="d-xl-none">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mail-msg-item">
|
<div className="mail-msg scrollbar scroll_dark">
|
||||||
<a href="javascript:void(0)">
|
{contactsData && filteredContactData?.map((contact, index)=> {
|
||||||
<div className="media align-items-center">
|
const isActive = (contact?.uid == activeContactUID) || (!activeContactUID && index == 0)
|
||||||
<div className="mr-3">
|
return (
|
||||||
<div className="bg-img">
|
<div key={contact?.uid} onClick={()=>changeActiveUID(contact?.uid)} className={`mail-msg-item ${isActive && 'bg-light'}`}>
|
||||||
<img src={getImage("avtar/02.jpg")} className="img-fluid" alt="user" />
|
<a href="#">
|
||||||
</div>
|
<div className="media align-items-center">
|
||||||
|
<div className="mr-3">
|
||||||
|
<div className="bg-img">
|
||||||
|
<img src={getImage("avtar/01.jpg")} className="img-fluid" alt="user" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="w-100">
|
||||||
|
<div className="mail-msg-item-titel justify-content-between">
|
||||||
|
<p>{contact?.sender}</p>
|
||||||
|
{/* <p className="d-none d-xl-block">06:59 <span> PM </span></p> */}
|
||||||
|
<p className="d-none d-xl-block"><span>{new Date(contact?.added).toDateString()}</span></p>
|
||||||
|
</div>
|
||||||
|
<h5 className="mb-0 my-2">{contact?.title}</h5>
|
||||||
|
<p>{contact?.message?.length < 100 ? contact?.message : contact?.message.substring(0,101) + ' ...' }</p>
|
||||||
|
<p className="d-xl-none">
|
||||||
|
<span>
|
||||||
|
{new Date(contact?.added).toDateString()}
|
||||||
|
{/* {getCustomTime(contact.added)} */}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-100">
|
)
|
||||||
<div className="mail-msg-item-titel justify-content-between">
|
})}
|
||||||
<p>DutcaPatrick</p>
|
|
||||||
<p className="d-none d-xl-block">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
<h5 className="mb-0 my-2">Mobile app Designer </h5>
|
|
||||||
<p>Very nice template, lots of pages and good documentation.</p>
|
|
||||||
<p className="d-xl-none">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="mail-msg-item">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<div className="media align-items-center">
|
|
||||||
<div className="mr-3">
|
|
||||||
<div className="bg-img">
|
|
||||||
<img src={getImage("avtar/03.jpg")} className="img-fluid" alt="user" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-100">
|
|
||||||
<div className="mail-msg-item-titel justify-content-between">
|
|
||||||
<p>m_morsch</p>
|
|
||||||
<p className="d-none d-xl-block">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
<h5 className="mb-0 my-2">Landing page Designer</h5>
|
|
||||||
<p>Excellent and at a great price... thank you very much!</p>
|
|
||||||
<p className="d-xl-none">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="mail-msg-item">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<div className="media align-items-center">
|
|
||||||
<div className="mr-3">
|
|
||||||
<div className="bg-img">
|
|
||||||
<img src={getImage("avtar/04.jpg")} className="img-fluid" alt="user" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-100">
|
|
||||||
<div className="mail-msg-item-titel justify-content-between">
|
|
||||||
<p>AnnaHorno</p>
|
|
||||||
<p className="d-none d-xl-block">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
<h5 className="mb-0 my-2">Re-Design ios app</h5>
|
|
||||||
<p>Solved my theme problem in 10 minutes. We thank you.</p>
|
|
||||||
<p className="d-xl-none">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="mail-msg-item">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<div className="media align-items-center">
|
|
||||||
<div className="mr-3">
|
|
||||||
<div className="bg-img">
|
|
||||||
<img src={getImage("avtar/05.jpg")} className="img-fluid" alt="user" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-100">
|
|
||||||
<div className="mail-msg-item-titel justify-content-between">
|
|
||||||
<p>Wdcorbitt</p>
|
|
||||||
<p className="d-none d-xl-block">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
<h5 className="mb-0 my-2">Mobil UX/UI Designer</h5>
|
|
||||||
<p>Asked for information and received it EXTREMELY quickly. Great layout - good code - great price! </p>
|
|
||||||
<p className="d-xl-none">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="mail-msg-item">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<div className="media align-items-center">
|
|
||||||
<div className="mr-3">
|
|
||||||
<div className="bg-img">
|
|
||||||
<img src={getImage("avtar/06.jpg")} className="img-fluid" alt="user" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-100">
|
|
||||||
<div className="mail-msg-item-titel justify-content-between">
|
|
||||||
<p>Anne Smith</p>
|
|
||||||
<p className="d-none d-xl-block">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
<h5 className="mb-0 my-2">Jobly Opportunity</h5>
|
|
||||||
<p>Mentor has so many features and layouts. Its a great choice.</p>
|
|
||||||
<p className="d-xl-none">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="mail-msg-item">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<div className="media align-items-center">
|
|
||||||
<div className="mr-3">
|
|
||||||
<div className="bg-img">
|
|
||||||
<img src={getImage("avtar/07.jpg")} className="img-fluid" alt="user" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-100">
|
|
||||||
<div className="mail-msg-item-titel justify-content-between">
|
|
||||||
<p>Paul Flavius</p>
|
|
||||||
<p className="d-none d-xl-block">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
<h5 className="mb-0 my-2">Saas Designer</h5>
|
|
||||||
<p>There are many people in the world with amazing talents who realize only a small percentage of their potential. </p>
|
|
||||||
<p className="d-xl-none">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="mail-msg-item">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<div className="media align-items-center">
|
|
||||||
<div className="mr-3">
|
|
||||||
<div className="bg-img">
|
|
||||||
<img src="assets/img/avtar/08.jpg" className="img-fluid" alt="user" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-100">
|
|
||||||
<div className="mail-msg-item-titel justify-content-between">
|
|
||||||
<p>Sara Lisbon</p>
|
|
||||||
<p className="d-none d-xl-block">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
<h5 className="mb-0 my-2">UI Designer</h5>
|
|
||||||
<p>We can look a bit further back in time to Albert Einstein or even further back to Abraham Lincoln.</p>
|
|
||||||
<p className="d-xl-none">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="mail-msg-item">
|
|
||||||
<a href="javascript:void(0)">
|
|
||||||
<div className="media align-items-center">
|
|
||||||
<div className="mr-3">
|
|
||||||
<div className="bg-img">
|
|
||||||
<img src="assets/img/avtar/09.jpg" className="img-fluid" alt="user" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-100">
|
|
||||||
<div className="mail-msg-item-titel justify-content-between">
|
|
||||||
<p>Annahorno</p>
|
|
||||||
<p className="d-none d-xl-block">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
<h5 className="mb-0 my-2">Saas Designer</h5>
|
|
||||||
<p>One of the most difficult aspects of achieving success is staying motivated over the long haul.</p>
|
|
||||||
<p className="d-xl-none">06:59 <span> PM </span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="col-xxl-6 border-t border-xxl-t">
|
||||||
<div className="col-xxl-6 border-t border-xxl-t">
|
|
||||||
<div className="mail-chat py-5 px-5">
|
|
||||||
<div className="media align-items-center">
|
|
||||||
<div className="bg-img mr-3">
|
|
||||||
<img src={getImage("avtar/03.jpg")} className="img-fluid" alt="user" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h4 className="mb-0">Dutca Patrick</h4>
|
|
||||||
<p>30 Min ago</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="mt-4 d-flex justify-content-between">
|
|
||||||
<div>
|
|
||||||
<h3>Landing page Designer...</h3>
|
|
||||||
</div>
|
|
||||||
<div className="d-flex">
|
|
||||||
{/*<a href="javascript:void(0)"><i className="fa fa-reply font-22 pr-3"></i></a>*/}
|
|
||||||
{/*<a href="javascript:void(0)"><i className="fa fa-print font-22"></i></a>*/}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p className="my-4">hey adminjon...</p>
|
|
||||||
<p className="mb-2">I truly believe Augustine’s words are true and if you look at history you know it is true. There are many people in the world with amazing talents who realize only a small percentage of their potential. We all know people who live this truth.</p>
|
|
||||||
<p>We also know those epic stories, those modern-day legends surrounding the early failures of such supremely successful folks as Michael Jordan and Bill Gates. We can look a bit further back in time to Albert Einstein or even further back to Abraham Lincoln. What made each of these people so successful? Motivation.</p>
|
|
||||||
<p>We know this in our gut, but what can we do about it? How can we motivate ourselves? One of the most difficult aspects of achieving success is staying motivated over the long haul.</p>
|
|
||||||
{/*<div className="my-5">*/}
|
|
||||||
{/* <p>Have lovely Day,</p>*/}
|
|
||||||
{/* <p>adminjon</p>*/}
|
|
||||||
{/*</div>*/}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="bg-light mail-f px-4 py-3">
|
<div className="mail-chat py-5 px-5">
|
||||||
<div className="py-2 bg-white px-4 py-3 d-flex justify-content-between">
|
<div className="media align-items-center">
|
||||||
<p>Click here to <a href="#editer" data-toggle="collapse" className="text-primary px-1">Reply</a>or<a href="#forward" data-toggle="collapse" className="text-primary px-1">Forward</a></p>
|
<div className="bg-img mr-3">
|
||||||
<a href="javascript:void(0)" className="text-primary"><i className="fa fa-microphone"></i></a>
|
<img src={getImage("avtar/03.jpg")} className="img-fluid" alt="user" />
|
||||||
</div>
|
</div>
|
||||||
<div className="collapse" id="editer">
|
<div>
|
||||||
<div className="form-group">
|
<h4 className="mb-0">{activeContactUID ? activeDetail[0]?.sender : filteredContactData[0]?.sender}</h4>
|
||||||
<textarea className="form-control mt-3" id="exampleFormControlTextarea1" rows="3" placeholder="Type here..."></textarea>
|
<p>{activeContactUID ? new Date(activeDetail[0]?.added).toDateString() : new Date(filteredContactData[0]?.added).toDateString()}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="mt-4 d-flex justify-content-between">
|
||||||
<div className="collapse" id="forward">
|
<div>
|
||||||
<div className="form-group">
|
<h3>{activeContactUID ? activeDetail[0]?.title : filteredContactData[0]?.title}</h3>
|
||||||
<input className="form-control mt-3" id="exampleFormControl" placeholder="Email Address" />
|
</div>
|
||||||
</div>
|
<div className="d-flex">
|
||||||
</div>
|
{/*<a href="javascript:void(0)"><i className="fa fa-reply font-22 pr-3"></i></a>*/}
|
||||||
<div className="d-flex align-items-center justify-content-between py-2">
|
{/*<a href="javascript:void(0)"><i className="fa fa-print font-22"></i></a>*/}
|
||||||
<div>
|
</div>
|
||||||
{/*<ul className="nav">*/}
|
|
||||||
{/* <li className="nav-item pr-3"><a href="javascript:void(0)"><i className="ti ti-clip font-20"></i></a></li>*/}
|
|
||||||
{/* <li className="nav-item pr-3"><a href="javascript:void(0)"><i className="ti ti-face-smile font-20"></i></a></li>*/}
|
|
||||||
{/* <li className="nav-item"><a href="javascript:void(0)"><i className="ti ti-gallery font-20"></i></a></li>*/}
|
|
||||||
{/*</ul>*/}
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{/*<a href="javascript:void(0)" className="btn btn-primary"><span>Send</span> <i className="fa fa-paper-plane"></i></a>*/}
|
<p>{activeContactUID ? activeDetail[0]?.message : filteredContactData[0]?.message}</p>
|
||||||
|
{/* <p className="my-4">hey adminjon...</p>
|
||||||
|
<p className="mb-2">I truly believe Augustine’s words are true and if you look at history you know it is true. There are many people in the world with amazing talents who realize only a small percentage of their potential. We all know people who live this truth.</p>
|
||||||
|
<p>We also know those epic stories, those modern-day legends surrounding the early failures of such supremely successful folks as Michael Jordan and Bill Gates. We can look a bit further back in time to Albert Einstein or even further back to Abraham Lincoln. What made each of these people so successful? Motivation.</p>
|
||||||
|
<p>We know this in our gut, but what can we do about it? How can we motivate ourselves? One of the most difficult aspects of achieving success is staying motivated over the long haul.</p> */}
|
||||||
|
{/*<div className="my-5">*/}
|
||||||
|
{/* <p>Have lovely Day,</p>*/}
|
||||||
|
{/* <p>adminjon</p>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-light mail-f px-4 py-3">
|
||||||
|
<div className="py-2 bg-white px-4 py-3 d-flex justify-content-between">
|
||||||
|
<p>Click here to <a href="#editer" data-toggle="collapse" className="text-primary px-1">Reply</a>or<a href="#forward" data-toggle="collapse" className="text-primary px-1">Forward</a></p>
|
||||||
|
<a href="#" className="text-primary"><i className="fa fa-microphone"></i></a>
|
||||||
|
</div>
|
||||||
|
<div className="collapse" id="editer">
|
||||||
|
<div className="form-group">
|
||||||
|
<textarea className="form-control mt-3" id="exampleFormControlTextarea1" rows="3" placeholder="Type here..."></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="collapse" id="forward">
|
||||||
|
<div className="form-group">
|
||||||
|
<input className="form-control mt-3" id="exampleFormControl" placeholder="Email Address" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="d-flex align-items-center justify-content-between py-2">
|
||||||
|
<div>
|
||||||
|
{/*<ul className="nav">*/}
|
||||||
|
{/* <li className="nav-item pr-3"><a href="javascript:void(0)"><i className="ti ti-clip font-20"></i></a></li>*/}
|
||||||
|
{/* <li className="nav-item pr-3"><a href="javascript:void(0)"><i className="ti ti-face-smile font-20"></i></a></li>*/}
|
||||||
|
{/* <li className="nav-item"><a href="javascript:void(0)"><i className="ti ti-gallery font-20"></i></a></li>*/}
|
||||||
|
{/*</ul>*/}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{/*<a href="javascript:void(0)" className="btn btn-primary"><span>Send</span> <i className="fa fa-paper-plane"></i></a>*/}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -357,7 +303,7 @@ export default function Contacts(){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import React from "react";
|
||||||
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
|
|
||||||
|
|
||||||
|
export default function HelpCom(){
|
||||||
|
|
||||||
|
return(
|
||||||
|
<>
|
||||||
|
<BreadcrumbComBS title='Frequesntly Asked Questions' paths={['Dashboard', 'Help']} />
|
||||||
|
{/*<div className="row">*/}
|
||||||
|
{/* <div className="vh-100 col-12 flex align-items-center">Coming Soon</div>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
|
||||||
|
|
||||||
|
<div className="row account-contant">
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="card card-statistics">
|
||||||
|
<div className="card-body p-lg-15" style={{backgroundColor:"#f9f9fb"}}>
|
||||||
|
|
||||||
|
<p className="mb-4">First, a disclaimer – the entire process of writing a blog post often takes more than a couple of hours, even if you can type eighty words as per minute and your writing skills are sharp.</p>
|
||||||
|
<div className="row">
|
||||||
|
<div className="accordion" id="accordionExample">
|
||||||
|
{['a', 'b', 'c', 'd'].map((item, index)=>{
|
||||||
|
return (
|
||||||
|
<div className="accordion-item">
|
||||||
|
<h2 className="accordion-header">
|
||||||
|
<button className="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target={`#${item}`} aria-expanded="true" aria-controls="collapseOne">
|
||||||
|
{`Accordion Item ${item} 1`}
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
<div id={item} className={`accordion-collapse collapse ${index == 0 && 'show'}`} data-bs-parent="#accordionExample">
|
||||||
|
<div className="accordion-body">
|
||||||
|
<strong>This is the first item’s accordion body.</strong> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It’s also worth noting that just about any HTML can go within the accordion-body, though the transition does limit overflow.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,29 +1,22 @@
|
|||||||
import { useQuery } from '@tanstack/react-query'
|
import { useQuery } from '@tanstack/react-query'
|
||||||
import React from 'react'
|
import { productsData } from '../../services/services'
|
||||||
import { productData } from '../../services/services'
|
|
||||||
import queryKeys from '../../services/queryKeys'
|
|
||||||
import productPath from "../../utils/productpath";
|
import productPath from "../../utils/productpath";
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
|
||||||
|
|
||||||
export default function Products() {
|
export default function Products() {
|
||||||
|
|
||||||
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
const {data, isFetching, isError, error} = useQuery({
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
queryKey: queryKeys.product,
|
queryKey: queryKeys.products,
|
||||||
queryFn: () => productData()
|
queryFn: () => productsData(reqData)
|
||||||
})
|
})
|
||||||
/*
|
const products = data?.data?.products_data // PRODUCTS DATA
|
||||||
{
|
|
||||||
"banner": "p1.jpg",
|
|
||||||
"description": "Your personal professional web presence",
|
|
||||||
"id": 1,
|
|
||||||
"name": "Personal Website",
|
|
||||||
"product_id": "A000001",
|
|
||||||
"product_uid": "e92282b4-3ee1-4026-92ac-12cfd214b43a",
|
|
||||||
"status": 5,
|
|
||||||
"status_text": "Activate Now"
|
|
||||||
},
|
|
||||||
*/
|
|
||||||
//const products = data?.data?.products_list?.products
|
|
||||||
const products = data?.data?.products_list
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -43,17 +36,17 @@ export default function Products() {
|
|||||||
: isError ?
|
: isError ?
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<p className='text-danger'>{error.message}</p>
|
<p className='text-danger'>{error?.message}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<div className="row m-b-20">
|
<div className="row m-b-20">
|
||||||
{products && products.map((product, index) => (
|
{products && products.map((product, index) => (
|
||||||
<div key={product.uid+index} className="col-xxs-6 col-xl-4 col-xxl-6 mb-2 mb-xxl-0 ">
|
<div key={product.uid+index} className={`col-xxs-6 col-xl-4 col-xxl-6 mb-2 mb-xxl-0`}>
|
||||||
<Link to={productPath(product?.product_id)} >
|
<Link to={productPath(product?.product_id)} >
|
||||||
<div className="d-flex align-items-center extraProductCard">
|
<div className={`d-flex align-items-center extraProductCard ${product?.icon_style}`} >
|
||||||
<div className="icon-container img-icon m-r-20 bg-light-gray rounded">
|
<div className="icon-container img-icon m-r-20 bg-light-gray rounded">
|
||||||
<i className="fa fa-cart-plus text-primary"></i>
|
<i className={`fa ${product?.product_icon} text-primary`}></i>
|
||||||
</div>
|
</div>
|
||||||
<div className="report-details">
|
<div className="report-details">
|
||||||
<p>{product?.status_text}</p>
|
<p>{product?.status_text}</p>
|
||||||
|
|||||||
@@ -2,15 +2,22 @@ import React from 'react'
|
|||||||
import { productsURL } from '../../services/services'
|
import { productsURL } from '../../services/services'
|
||||||
import { useQuery } from '@tanstack/react-query'
|
import { useQuery } from '@tanstack/react-query'
|
||||||
import queryKeys from '../../services/queryKeys'
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
import getImage from '../../utils/getImage'
|
||||||
|
|
||||||
export default function ProductsURL() {
|
export default function ProductsURL() {
|
||||||
|
|
||||||
const {data:data, isFetching, isError, error} = useQuery({
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
|
|
||||||
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
queryKey: queryKeys.product_url,
|
queryKey: queryKeys.product_url,
|
||||||
queryFn: () => productsURL()
|
queryFn: () => productsURL(reqData)
|
||||||
})
|
})
|
||||||
|
|
||||||
const urlData = data?.data?.url_data?.url
|
const urlData = data?.data?.products_data
|
||||||
|
// console.log('data', urlData)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -53,29 +60,28 @@ export default function ProductsURL() {
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{urlData && urlData.map((item, index) => {
|
{urlData && urlData.map((item, index) => {
|
||||||
let statusColor = item?.status === 'Preparing' ? 'badge-success-inverse' : item?.status === 'Active' ? 'badge-success-inverse' : item?.status == 'Refreshing' ? 'badge-danger-inverse' : 'badge-info-inverse'
|
let statusColor = item?.status === '1' ? 'badge-success-inverse' : item?.status === '6' ? 'badge-success-inverse' : item?.status == '7' ? 'badge-danger-inverse' : 'badge-info-inverse'
|
||||||
|
let statusText = item?.status === '1' ? 'Preparing' : item?.status === '6' ? 'Provisioning' : item?.status == '7' ? 'Ready' : 'Started'
|
||||||
let productUrl = '/product/'+ item?.product_id
|
let productUrl = '/product/'+ item?.product_id
|
||||||
|
let externalUrl= item?.url_protocol +"://"+ item?.internal_url;
|
||||||
return (
|
return (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td>{Number(item?.no) + Number(index)}</td>
|
<td>{Number(item?.id).toString().padStart(6,'0')}</td>
|
||||||
<td>{item?.description} - <a href={productUrl} target='_blank'>{item?.url}</a></td>
|
<td>
|
||||||
|
<a className="mr-3" href={externalUrl} target='_blank'><b>{externalUrl}</b></a> - {item?.description}
|
||||||
|
</td>
|
||||||
|
|
||||||
<td><span className={`badge ${statusColor}`}>{item?.status}</span></td>
|
<td><span className={`badge ${statusColor}`}>{statusText}</span></td>
|
||||||
<td><a className="mr-3" href=""><i className="fe fe-edit"></i></a></td>
|
{/* <td><a className="mr-3" href={productUrl}><i className="fe fe-edit"></i></a></td> */}
|
||||||
|
<td>
|
||||||
|
<a className="mr-3" href={productUrl}>
|
||||||
|
<img src={getImage('arrow-next.png')} alt='next' />
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<th>#</th>
|
|
||||||
<th>Name</th>
|
|
||||||
<th>Price</th>
|
|
||||||
<th>In stock</th>
|
|
||||||
<th>Status</th>
|
|
||||||
<th>Action</th>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
</table>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default function RecentActions() {
|
|||||||
queryFn: () => recentActions()
|
queryFn: () => recentActions()
|
||||||
})
|
})
|
||||||
|
|
||||||
const actionData = dataAction?.data?.action_data
|
const actionData = dataAction?.data?.recent_actions
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -43,7 +43,7 @@ export default function RecentActions() {
|
|||||||
<div className="d-xxs-flex align-items-center">
|
<div className="d-xxs-flex align-items-center">
|
||||||
<div className="total-sales">
|
<div className="total-sales">
|
||||||
<p>Last Update</p>
|
<p>Last Update</p>
|
||||||
<h3>{dataAction?.data?.action_data?.last_update}</h3>
|
<h3>{dataAction?.data?.last_update}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-3 mb-sm-0 ml-auto">
|
<div className="mb-3 mb-sm-0 ml-auto">
|
||||||
{/*<button className="btn btn-primary btn-xs">View All Invoices</button>*/}
|
{/*<button className="btn btn-primary btn-xs">View All Invoices</button>*/}
|
||||||
@@ -62,19 +62,19 @@ export default function RecentActions() {
|
|||||||
<div className="row no-gutters">
|
<div className="row no-gutters">
|
||||||
<div className="col-6 col-xxs-3 ">
|
<div className="col-6 col-xxs-3 ">
|
||||||
<p>Initial</p>
|
<p>Initial</p>
|
||||||
<h4>{actionData?.initial}</h4>
|
<h4>{dataAction?.data?.initial}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-6 col-xxs-3 ">
|
<div className="col-6 col-xxs-3 ">
|
||||||
<p>Processing</p>
|
<p>Processing</p>
|
||||||
<h4>{actionData?.processing}</h4>
|
<h4>{dataAction?.data?.processing}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-6 col-xxs-3 ">
|
<div className="col-6 col-xxs-3 ">
|
||||||
<p>Verifying</p>
|
<p>Verifying</p>
|
||||||
<h4>{actionData?.verifying}</h4>
|
<h4>{dataAction?.data?.verifying}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-6 col-xxs-3 ">
|
<div className="col-6 col-xxs-3 ">
|
||||||
<p>Completed</p>
|
<p>Completed</p>
|
||||||
<h4>{actionData?.completed}</h4>
|
<h4>{dataAction?.data?.completed}</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="table-responsive m-t-20">
|
<div className="table-responsive m-t-20">
|
||||||
@@ -89,16 +89,16 @@ export default function RecentActions() {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="text-muted">
|
<tbody className="text-muted">
|
||||||
{actionData && actionData?.actions.map((action, index) => {
|
{actionData && actionData?.map((action, index) => {
|
||||||
let bgColor = action?.status == '5' ? 'badge-success-inverse' : action?.status == '3' ? 'badge-info-inverse' : action?.status == '0' ? 'badge-warning-inverse' : 'badge-primary-inverse'
|
let bgColor = action?.status == '5' ? 'badge-success-inverse' : action?.status == '3' ? 'badge-info-inverse' : action?.status == '0' ? 'badge-warning-inverse' : 'badge-primary-inverse'
|
||||||
let text = action?.status == '5' ? 'completed' : action?.status == '3' ? 'verifying' : action?.status == '0' ? 'processing' : 'processing'
|
let text = action?.status == '5' ? 'completed' : action?.status == '3' ? 'verifying' : action?.status == '0' ? 'processing' : 'processing'
|
||||||
return (
|
return (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td>{action?.no}</td>
|
<td>{action?.id}</td>
|
||||||
<td>{action?.description}</td>
|
<td>{action?.action_label}</td>
|
||||||
<td>{new Date(action?.date).toDateString()}</td>
|
<td>{new Date(action?.added).toDateString()}</td>
|
||||||
<td>
|
<td>
|
||||||
<label className={`badge mb-0 ${bgColor}`}>{text}</label>
|
<label className={`badge mb-0 ${bgColor}`}>{action?.status_description}</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,16 +1,40 @@
|
|||||||
import { useQuery } from '@tanstack/react-query'
|
import { useQuery } from '@tanstack/react-query'
|
||||||
import React from 'react'
|
|
||||||
import { topBar } from '../../services/services'
|
import { topBar } from '../../services/services'
|
||||||
import queryKeys from '../../services/queryKeys'
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
|
||||||
export default function TopBar() {
|
export default function TopBar() {
|
||||||
|
|
||||||
const {data, isFetching, isError, error} = useQuery({
|
// const topBarData = useMutation({
|
||||||
queryKey: queryKeys.topBar,
|
// mutationFn: (reqData) => {
|
||||||
queryFn: () => topBar()
|
// return topBar(reqData)
|
||||||
})
|
// },
|
||||||
|
// onError: (error) => {
|
||||||
|
// console.log(error)
|
||||||
|
// },
|
||||||
|
// onSuccess: (res) => {
|
||||||
|
// if(res?.data?.resultCode != '0'){
|
||||||
|
// throw({message: 'Something went wrong'})
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
const topData = data?.data?.bar_data?.top_bar
|
// useEffect(()=>{
|
||||||
|
// let reqData = {
|
||||||
|
// token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
// uid: localStorage.getItem('uid') // USER UID
|
||||||
|
// }
|
||||||
|
// topBarData.mutate(reqData)
|
||||||
|
// },[])
|
||||||
|
|
||||||
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
|
const {data:topBarData, isFetching, isError, error} = useQuery({
|
||||||
|
queryKey: queryKeys.topBar,
|
||||||
|
queryFn: () => topBar(reqData)
|
||||||
|
})
|
||||||
|
const data = topBarData?.data?.top_bar // top bar data
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -22,7 +46,7 @@ export default function TopBar() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
: isError ?
|
: isError?
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<div className="card p-4">
|
<div className="card p-4">
|
||||||
<p className='text-danger'>{error.message}</p>
|
<p className='text-danger'>{error.message}</p>
|
||||||
@@ -30,11 +54,11 @@ export default function TopBar() {
|
|||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<>
|
<>
|
||||||
{topData && topData?.map((item, index)=>{
|
{data && data?.map((item, index)=>{
|
||||||
let textColor = item?.description == 'Contacts' ? 'text-danger' : item?.description == 'Site Traffic' ? 'text-primary' : item?.description == 'Appointments' ? 'text-orange' : 'text-success'
|
let textColor = item?.description == 'Contacts' ? 'text-danger' : item?.description == 'Site Traffic' ? 'text-primary' : item?.description == 'Appointments' ? 'text-orange' : 'text-success'
|
||||||
return (
|
return (
|
||||||
<div key={item.id + index} className="col-sm-6 col-xxl-3">
|
<div key={item.id + index} className="col-sm-6 col-xxl-3">
|
||||||
<div className="card card-statistics ecommerce-contant overflow-h">
|
<div className={`card card-statistics ecommerce-contant overflow-h ${item?.extra_style} `}>
|
||||||
<div className="card-body p-0">
|
<div className="card-body p-0">
|
||||||
<div className="d-flex m-b-0 ecommerce-contant-text h-100">
|
<div className="d-flex m-b-0 ecommerce-contant-text h-100">
|
||||||
<div className="w-100">
|
<div className="w-100">
|
||||||
@@ -44,9 +68,7 @@ export default function TopBar() {
|
|||||||
<small className="d-block">{item?.data_span}</small>
|
<small className="d-block">{item?.data_span}</small>
|
||||||
</div>
|
</div>
|
||||||
<div className="col text-right">
|
<div className="col text-right">
|
||||||
<h5 className="text-muted mb-0">{item?.description}</h5>
|
<h5 className="text-muted mb-0"><a href={item?.link}>{item?.description}</a></h5>
|
||||||
<strong className={`${textColor} m-t-5`}><i
|
|
||||||
className="zmdi zmdi-long-arrow-up font-weight-bold"></i> N/A</strong>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="apexchart-wrapper">
|
<div className="apexchart-wrapper">
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { useQuery } from '@tanstack/react-query'
|
||||||
|
import { topBar } from '../../services/services'
|
||||||
|
import queryKeys from '../../services/queryKeys'
|
||||||
|
|
||||||
|
export default function TopBar() {
|
||||||
|
|
||||||
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
|
queryKey: queryKeys.topBar,
|
||||||
|
queryFn: () => topBar()
|
||||||
|
})
|
||||||
|
|
||||||
|
const topData = data?.data?.bar_data?.top_bar
|
||||||
|
console.log('topData', topData)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{isFetching ?
|
||||||
|
<>
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="card p-4">
|
||||||
|
<p className='text-mute'>Loading...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
: isError ?
|
||||||
|
<div className="col-12">
|
||||||
|
<div className="card p-4">
|
||||||
|
<p className='text-danger'>{error.message}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
{topData && topData?.map((item, index)=>{
|
||||||
|
let textColor = item?.description == 'Contacts' ? 'text-danger' : item?.description == 'Site Traffic' ? 'text-primary' : item?.description == 'Appointments' ? 'text-orange' : 'text-success'
|
||||||
|
return (
|
||||||
|
<div key={item.id + index} className="col-sm-6 col-xxl-3">
|
||||||
|
<div className="card card-statistics ecommerce-contant overflow-h">
|
||||||
|
<div className="card-body p-0">
|
||||||
|
<div className="d-flex m-b-0 ecommerce-contant-text h-100">
|
||||||
|
<div className="w-100">
|
||||||
|
<div className="row p-3">
|
||||||
|
<div className="col">
|
||||||
|
<h3 className="mb-0">{item?.value || 0}</h3>
|
||||||
|
<small className="d-block">{item?.data_span}</small>
|
||||||
|
</div>
|
||||||
|
<div className="col text-right">
|
||||||
|
<h5 className="text-muted mb-0">{item?.description}</h5>
|
||||||
|
<strong className={`${textColor} m-t-5`}><i
|
||||||
|
className="zmdi zmdi-long-arrow-up font-weight-bold"></i> N/A</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="apexchart-wrapper">
|
||||||
|
<div id="ecommercedemo3" className="chart-fit"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,16 +1,22 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { Outlet, useLocation } from 'react-router-dom';
|
||||||
import UserMenu from "./layoutcom/UserMenu";
|
import UserMenu from "./layoutcom/UserMenu";
|
||||||
import UserHeader from "./layoutcom/UserHeader";
|
import UserHeader from "./layoutcom/UserHeader";
|
||||||
import UserFooter from "./layoutcom/UserFooter";
|
import UserFooter from "./layoutcom/UserFooter";
|
||||||
import { Outlet } from 'react-router-dom';
|
import siteLinks from '../../links/siteLinks';
|
||||||
|
|
||||||
|
|
||||||
export default function Layout() {
|
export default function Layout() {
|
||||||
|
|
||||||
|
const {pathname} = useLocation()
|
||||||
|
// const isProfileComplete = pathname == siteLinks.profile_complete
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="app">
|
<div className="app">
|
||||||
<div className="app-wrap">
|
<div className="app-wrap">
|
||||||
<UserHeader />
|
<UserHeader />
|
||||||
<div className="app-container">
|
<div className="app-container">
|
||||||
|
|
||||||
<aside className="app-navbar">
|
<aside className="app-navbar">
|
||||||
<UserMenu />
|
<UserMenu />
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ import React from "react";
|
|||||||
|
|
||||||
export default function UserFooter(){
|
export default function UserFooter(){
|
||||||
|
|
||||||
|
const year = new Date().getFullYear()
|
||||||
|
|
||||||
return <>
|
return <>
|
||||||
<footer className="footer">
|
<footer className={`footer`}>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-12 col-sm-6 text-center text-sm-left">
|
<div className="col-12 col-sm-6 text-center text-sm-left">
|
||||||
<p>© Copyright 2024. All rights reserved.</p>
|
<p>© Copyright {year}. All rights reserved.</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="col col-sm-6 ml-sm-auto text-center text-sm-right">
|
<div className="col col-sm-6 ml-sm-auto text-center text-sm-right">
|
||||||
<p>A division of <i className="fa fa-key text-danger mx-1"></i> autoMedSys A.I.</p>
|
<p>A division of <i className="fa fa-key text-danger mx-1"></i> autoMedSys A.I.</p>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from "react";
|
import React, { useRef } from "react";
|
||||||
import getImage from "../../../utils/getImage";
|
import getImage from "../../../utils/getImage";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import siteLinks from "../../../links/siteLinks";
|
import siteLinks from "../../../links/siteLinks";
|
||||||
|
|
||||||
@@ -9,6 +9,8 @@ export default function UserHeader(){
|
|||||||
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
const { userDetails } = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
||||||
|
|
||||||
|
const nav_menu = useRef(null)
|
||||||
|
|
||||||
const toggleSidebar = (e) => {
|
const toggleSidebar = (e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
document.body.classList.toggle('sidebar-toggled')
|
document.body.classList.toggle('sidebar-toggled')
|
||||||
@@ -32,14 +34,19 @@ export default function UserHeader(){
|
|||||||
window.location.reload()
|
window.location.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const toggleMenu = (e) => {
|
||||||
|
// e.preventDefault()
|
||||||
|
nav_menu.current.classList.toggle('show')
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="app-header top-bar">
|
<header className="app-header top-bar">
|
||||||
<nav className="navbar navbar-expand-md">
|
<nav className="navbar navbar-expand-md">
|
||||||
<div className="navbar-header d-flex align-items-center">
|
<div className="navbar-header d-flex align-items-center">
|
||||||
<a href="#" onClick={toggleSidebar} className="mobile-toggle"><i className="ti ti-align-right"></i></a>
|
<a href="#" onClick={toggleSidebar} className="mobile-toggle"><i className="ti ti-align-right"></i></a>
|
||||||
<a className="navbar-brand" href="/dash">
|
<a className="navbar-brand" href="/dash">
|
||||||
<img src={getImage('logo-light.png')} className="img-fluid logo-desktop" alt="logo"/>
|
<img src={getImage('logo-pink.png')} className="img-fluid logo-desktop" alt="logo"/>
|
||||||
<img src={getImage('logo-icon.png')} className="img-fluid logo-mobile" alt="logo"/>
|
<img src={getImage('logo-pink.png')} className="img-fluid logo-mobile" alt="logo"/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={removeSidebar} className="navbar-toggler" type="button" data-bs-toggle="collapse"
|
<button onClick={removeSidebar} className="navbar-toggler" type="button" data-bs-toggle="collapse"
|
||||||
@@ -66,16 +73,16 @@ export default function UserHeader(){
|
|||||||
|
|
||||||
<ul className="navbar-nav nav-right ml-auto">
|
<ul className="navbar-nav nav-right ml-auto">
|
||||||
<li className="nav-item user-profile">
|
<li className="nav-item user-profile">
|
||||||
<a href="#" className="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown">
|
<a onClick={toggleMenu} className="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdow">
|
||||||
<img src={getImage('avtar/02.jpg')} alt="avtar-img" />
|
<img src={getImage('profile-pic-circle.png')} alt="avtar-img" />
|
||||||
<span className="bg-success user-status"></span>
|
<span className="bg-success user-status"></span>
|
||||||
</a>
|
</a>
|
||||||
<div className="dropdown-menu animated fadeIn">
|
<div ref={nav_menu} onClick={toggleMenu} className="dropdown-menu animated fadeIn">
|
||||||
<div className="bg-gradient px-4 py-3">
|
<div className="bg-gradient px-4 py-3">
|
||||||
<div className="d-flex align-items-center justify-content-between">
|
<div className="d-flex align-items-center justify-content-between">
|
||||||
<div className="mr-1">
|
<div className="mr-1">
|
||||||
<h5 className="text-white mb-0">{userDetails?.firstname} {userDetails?.lastname}</h5>
|
{/* <h4 className="text-white mb-0 font-600">{userDetails?.username}</h4> */}
|
||||||
<small className="text-white">{userDetails.email}</small>
|
<p className="text-white font-600">{userDetails.username}</p>
|
||||||
</div>
|
</div>
|
||||||
<a href="#" onClick={logout} className="text-white font-20 tooltip-wrapper" data-toggle="tooltip"
|
<a href="#" onClick={logout} className="text-white font-20 tooltip-wrapper" data-toggle="tooltip"
|
||||||
data-placement="top" title="" data-original-title="Logout"> <i
|
data-placement="top" title="" data-original-title="Logout"> <i
|
||||||
@@ -83,31 +90,35 @@ export default function UserHeader(){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4">
|
<div className="p-4">
|
||||||
<a className="dropdown-item d-flex nav-link" href="#">
|
<Link className="dropdown-item d-flex nav-link" to={siteLinks.subscription}>
|
||||||
<i className="fa fa-user pr-2 text-success"></i> Profile</a>
|
<i className="fa fa-user pr-2 text-success"></i> Subscription</Link>
|
||||||
<a className="dropdown-item d-flex nav-link" href="#">
|
<Link className="dropdown-item d-flex nav-link" to={siteLinks.contacts}>
|
||||||
<i className="fa fa-envelope pr-2 text-primary"></i> Inbox
|
<i className="fa fa-envelope pr-2 text-primary"></i> Contacts
|
||||||
<span className="badge badge-primary ml-auto">6</span>
|
<span className="badge badge-primary ml-auto">6</span>
|
||||||
</a>
|
</Link>
|
||||||
<a className="dropdown-item d-flex nav-link" href="#">
|
<Link className="dropdown-item d-flex nav-link" to={siteLinks.settings}>
|
||||||
<i className=" ti ti-settings pr-2 text-info"></i> Settings
|
<i className=" ti ti-settings pr-2 text-info"></i> Settings
|
||||||
</a>
|
</Link>
|
||||||
<a className="dropdown-item d-flex nav-link" href="#">
|
<Link className="dropdown-item d-flex nav-link" to={siteLinks.help}>
|
||||||
<i className="fa fa-compass pr-2 text-warning"></i> Need help?</a>
|
<i className="fa fa-compass pr-2 text-warning"></i>
|
||||||
<div className="row mt-2">
|
Need help?
|
||||||
<div className="col">
|
</Link>
|
||||||
<a className="bg-light p-3 text-center d-block" href="#">
|
|
||||||
<i className="fe fe-mail font-20 text-primary"></i>
|
{/*<div className="row mt-2">*/}
|
||||||
<span className="d-block font-13 mt-2">My messages</span>
|
{/* <div className="col">*/}
|
||||||
</a>
|
{/* <a className="bg-light p-3 text-center d-block" href="#">*/}
|
||||||
</div>
|
{/* <i className="fe fe-mail font-20 text-primary"></i>*/}
|
||||||
<div className="col">
|
{/* <span className="d-block font-13 mt-2">My messages</span>*/}
|
||||||
<a className="bg-light p-3 text-center d-block" href="#">
|
{/* </a>*/}
|
||||||
<i className="fe fe-plus font-20 text-primary"></i>
|
{/* </div>*/}
|
||||||
<span className="d-block font-13 mt-2">Compose new</span>
|
{/* <div className="col">*/}
|
||||||
</a>
|
{/* <a className="bg-light p-3 text-center d-block" href="#">*/}
|
||||||
</div>
|
{/* <i className="fe fe-plus font-20 text-primary"></i>*/}
|
||||||
</div>
|
{/* <span className="d-block font-13 mt-2">Compose new</span>*/}
|
||||||
|
{/* </a>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default function UserMenu() {
|
|||||||
<li className="nav-static-title">Panel</li>
|
<li className="nav-static-title">Panel</li>
|
||||||
<li className={`${pathname == siteLinks.dash ? 'active' : ''}`}>
|
<li className={`${pathname == siteLinks.dash ? 'active' : ''}`}>
|
||||||
<Link className="has-arrow" to='#' data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
|
<Link className="has-arrow" to='#' data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
|
||||||
<i className="nav-icon ti ti-rocket"></i>
|
<i className="nav-icon ti ti-home"></i>
|
||||||
<div className='d-flex gap-2 justify-content-between align-items-center'>
|
<div className='d-flex gap-2 justify-content-between align-items-center'>
|
||||||
<span className="nav-title">Dashboard</span>
|
<span className="nav-title">Dashboard</span>
|
||||||
<IoIosArrowDown />
|
<IoIosArrowDown />
|
||||||
@@ -48,7 +48,7 @@ export default function UserMenu() {
|
|||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<ul id="collapseTwo" className="collapse" aria-labelledby="headingTwo" data-bs-parent="#sidebarNav">
|
<ul id="collapseTwo" className="collapse" aria-labelledby="headingTwo" data-bs-parent="#sidebarNav">
|
||||||
<li className={`${pathname == siteLinks.user ? 'active' : ''}`}><Link to={siteLinks.user}>Users</Link></li>
|
<li className={`${pathname == siteLinks.subscription ? 'active' : ''}`}><Link to={siteLinks.subscription}>Subscription</Link></li>
|
||||||
<li className={`${pathname == siteLinks.settings ? 'active' : ''}`}><Link to={siteLinks.settings}>Settings</Link></li>
|
<li className={`${pathname == siteLinks.settings ? 'active' : ''}`}><Link to={siteLinks.settings}>Settings</Link></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
|
import getImage from "../../utils/getImage";
|
||||||
|
|
||||||
|
export default function Onboard() {
|
||||||
|
|
||||||
|
const pricingFields ={
|
||||||
|
starter: { name: 'Starter', price: 5.99, active: true },
|
||||||
|
basic: { name: 'Basic', price: 12.99, active: true },
|
||||||
|
premium: { name: 'Premium', price: 20.00, active: true },
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<BreadcrumbComBS title='Subscription' paths={['Dashboard', 'Subscription']} />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-xl-3 col-md-6">
|
||||||
|
<div className="card card-statistics text-center py-3">
|
||||||
|
<div className="card-body pricing-content">
|
||||||
|
<div className="pricing-content-card">
|
||||||
|
<h5>Current Subscription(s)</h5>
|
||||||
|
<h2 className="text-primary pt-3">Basic</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>
|
||||||
|
|
||||||
|
<>
|
||||||
|
{Object.entries(pricingFields)?.map(([key, value]) => (
|
||||||
|
|
||||||
|
<div key={key} className="col-xl-3 col-md-6">
|
||||||
|
<div className="card card-statistics text-center py-3">
|
||||||
|
<div className="card-body pricing-content">
|
||||||
|
<div className="pricing-content-card">
|
||||||
|
<h5>{value.name}</h5>
|
||||||
|
<h2 className="text-primary pt-3">${value.price}</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 className="pt-2"><a href="javascript:void(0)" className="btn btn-inverse-secondary btn-round btn-sm">go {value.name}</a></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,140 +1,81 @@
|
|||||||
import React from "react";
|
import React, { useMemo, useRef, useState } from "react";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
import getImage from "../../utils/getImage";
|
import getImage from "../../utils/getImage";
|
||||||
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
|
import { productRefreshSite, getSettingsData } from "../../services/services";
|
||||||
|
import Settings from "./settingsTab/Settings";
|
||||||
|
import queryKeys from "../../services/queryKeys";
|
||||||
|
|
||||||
|
|
||||||
export default function ProductActive(){
|
export default function ProductActive({productData}){
|
||||||
|
|
||||||
|
const iframe = useRef()
|
||||||
|
|
||||||
|
const refresh = useMutation({
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return productRefreshSite(fields)
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
iframe.current.src += ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleRefresh = () => {
|
||||||
|
const reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid'), // USER UID
|
||||||
|
product_id: productData.product_id,
|
||||||
|
subscription_uid: productData.subscription_uid
|
||||||
|
}
|
||||||
|
refresh.mutate(reqData)
|
||||||
|
}
|
||||||
|
let externalUrl= 'https://'+productData?.internal_url
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
<BreadcrumbComBS title='Active Product Name' paths={['Dashboard', 'Product']} />
|
{/*<BreadcrumbComBS title='Active Product Name' paths={['Dashboard', 'Product']} />*/}
|
||||||
{/*<div className="row">*/}
|
{/*<div className="row">*/}
|
||||||
{/* <div className="vh-100 col-12 flex align-items-center">Coming Soon</div>*/}
|
{/* <div className="vh-100 col-12 flex align-items-center">Coming Soon</div>*/}
|
||||||
{/*</div>*/}
|
{/*</div>*/}
|
||||||
|
|
||||||
|
|
||||||
<div className="row account-contant">
|
<div className="row account-contant">
|
||||||
<div className="col-12">
|
<>
|
||||||
<div className="card card-statistics">
|
<div className="row tabs-contant">
|
||||||
<div className="card-body p-0">
|
<div className="col-xxl-6">
|
||||||
<div className="row no-gutters">
|
<div className="card card-statistics">
|
||||||
<div className="col-xl-3 pb-xl-0 pb-5 border-right">
|
<div className="card-header">
|
||||||
<div className="page-account-profil pt-5">
|
<div className="card-heading d-flex justify-content-between">
|
||||||
<div className="profile-img text-center rounded-circle">
|
<h4 className="card-title">{externalUrl}</h4>
|
||||||
<div className="pt-5">
|
<button type="button" onClick={()=>iframe.current.src += ''} className="btn">
|
||||||
<div className="bg-img m-auto">
|
<img src={getImage('refresh.png')} style={{width: '30px', height: 'auto'}} alt='refresh page' />
|
||||||
<img src={getImage('widget/01.jpg')} className="img-fluid"
|
</button>
|
||||||
alt="users-avatar" />
|
|
||||||
</div>
|
|
||||||
<div className="profile pt-4">
|
|
||||||
<h4 className="mb-1">Product Short Name</h4>
|
|
||||||
<p>last Update : 00:00:0000</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-xl-5 col-md-6 col-12 border-t border-right">
|
<div className="card-body">
|
||||||
<div className="page-account-form">
|
<iframe ref={iframe} style={{borderWidth: '0px'}} src={externalUrl} width="100%" height="600" title={externalUrl}></iframe>
|
||||||
<div className="form-titel border-bottom p-3">
|
</div>
|
||||||
<h5 className="mb-0 py-2">Edit Your Product Settings</h5>
|
<div className="p-4 ml-auto">
|
||||||
</div>
|
<button type="button" onClick={handleRefresh} className="btn btn-primary">{refresh.isPending ? 'Loading...' : 'Refresh Site'}
|
||||||
<div className="p-4">
|
</button>
|
||||||
<form>
|
</div>
|
||||||
<div className="form-row">
|
</div>
|
||||||
<div className="form-group col-md-12">
|
</div>
|
||||||
<label htmlFor="name1">Full Name</label>
|
<div className="col-xxl-6">
|
||||||
<input type="text" className="form-control" id="name1"
|
<div className="card card-statistics">
|
||||||
value="Alice Williams" />
|
<div className="card-header">
|
||||||
</div>
|
<div className="card-heading">
|
||||||
<div className="form-group col-md-12">
|
<h4 className="card-title"> Site Settings </h4>
|
||||||
<label htmlFor="title1">Title</label>
|
|
||||||
<input type="text" className="form-control" id="title1"
|
|
||||||
value="Marketing expert" />
|
|
||||||
</div>
|
|
||||||
<div className="form-group col-md-12">
|
|
||||||
<label htmlFor="phone1">Phone Number</label>
|
|
||||||
<input type="text" className="form-control" id="phone1"
|
|
||||||
value="(01) 97 563 15613" />
|
|
||||||
</div>
|
|
||||||
<div className="form-group col-md-12">
|
|
||||||
<label htmlFor="email1">Email</label>
|
|
||||||
<input type="email" className="form-control" id="email1"
|
|
||||||
value="alicewilliams@gmail.com" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="form-group">
|
|
||||||
<label htmlFor="add1">Address</label>
|
|
||||||
<input type="text" className="form-control" id="add1"
|
|
||||||
value="17504 Carlton Cuevas Rd, Gulfport, MS, 39503" />
|
|
||||||
</div>
|
|
||||||
<div className="form-group">
|
|
||||||
<label htmlFor="add2">Address 2</label>
|
|
||||||
<input type="text" className="form-control" id="add2"
|
|
||||||
value="1234 North Avenue Luke Lane, South Bend, IN 360001" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<button type="submit" className="btn btn-primary">Update Information
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-xl-4 col-md-6 border-t col-12">
|
<div className="card-body">
|
||||||
<div className="page-account-form">
|
<Settings productData={productData} />
|
||||||
<div className="form-titel border-bottom p-3">
|
|
||||||
<h5 className="mb-0 py-2">Your External Link</h5>
|
|
||||||
</div>
|
|
||||||
<div className="p-4">
|
|
||||||
<form>
|
|
||||||
<div className="form-group">
|
|
||||||
<label htmlFor="fb">Facebook URL:</label>
|
|
||||||
<input type="text" className="form-control" id="fb"
|
|
||||||
value="https://www.facebook.com/" />
|
|
||||||
</div>
|
|
||||||
<div className="form-group">
|
|
||||||
<label htmlFor="tr">Twitter URL:</label>
|
|
||||||
<input type="text" className="form-control" id="tr"
|
|
||||||
value="https://twitter.com/" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-group">
|
|
||||||
<label htmlFor="br">Blogger URL:</label>
|
|
||||||
<input type="text" className="form-control" id="br"
|
|
||||||
value="https://www.blogger.com" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-group">
|
|
||||||
<label htmlFor="go">Google+ URL:</label>
|
|
||||||
<input type="text" className="form-control" id="go"
|
|
||||||
value="https://plus.google.com/discover" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-group">
|
|
||||||
<label htmlFor="li">LinkedIn URL:</label>
|
|
||||||
<input type="text" className="form-control" id="li"
|
|
||||||
value="https://in.linkedin.com/" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-group">
|
|
||||||
<label htmlFor="we">Website URL:</label>
|
|
||||||
<input type="text" className="form-control" id="we"
|
|
||||||
value="https://yourwebsite.com" />
|
|
||||||
</div>
|
|
||||||
<button type="submit" className="btn btn-primary">Save & Update</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,39 +1,34 @@
|
|||||||
import React, {useState} from "react";
|
|
||||||
import { useQuery } from '@tanstack/react-query'
|
import { useQuery } from '@tanstack/react-query'
|
||||||
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
// import getImage from "../../utils/getImage";
|
// import getImage from "../../utils/getImage";
|
||||||
import ProductStart from "./ProductStart";
|
import ProductStart from "./ProductStart";
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
import {MyProductData, productData} from "../../services/services";
|
import {MyProductData} from "../../services/services";
|
||||||
import queryKeys from "../../services/queryKeys";
|
|
||||||
import ProductActive from "./ProductActive";
|
import ProductActive from "./ProductActive";
|
||||||
import ProductProvision from "./ProductProvision";
|
import ProductProvision from "./ProductProvision";
|
||||||
import {productConst} from "../../constants/products";
|
import {productConst} from "../../constants/products";
|
||||||
|
import queryKeys from "../../services/queryKeys";
|
||||||
|
|
||||||
export default function ProductFactory(){
|
export default function ProductFactory(){
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const pathname = location.pathname;
|
const pathname = location.pathname;
|
||||||
const [productStatus, setProductStatus] = useState(0);
|
|
||||||
|
|
||||||
//productConst.PRODUCT_ACTIVE
|
|
||||||
|
|
||||||
|
|
||||||
// Split the pathname by '/' and get the last element
|
// Split the pathname by '/' and get the last element
|
||||||
const lastPart = pathname.split('/').pop();
|
const productID = pathname.split('/').pop();
|
||||||
// console.log(lastPart)
|
|
||||||
|
|
||||||
|
let reqData = {
|
||||||
|
product_id : productID,
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
const {data, isFetching, isError, error} = useQuery({
|
const {data, isFetching, isError, error} = useQuery({
|
||||||
queryKey: queryKeys.product,
|
queryKey: queryKeys.product_page,
|
||||||
queryFn: () => MyProductData(lastPart)
|
queryFn: () => MyProductData(reqData),
|
||||||
|
staleTime: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const myproduct_data = data?.data?.myproduct?.myproudct // PRODUCT DETAILS
|
||||||
|
|
||||||
const myproduct_data = data?.data?.myproduct_data
|
|
||||||
//setProductStatus(myproduct_data?.status)
|
|
||||||
|
|
||||||
const product_name = myproduct_data?.product_name;
|
const product_name = myproduct_data?.product_name;
|
||||||
|
|
||||||
const product_status = myproduct_data?.status;
|
const product_status = myproduct_data?.status;
|
||||||
|
|
||||||
return(
|
return(
|
||||||
@@ -51,24 +46,23 @@ export default function ProductFactory(){
|
|||||||
: isError ?
|
: isError ?
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<p className='text-danger'>{error.message}</p>
|
<p className='text-danger'>{error?.message}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<div>
|
<div>
|
||||||
{(product_status <= productConst.PRODUCT_AVAILABLE)?
|
{(product_status <= productConst.PRODUCT_AVAILABLE)?
|
||||||
<ProductStart productData={myproduct_data} />
|
<ProductStart productData={myproduct_data} />
|
||||||
:<></> }
|
:<></> }
|
||||||
|
|
||||||
{(product_status === productConst.PRODUCT_PROVISIONING)?
|
{(product_status === productConst.PRODUCT_PROVISIONING)?
|
||||||
<ProductProvision productData={myproduct_data} />
|
<ProductProvision productData={myproduct_data} />
|
||||||
:<></> }
|
:<></> }
|
||||||
|
|
||||||
{(product_status === productConst.PRODUCT_ACTIVE)?
|
{(product_status === productConst.PRODUCT_ACTIVE)?
|
||||||
<ProductActive productData={myproduct_data} />
|
<ProductActive productData={myproduct_data} />
|
||||||
:<></> }
|
:<></> }
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -12,14 +12,20 @@ export default function ProductProvision(props){
|
|||||||
const productTitle = props?.productData?.title;
|
const productTitle = props?.productData?.title;
|
||||||
const productDescription = props?.productData?.description;
|
const productDescription = props?.productData?.description;
|
||||||
const productID = props?.productData?.product_id
|
const productID = props?.productData?.product_id
|
||||||
|
const productUID = props?.productData?.product_uid
|
||||||
const productSubUID = props?.productData?.product_subscription_uid
|
const productSubUID = props?.productData?.product_subscription_uid
|
||||||
|
|
||||||
|
const reqData = {
|
||||||
|
product_id : productID,
|
||||||
|
product_subscription_uid: productSubUID
|
||||||
|
}
|
||||||
|
|
||||||
const {data:provision, isFetching, isError, error} = useQuery({
|
const {data:provision, isFetching, isError, error} = useQuery({
|
||||||
queryKey: queryKeys.myproduct_provision,
|
queryKey: queryKeys.myproduct_provision,
|
||||||
queryFn: () => productProvision(productID)
|
queryFn: () => productProvision(reqData)
|
||||||
})
|
})
|
||||||
|
|
||||||
const provisionData = provision?.data?.provision
|
const provisionData = provision?.data
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
joinRoom(productSubUID); // provision subscription room
|
joinRoom(productSubUID); // provision subscription room
|
||||||
@@ -54,7 +60,7 @@ export default function ProductProvision(props){
|
|||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<div className="progress">
|
<div className="progress">
|
||||||
<div className="progress-bar progress-bar-striped progress-bar-animated" role="progressbar"
|
<div className="progress-bar progress-bar-striped progress-bar-animated" role="progressbar"
|
||||||
aria-valuenow={`${provisionData.percent_completed}%`} aria-valuemin="0" aria-valuemax="100" style={{width:`${provisionData.percent_completed}%`}} ></div>
|
aria-valuenow={`${provisionData?.percent_completed}%`} aria-valuemin="0" aria-valuemax="100" style={{width:`${provisionData?.percent_completed}%`}} ></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -104,11 +110,9 @@ export default function ProductProvision(props){
|
|||||||
<div className="card card-statistics ">
|
<div className="card card-statistics ">
|
||||||
<h4 className="card-title" style={{padding:'10px'}}>Started creating your selection</h4>
|
<h4 className="card-title" style={{padding:'10px'}}>Started creating your selection</h4>
|
||||||
<img className="card-img-top" src={getImage('widget/working.jpg')} alt="Card image cap" />
|
<img className="card-img-top" src={getImage('widget/working.jpg')} alt="Card image cap" />
|
||||||
<div className="card-body">
|
{/* <div className="card-body">
|
||||||
<p>
|
<div className="" dangerouslySetInnerHTML={{__html: productDescription}}/>
|
||||||
{productDescription}
|
</div> */}
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useRef, useState } from "react";
|
import React, { useRef, useState } from "react";
|
||||||
|
import {useNavigate} from 'react-router-dom'
|
||||||
import getImage from "../../utils/getImage";
|
import getImage from "../../utils/getImage";
|
||||||
// import { Modal } from "bootstrap";
|
import { Modal } from "bootstrap";
|
||||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { subscribe } from '../../services/services'
|
import { subscribe } from '../../services/services'
|
||||||
import queryKeys from "../../services/queryKeys";
|
import queryKeys from "../../services/queryKeys";
|
||||||
@@ -8,24 +9,28 @@ import queryKeys from "../../services/queryKeys";
|
|||||||
export default function ProductStart(props){
|
export default function ProductStart(props){
|
||||||
|
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const [requestStatus, setRequestStatus] = useState({status:false, message: ''})
|
const [requestStatus, setRequestStatus] = useState({status:false, message: ''})
|
||||||
|
|
||||||
const product_uid = props?.productData?.product_uid;
|
const product_uid = props?.productData?.product_uid;
|
||||||
const product_id = props?.productData?.product_id;
|
const product_id = props?.productData?.product_id;
|
||||||
const productBanner = "product/"+props.productData?.banner;
|
const productBanner = `product/${props.productData?.banner}`;
|
||||||
const productTitle = props.productData?.title;
|
const productTitle = props?.productData?.title;
|
||||||
const productDescription = props.productData?.description;
|
const productDescription = props?.productData?.description;
|
||||||
const promotion_text = props.productData?.promotion_text;
|
const promotion_text = props?.productData?.promotion_text;
|
||||||
const product_status = props.productData?.status;
|
const product_status = props?.productData?.status;
|
||||||
const modalRef = useRef()
|
const saleText = props?.productData?.sale_text;
|
||||||
|
|
||||||
const refetch = () => {
|
const modalRef = useRef(null)
|
||||||
queryClient.refetchQueries({
|
|
||||||
queryKey: [...queryKeys.product],
|
const invalidate = () => {
|
||||||
// type: 'active',
|
// queryClient.refetchQueries({
|
||||||
// exact: true,
|
// queryKey: [...queryKeys.product],
|
||||||
})
|
// // type: 'active',
|
||||||
|
// // exact: true,
|
||||||
|
// })
|
||||||
|
queryClient.invalidateQueries({ queryKey: [...queryKeys.product_url] })
|
||||||
|
queryClient.invalidateQueries({ queryKey: [...queryKeys.product_page] })
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutation = useMutation({
|
const mutation = useMutation({
|
||||||
@@ -38,9 +43,12 @@ export default function ProductStart(props){
|
|||||||
},
|
},
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
setRequestStatus({status:true, message:'successful'})
|
setRequestStatus({status:true, message:'successful'})
|
||||||
|
navigate(`/product/${product_id}`, {replace: true}) //'/product/'+ product_id
|
||||||
|
dismissModal()
|
||||||
console.log(res)
|
console.log(res)
|
||||||
},
|
},
|
||||||
onSettled: () => {
|
onSettled: () => {
|
||||||
|
invalidate() // Invalidates selected queries
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
setRequestStatus({status:false, message:''})
|
setRequestStatus({status:false, message:''})
|
||||||
},4000)
|
},4000)
|
||||||
@@ -51,6 +59,22 @@ export default function ProductStart(props){
|
|||||||
mutation.mutate({product_id: product_id})
|
mutation.mutate({product_id: product_id})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dismissModal = () => {
|
||||||
|
const body = document.querySelector('body')
|
||||||
|
body.removeAttribute('style')
|
||||||
|
// body.classList.toggle('modal-open')
|
||||||
|
|
||||||
|
const modalBackdrop = document.querySelectorAll('.modal-backdrop')
|
||||||
|
modalBackdrop.forEach(item => {
|
||||||
|
if (item) {
|
||||||
|
item.remove();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const modal = Modal.getInstance(modalRef.current);
|
||||||
|
modal && modal.hide();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
@@ -59,7 +83,8 @@ export default function ProductStart(props){
|
|||||||
<img className="card-img-top" src={getImage(productBanner)} alt="Card image cap" />
|
<img className="card-img-top" src={getImage(productBanner)} alt="Card image cap" />
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<h4 className="card-title">{productTitle}</h4>
|
<h4 className="card-title">{productTitle}</h4>
|
||||||
<p className="card-text">{productDescription}</p>
|
<div className="card-text" dangerouslySetInnerHTML={{__html: productDescription}}/>
|
||||||
|
{/* <p className="card-text">{productDescription}</p> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -110,21 +135,12 @@ export default function ProductStart(props){
|
|||||||
<div className="modal-content">
|
<div className="modal-content">
|
||||||
<div className="modal-header">
|
<div className="modal-header">
|
||||||
<h5 className="modal-title" id="verticalCenterTitle">{productTitle}</h5>
|
<h5 className="modal-title" id="verticalCenterTitle">{productTitle}</h5>
|
||||||
<button onClick={refetch} type="button" className="close" data-bs-dismiss="modal" aria-label="Close">
|
<button type="button" className="close" data-bs-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-body">
|
<div className="modal-body">
|
||||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis
|
<div className="" dangerouslySetInnerHTML={{__html: saleText}}/>
|
||||||
in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at
|
|
||||||
eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia
|
|
||||||
bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque
|
|
||||||
nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor
|
|
||||||
fringilla. Cras mattis consectetur purus sit amet fermentum. Cras justo odio,
|
|
||||||
</p>
|
|
||||||
{/* {mutation.error &&
|
{/* {mutation.error &&
|
||||||
<>
|
<>
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
@@ -146,7 +162,7 @@ export default function ProductStart(props){
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-footer">
|
<div className="modal-footer">
|
||||||
<button onClick={refetch} type="button" className="btn btn-danger" data-bs-dismiss="modal">Close</button>
|
<button type="button" className="btn btn-danger" data-bs-dismiss="modal">Close</button>
|
||||||
<button type="button" className="btn btn-success" disabled={mutation.isSuccess} onClick={handleSubscribe}>{mutation.isPending ? 'loading...' : 'Start'}</button>
|
<button type="button" className="btn btn-success" disabled={mutation.isSuccess} onClick={handleSubscribe}>{mutation.isPending ? 'loading...' : 'Start'}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,278 @@
|
|||||||
|
import React from "react";
|
||||||
|
import getImage from "../../utils/getImage";
|
||||||
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
|
|
||||||
|
|
||||||
|
export default function ProductActive(){
|
||||||
|
|
||||||
|
return(
|
||||||
|
<>
|
||||||
|
{/*<BreadcrumbComBS title='Active Product Name' paths={['Dashboard', 'Product']} />*/}
|
||||||
|
{/*<div className="row">*/}
|
||||||
|
{/* <div className="vh-100 col-12 flex align-items-center">Coming Soon</div>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
|
||||||
|
|
||||||
|
<div className="row account-contant">
|
||||||
|
<>
|
||||||
|
|
||||||
|
|
||||||
|
<div className="row tabs-contant">
|
||||||
|
<div className="col-xxl-6">
|
||||||
|
<div className="card card-statistics">
|
||||||
|
<div className="card-header">
|
||||||
|
<div className="card-heading">
|
||||||
|
<h4 className="card-title">https://25681.devprov.mermsemr.com/</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="card-body">
|
||||||
|
<iframe style={{borderWidth: '0px;'}} src="https://25681.devprov.mermsemr.com/" width="100%" height="600" title="https://25681.devprov.mermsemr.com"></iframe>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="col-xxl-6">
|
||||||
|
<div className="card card-statistics">
|
||||||
|
<div className="card-header">
|
||||||
|
<div className="card-heading">
|
||||||
|
<h4 className="card-title"> Site Settings </h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="card-body">
|
||||||
|
<div className="tab tab-vertical">
|
||||||
|
<ul className="nav nav-tabs" role="tablist">
|
||||||
|
<li className="nav-item">
|
||||||
|
<a className="nav-link active show" id="home-09-tab" data-toggle="tab" href="#home-09" role="tab" aria-controls="home-09" aria-selected="true">General</a>
|
||||||
|
</li>
|
||||||
|
<li className="nav-item">
|
||||||
|
<a className="nav-link" id="home-09-tab" data-toggle="tab" href="#home-09" role="tab" aria-controls="home-09" aria-selected="true">Home Page</a>
|
||||||
|
</li>
|
||||||
|
<li className="nav-item">
|
||||||
|
<a className="nav-link" id="profile-09-tab" data-toggle="tab" href="#profile-09" role="tab" aria-controls="profile-09" aria-selected="false"> Footer </a>
|
||||||
|
</li>
|
||||||
|
<li className="nav-item">
|
||||||
|
<a className="nav-link" id="portfolio-09-tab" data-toggle="tab" href="#portfolio-09" role="tab" aria-controls="portfolio-09" aria-selected="false">About Page </a>
|
||||||
|
</li>
|
||||||
|
<li className="nav-item">
|
||||||
|
<a className="nav-link" id="contact-09-tab" data-toggle="tab" href="#contact-09" role="tab" aria-controls="contact-09" aria-selected="false"> Contact Page</a>
|
||||||
|
</li>
|
||||||
|
<li className="nav-item">
|
||||||
|
<a className="nav-link" id="home-09-tab" data-toggle="tab" href="#home-09" role="tab" aria-controls="home-09" aria-selected="true">Socials</a>
|
||||||
|
</li>
|
||||||
|
<li className="nav-item">
|
||||||
|
<a className="nav-link" id="home-09-tab" data-toggle="tab" href="#home-09" role="tab" aria-controls="home-09" aria-selected="true">Template</a>
|
||||||
|
</li>
|
||||||
|
<li className="nav-item">
|
||||||
|
<a className="nav-link" id="home-09-tab" data-toggle="tab" href="#home-09" role="tab" aria-controls="home-09" aria-selected="true"> Color Scheme</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div className="tab-content">
|
||||||
|
<div className="tab-pane fade active show" id="home-09" role="tabpanel" aria-labelledby="home-09-tab">
|
||||||
|
|
||||||
|
<div className="page-account-form">
|
||||||
|
<div className="p-4">
|
||||||
|
<form>
|
||||||
|
<div className="form-row">
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="name1">Full Name</label>
|
||||||
|
<input type="text" className="form-control" id="name1"
|
||||||
|
value="Alice Williams" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="title1">Title</label>
|
||||||
|
<input type="text" className="form-control" id="title1"
|
||||||
|
value="Marketing expert" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="phone1">Phone Number</label>
|
||||||
|
<input type="text" className="form-control" id="phone1"
|
||||||
|
value="(01) 97 563 15613" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="email1">Email</label>
|
||||||
|
<input type="email" className="form-control" id="email1"
|
||||||
|
value="alicewilliams@gmail.com" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="form-group">
|
||||||
|
<label htmlFor="add1">Address</label>
|
||||||
|
<input type="text" className="form-control" id="add1"
|
||||||
|
value="17504 Carlton Cuevas Rd, Gulfport, MS, 39503" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group">
|
||||||
|
<label htmlFor="add2">Address 2</label>
|
||||||
|
<input type="text" className="form-control" id="add2"
|
||||||
|
value="1234 North Avenue Luke Lane, South Bend, IN 360001" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<button type="submit" className="btn btn-primary">Update Information
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div className="tab-pane fade" id="profile-09" role="tabpanel" aria-labelledby="profile-09-tab">
|
||||||
|
<div className="page-account-form">
|
||||||
|
|
||||||
|
<div className="p-4">
|
||||||
|
<form>
|
||||||
|
<div className="form-row">
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="name1">Full Name</label>
|
||||||
|
<input type="text" className="form-control" id="name1"
|
||||||
|
value="Alice Williams" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="title1">Title</label>
|
||||||
|
<input type="text" className="form-control" id="title1"
|
||||||
|
value="Marketing expert" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="phone1">Phone Number</label>
|
||||||
|
<input type="text" className="form-control" id="phone1"
|
||||||
|
value="(01) 97 563 15613" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="email1">Email</label>
|
||||||
|
<input type="email" className="form-control" id="email1"
|
||||||
|
value="alicewilliams@gmail.com" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="form-group">
|
||||||
|
<label htmlFor="add1">Address</label>
|
||||||
|
<input type="text" className="form-control" id="add1"
|
||||||
|
value="17504 Carlton Cuevas Rd, Gulfport, MS, 39503" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group">
|
||||||
|
<label htmlFor="add2">Address 2</label>
|
||||||
|
<input type="text" className="form-control" id="add2"
|
||||||
|
value="1234 North Avenue Luke Lane, South Bend, IN 360001" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<button type="submit" className="btn btn-primary">Update Information
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="tab-pane fade" id="portfolio-09" role="tabpanel" aria-labelledby="portfolio-09-tab">
|
||||||
|
<p>
|
||||||
|
<div className="page-account-form">
|
||||||
|
<div className="form-titel border-bottom p-3">
|
||||||
|
<h5 className="mb-0 py-2">Edit Your Product Settings</h5>
|
||||||
|
</div>
|
||||||
|
<div className="p-4">
|
||||||
|
<form>
|
||||||
|
<div className="form-row">
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="name1">Full Name</label>
|
||||||
|
<input type="text" className="form-control" id="name1"
|
||||||
|
value="Alice Williams" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="title1">Title</label>
|
||||||
|
<input type="text" className="form-control" id="title1"
|
||||||
|
value="Marketing expert" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="phone1">Phone Number</label>
|
||||||
|
<input type="text" className="form-control" id="phone1"
|
||||||
|
value="(01) 97 563 15613" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="email1">Email</label>
|
||||||
|
<input type="email" className="form-control" id="email1"
|
||||||
|
value="alicewilliams@gmail.com" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="form-group">
|
||||||
|
<label htmlFor="add1">Address</label>
|
||||||
|
<input type="text" className="form-control" id="add1"
|
||||||
|
value="17504 Carlton Cuevas Rd, Gulfport, MS, 39503" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group">
|
||||||
|
<label htmlFor="add2">Address 2</label>
|
||||||
|
<input type="text" className="form-control" id="add2"
|
||||||
|
value="1234 North Avenue Luke Lane, South Bend, IN 360001" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<button type="submit" className="btn btn-primary">Update Information
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p> </div>
|
||||||
|
<div className="tab-pane fade" id="contact-09" role="tabpanel" aria-labelledby="contact-09-tab">
|
||||||
|
<p>
|
||||||
|
<div className="page-account-form">
|
||||||
|
<div className="form-titel border-bottom p-3">
|
||||||
|
<h5 className="mb-0 py-2">Edit Your Product Settings</h5>
|
||||||
|
</div>
|
||||||
|
<div className="p-4">
|
||||||
|
<form>
|
||||||
|
<div className="form-row">
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="name1">Full Name</label>
|
||||||
|
<input type="text" className="form-control" id="name1"
|
||||||
|
value="Alice Williams" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="title1">Title</label>
|
||||||
|
<input type="text" className="form-control" id="title1"
|
||||||
|
value="Marketing expert" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="phone1">Phone Number</label>
|
||||||
|
<input type="text" className="form-control" id="phone1"
|
||||||
|
value="(01) 97 563 15613" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="email1">Email</label>
|
||||||
|
<input type="email" className="form-control" id="email1"
|
||||||
|
value="alicewilliams@gmail.com" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="form-group">
|
||||||
|
<label htmlFor="add1">Address</label>
|
||||||
|
<input type="text" className="form-control" id="add1"
|
||||||
|
value="17504 Carlton Cuevas Rd, Gulfport, MS, 39503" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group">
|
||||||
|
<label htmlFor="add2">Address 2</label>
|
||||||
|
<input type="text" className="form-control" id="add2"
|
||||||
|
value="1234 North Avenue Luke Lane, South Bend, IN 360001" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<button type="submit" className="btn btn-primary">Update Information
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
import React, {memo, useState} from 'react'
|
||||||
|
import { useMutation } from "@tanstack/react-query";
|
||||||
|
import { pageSettings } from "../../../services/services";
|
||||||
|
import SiteTemplateSelector from './SiteTemplateSelector';
|
||||||
|
import NoYesBooleanDropdown from './NoYesBooleanDropdown';
|
||||||
|
import { IoMdArrowDropdown } from 'react-icons/io';
|
||||||
|
|
||||||
|
const GeneralTab = memo(({name='Full Name', data, isCustom, productData, backendValues, setFieldsChanged}) =>{
|
||||||
|
|
||||||
|
const [reqStatus, setReqStatus] = useState({error: null, message: ''})
|
||||||
|
|
||||||
|
const fieldData = {}
|
||||||
|
Object.entries(data)?.forEach(([key, value]) => { // LOOP TO POPULATE FIELDDATA PROPERTIES WITH DATA OF EACH TAB
|
||||||
|
fieldData[value?.name?.toLowerCase().replaceAll(" ", "_")] = ''
|
||||||
|
})
|
||||||
|
backendValues.forEach(item => { //LOOPING THROUGH USER ALREADY ADDED DATA FROM BACKEND IF ANY AND UPDATING THE FIELDDATA OBJECT
|
||||||
|
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}))
|
||||||
|
setFieldsChanged(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitSettings = useMutation({
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return pageSettings(fields)
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
if(res?.data?.resultCode != '0'){
|
||||||
|
return setReqStatus({error: true, message: 'Unable to complete, try again later'})
|
||||||
|
}
|
||||||
|
setFieldsChanged(false)
|
||||||
|
setReqStatus({error: false, message: 'Completed successfully'})
|
||||||
|
},
|
||||||
|
onError: (err) => {
|
||||||
|
setReqStatus({error: true, message: 'Unable to complete, try again later'})
|
||||||
|
},
|
||||||
|
onSettled: () => {
|
||||||
|
setTimeout(()=>{
|
||||||
|
setReqStatus({error: null, message: ''})
|
||||||
|
},3000)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleSubmit = () => {
|
||||||
|
const reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid'), // USER UID
|
||||||
|
product_id: productData?.product_id,
|
||||||
|
settings : {
|
||||||
|
...fields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log('formInfo', reqData)
|
||||||
|
submitSettings.mutate(reqData)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isCustom === true){
|
||||||
|
return <SiteTemplateSelector name={name} data={data} isCustom={isCustom} productData={productData} />
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="page-account-form">
|
||||||
|
<div className="p-0" style={{ minHeight: '500px'}}>
|
||||||
|
|
||||||
|
<form id='tab_form'>
|
||||||
|
<div className="form-row">
|
||||||
|
<>
|
||||||
|
{Object.entries(data)?.map(([key, value]) => {
|
||||||
|
let fieldName = value.name.toLowerCase().replaceAll(" ", "_")
|
||||||
|
let fieldValue = fields[value.name.toLowerCase().replaceAll(" ", "_")]
|
||||||
|
return (
|
||||||
|
<div key={key} className="form-group col-md-12">
|
||||||
|
<label htmlFor="name1">{value.name}</label>
|
||||||
|
{value.controls == 'TEXT' ?
|
||||||
|
<input name={fieldName} type="text" className="form-control" id={key} value={fieldValue} onChange={handleChange} />
|
||||||
|
:value.controls == 'TEXTAREA' ?
|
||||||
|
<textarea name={fieldName} rows={5} style={{resize: 'none'}} type="text" className="form-control" id={key} value={fieldValue} onChange={handleChange} />
|
||||||
|
: 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 &&
|
||||||
|
<>
|
||||||
|
<div className="col-12">
|
||||||
|
<p className={reqStatus.error ? 'text-danger' : 'text-success'}>{reqStatus.message}</p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
<div className="form-group col-md-12" style={{textAlign:'right'}}>
|
||||||
|
<button onClick={handleSubmit} type="button" className="btn btn-primary" disabled={submitSettings.isPending}>{submitSettings.isPending ? 'Loading...' : 'Update'}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
export default GeneralTab
|
||||||
@@ -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>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
import React, { memo, useMemo, useState } from 'react'
|
||||||
|
import GeneralTab from './GeneralTab'
|
||||||
|
import { getSettingsData } from '../../../services/services';
|
||||||
|
import queryKeys from '../../../services/queryKeys';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
|
||||||
|
const Settings = memo(({productData}) => {
|
||||||
|
|
||||||
|
const { userDetails: { uid }} = useSelector((state) => state?.userDetails); // GETS USER UID
|
||||||
|
|
||||||
|
const dataFields ={
|
||||||
|
site_title: { name: 'Title', controls: 'TEXT', active: true },
|
||||||
|
site_description: { name: 'Description', controls: 'TEXTAREA', active: true },
|
||||||
|
site_logo_text: { name: 'Logo Text', controls: 'TEXT', active: true },
|
||||||
|
site_contact_email: { name: 'Email', controls: 'TEXT', active: true },
|
||||||
|
site_contact_phone: { name: 'Phone', controls: 'TEXT', active: true },
|
||||||
|
}
|
||||||
|
|
||||||
|
const socialFields ={
|
||||||
|
facebook: { name: 'Facebook', controls: 'TEXT', active: true },
|
||||||
|
twitter: { name: 'Twitter', controls: 'TEXT', active: true },
|
||||||
|
youtube: { name: 'Youtube', controls: 'TEXT', active: true },
|
||||||
|
}
|
||||||
|
|
||||||
|
const homeFields ={
|
||||||
|
banner_text: { name: 'Banner Text', controls: 'TEXT', active: true },
|
||||||
|
banner_description: { name: 'Banner Description', controls: 'TEXTAREA', active: true },
|
||||||
|
}
|
||||||
|
|
||||||
|
const footerFields ={
|
||||||
|
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 ={
|
||||||
|
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_2: { name: 'More About us', controls: 'TEXTAREA', active: true },
|
||||||
|
}
|
||||||
|
|
||||||
|
const templateData = {
|
||||||
|
template_16 : { title: 'Template Name-16', template_id: '02af24fd-2b1a-46ed-af21-87018e726408', banner: 'file-icon/svg.png', active: '' },
|
||||||
|
template_22 : { title: 'Template Name-22', template_id: '8b296894-42e4-4f2e-abd1-7c2a38d6e07b', banner: 'file-icon/svg.png', active: '' },
|
||||||
|
template_47 : { title: 'Template Name-47', template_id: 'ef2ffa1c-9272-42cd-9d33-0e614047b4f8', banner: 'file-icon/svg.png', active: '' },
|
||||||
|
template_25 : { title: 'Template Name-25', template_id: 'b3a7ba31-dc47-4a40-a5cc-fd1ff27d6b78', banner: 'file-icon/svg.png', active: '' },
|
||||||
|
template_49 : { title: 'Template Name-49', template_id: '60959c69-6672-4f69-a006-eeb7d210e605', banner: 'file-icon/svg.png', active: '' },
|
||||||
|
template_27 : { title: 'Template Name-27', template_id: 'e4acb98a-c584-45f2-bece-af677dcf0a1f', banner: 'file-icon/svg.png', active: '' },
|
||||||
|
template_51 : { title: 'Template Name-51', template_id: '975ee42e-3169-4978-92d7-d28e7e2ac014', 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(()=>{
|
||||||
|
return {
|
||||||
|
settings: { title: 'Settings', controls: 'settings', active: 'active show' , custom: false, data: dataFields},
|
||||||
|
home_tab: { title: 'Home Page', controls: 'home', active: '', custom: false, data: homeFields},
|
||||||
|
footer_tab: { title: 'Footer', controls: 'footer', active: '', custom: false, data: footerFields },
|
||||||
|
about_tab: { title: 'About Page', controls: 'about', active: '', custom: false, data: aboutFields },
|
||||||
|
contact_tab: { title: 'Contact Page', controls: 'contact', active: '', custom: false, data: contactFields },
|
||||||
|
social_tab: { title: 'Socials', controls: 'social', active: '', custom: false, data: socialFields },
|
||||||
|
template_tab: { title: 'Template', controls: 'template', active: '', custom: true, data: templateData },
|
||||||
|
color_scheme_tab: { title: 'Color Scheme', controls: 'color-scheme', active: '', custom: true, data: {} },
|
||||||
|
};
|
||||||
|
},[])
|
||||||
|
|
||||||
|
|
||||||
|
const [fieldsChanged, setFieldsChanged] = useState(false)
|
||||||
|
|
||||||
|
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({
|
||||||
|
queryKey: queryKeys.settingsData,
|
||||||
|
queryFn: () => {
|
||||||
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid'), // USER UID
|
||||||
|
product_id: productData?.product_id
|
||||||
|
}
|
||||||
|
return getSettingsData(reqData)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const settingsData = data?.data?.settings
|
||||||
|
// console.log('data', settingsData)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{isFetching ?
|
||||||
|
<>
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-mute'>Loading...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
: isError ?
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-danger'>{error.message}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<div className="tab tab-vertical">
|
||||||
|
<ul className="nav nav-tabs" role="tablist">
|
||||||
|
<>
|
||||||
|
{Object.entries(settingsObject).map(([key, value]) => (
|
||||||
|
<li key={key} className="nav-item">
|
||||||
|
<a className={`nav-link ${activeTab == value.controls && 'active show'}`}
|
||||||
|
id={key}
|
||||||
|
// data-bs-toggle="pill"
|
||||||
|
// data-bs-target={`#${value.controls}`}
|
||||||
|
type="button"
|
||||||
|
// role="tab"
|
||||||
|
// aria-controls={value.controls}
|
||||||
|
// aria-selected="true"
|
||||||
|
onClick={()=>handleChangeTab(value.controls)}
|
||||||
|
>
|
||||||
|
{value.title}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
</ul>
|
||||||
|
<div className="tab-content">
|
||||||
|
<>
|
||||||
|
{Object.entries(settingsObject).map(([key, value]) => (
|
||||||
|
<div key={key} className={`tab-pane fade ${activeTab == value.controls && 'active show'}`}
|
||||||
|
// id={value.controls} role="tabpanel"
|
||||||
|
// aria-labelledby={key}
|
||||||
|
>
|
||||||
|
<GeneralTab name={value.title} data={value.data} isCustom={value.custom} productData={productData} backendValues={settingsData} setFieldsChanged={setFieldsChanged} />
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export default Settings
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import React, {memo} from 'react'
|
||||||
|
import getImage from "../../../utils/getImage";
|
||||||
|
|
||||||
|
const SiteTemplateSelector = memo(({name='Full Name', data}) =>{
|
||||||
|
console.log("Page data == ", data)
|
||||||
|
return (
|
||||||
|
<div className="page-account-form">
|
||||||
|
<div className="p-0">
|
||||||
|
<div className="row">
|
||||||
|
<>
|
||||||
|
{Object.entries(data)?.map(([key, value]) => (
|
||||||
|
<div key={key} className="col-xl-6 col-sm-6">
|
||||||
|
<div className="card card-statistics">
|
||||||
|
<div className="card-body">
|
||||||
|
<div className="text-center p-2">
|
||||||
|
<div className="mb-2">
|
||||||
|
<img src={getImage(value.banner)} alt={value.title} />
|
||||||
|
</div>
|
||||||
|
<h4 className="mb-0">{value.title}</h4>
|
||||||
|
<a href="javascript:void(0)" className="btn btn-light">Activate</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
export default SiteTemplateSelector
|
||||||
@@ -0,0 +1,177 @@
|
|||||||
|
import React, { useEffect, useState } 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, useQuery } from "@tanstack/react-query";
|
||||||
|
import getImage from "../../utils/getImage";
|
||||||
|
import { IoMdArrowDropdown } from "react-icons/io";
|
||||||
|
import { completeProfile, getCommonPractice } from '../../services/services';
|
||||||
|
|
||||||
|
|
||||||
|
const validationSchema = Yup.object().shape({
|
||||||
|
practice: Yup.string().required("Required"),
|
||||||
|
specialization: Yup.string().required("Required"),
|
||||||
|
introduction: Yup.string().min(1, "Minimum 10 characters").max(50, "Maximum 50 characters").required("Required"),
|
||||||
|
})
|
||||||
|
|
||||||
|
const initialValues = {
|
||||||
|
practice: '',
|
||||||
|
specialization: '',
|
||||||
|
introduction: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default function ProfileCompleteCom(){
|
||||||
|
|
||||||
|
const [practices, setPractices] = useState({practice: [], specialization: []})
|
||||||
|
|
||||||
|
const {state:{profile_completed}} = useLocation()
|
||||||
|
|
||||||
|
const mutation = useMutation({
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return completeProfile(fields)
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
console.log('res', res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleCompleteProfile = (values, helpers) => {
|
||||||
|
// helpers.resetForm()
|
||||||
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid'), // USER UID
|
||||||
|
// ...values
|
||||||
|
}
|
||||||
|
console.log('values', values, helpers)
|
||||||
|
// mutation.mutate(reqData)
|
||||||
|
}
|
||||||
|
|
||||||
|
const commonPractices = useMutation({ // FUNCTION TO GET COMMON PRACTICES
|
||||||
|
mutationFn: (fields) => {
|
||||||
|
return getCommonPractice(fields)
|
||||||
|
},
|
||||||
|
onError: ()=> {
|
||||||
|
setPractices({practice: [], specialization: []})
|
||||||
|
},
|
||||||
|
onSuccess: (res) => {
|
||||||
|
let returnPractices = []
|
||||||
|
let returnSpecialization = []
|
||||||
|
setPractices(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
let reqData = {
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
|
commonPractices.mutate(reqData)
|
||||||
|
},[])
|
||||||
|
|
||||||
|
console.log('practices', practices)
|
||||||
|
|
||||||
|
return <>
|
||||||
|
|
||||||
|
<BreadcrumbComBS title='Update Profile' paths={['Dashboard', 'Profile']} />
|
||||||
|
|
||||||
|
{commonPractices?.isFetching ?
|
||||||
|
<>
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-mute'>Loading...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
: commonPractices?.isError ?
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-12">
|
||||||
|
<p className='text-danger'>{commonPractices?.error?.message}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<div className="row pt-1">
|
||||||
|
<div className="col-md-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='h-100 row flex-column'>
|
||||||
|
{/* <div className="row"> */}
|
||||||
|
<>
|
||||||
|
<div className="">
|
||||||
|
<div className="form-group position-relative">
|
||||||
|
<label className={`text-black fw-bold control-label ${(props.errors.practice && props.touched.practice) && 'text-danger'}`}>Practice :</label>
|
||||||
|
<div className="position-relative">
|
||||||
|
<select onChange={props.handleChange} name='practice' value={props.values.practice} className="form-control">
|
||||||
|
<option value=''>Select</option>
|
||||||
|
<option value='engineering'>Engineering</option>
|
||||||
|
</select>
|
||||||
|
<IoMdArrowDropdown className='position-absolute w-auto' style={{top: '50%', right: '2px', transform: 'translateY(-50%)'}} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="">
|
||||||
|
<div className="form-group">
|
||||||
|
<label className={`text-black fw-bold control-label ${(props.errors.specialization && props.touched.specialization) && 'text-danger'}`}>Specialization :</label>
|
||||||
|
<div className="position-relative">
|
||||||
|
<select onChange={props.handleChange} name='specialization' value={props.values.specialization} className="form-control">
|
||||||
|
<option value=''>Select</option>
|
||||||
|
<option value='construction'>Construction</option>
|
||||||
|
</select>
|
||||||
|
<IoMdArrowDropdown className='position-absolute w-auto' style={{top: '50%', right: '2px', transform: 'translateY(-50%)'}} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="">
|
||||||
|
<div className="form-group position-relative">
|
||||||
|
<label className={`text-black fw-bold control-label ${(props.errors.introduction && props.touched.introduction) && 'text-danger'}`}>General Information :</label>
|
||||||
|
<textarea name='introduction' rows={10} style={{resize: 'none'}} className="form-control" value={props.values.introduction} onChange={props.handleChange} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{/* {(mutation.isError || mutation.isSuccess) &&
|
||||||
|
<>
|
||||||
|
<div className="col-12">
|
||||||
|
<p className={`${mutation.isSuccess ? 'text-success' : 'text-danger'}`}>{mutation.isSuccess ? 'Completed successfully' : mutation.error.message}</p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
} */}
|
||||||
|
|
||||||
|
<div className="mt-auto text-end">
|
||||||
|
<button type='submit' className="btn btn-primary text-uppercase">{false ? 'loading...' : 'Continue'}</button>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
{/* </div> */}
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Formik>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="col-md-6 m-b-30">
|
||||||
|
<div className="text-center img-block left-column wow fadeInRight">
|
||||||
|
<img className="img-fluid" src={getImage('img-07.png')} alt="content-image" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</>;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@ export default function Settings(){
|
|||||||
<div className="row account-contant">
|
<div className="row account-contant">
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<div className="card card-statistics">
|
<div className="card card-statistics">
|
||||||
<div className="card-body p-0">
|
<div className="card-body p-0" style={{backgroundColor:"#f9f9fb"}}>
|
||||||
<div className="row no-gutters">
|
<div className="row no-gutters">
|
||||||
<div className="col-xl-3 pb-xl-0 pb-5 border-right">
|
<div className="col-xl-3 pb-xl-0 pb-5 border-right">
|
||||||
<div className="page-account-profil pt-5">
|
<div className="page-account-profil pt-5">
|
||||||
@@ -62,9 +62,9 @@ export default function Settings(){
|
|||||||
<button className="btn btn-light text-primary mb-2">Upload New Avatar
|
<button className="btn btn-light text-primary mb-2">Upload New Avatar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
{/*<div>*/}
|
||||||
<button className="btn btn-danger">Delete</button>
|
{/* <button className="btn btn-danger">Delete</button>*/}
|
||||||
</div>
|
{/*</div>*/}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -77,15 +77,25 @@ export default function Settings(){
|
|||||||
<form>
|
<form>
|
||||||
<div className="form-row">
|
<div className="form-row">
|
||||||
<div className="form-group col-md-12">
|
<div className="form-group col-md-12">
|
||||||
<label htmlFor="name1">Full Name</label>
|
<label htmlFor="name1">First Name</label>
|
||||||
<input type="text" className="form-control" id="name1"
|
<input type="text" className="form-control" id="name1"
|
||||||
value="Alice Williams" />
|
value="Alice" />
|
||||||
</div>
|
</div>
|
||||||
<div className="form-group col-md-12">
|
<div className="form-group col-md-12">
|
||||||
<label htmlFor="title1">Title</label>
|
<label htmlFor="name1">Last Name</label>
|
||||||
<input type="text" className="form-control" id="title1"
|
<input type="text" className="form-control" id="name1"
|
||||||
value="Marketing expert" />
|
value="Williams" />
|
||||||
</div>
|
</div>
|
||||||
|
<div className="form-group col-md-12">
|
||||||
|
<label htmlFor="name1">Account Name</label>
|
||||||
|
<input type="text" className="form-control" id="name1"
|
||||||
|
value="This is the best hospital name" />
|
||||||
|
</div>
|
||||||
|
{/*<div className="form-group col-md-12">*/}
|
||||||
|
{/* <label htmlFor="title1">Email</label>*/}
|
||||||
|
{/* <input type="text" className="form-control" id="title1"*/}
|
||||||
|
{/* value="email@email.com" />*/}
|
||||||
|
{/*</div>*/}
|
||||||
<div className="form-group col-md-12">
|
<div className="form-group col-md-12">
|
||||||
<label htmlFor="phone1">Phone Number</label>
|
<label htmlFor="phone1">Phone Number</label>
|
||||||
<input type="text" className="form-control" id="phone1"
|
<input type="text" className="form-control" id="phone1"
|
||||||
@@ -108,135 +118,47 @@ export default function Settings(){
|
|||||||
value="1234 North Avenue Luke Lane, South Bend, IN 360001" />
|
value="1234 North Avenue Luke Lane, South Bend, IN 360001" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="form-row">
|
{/*<div className="form-row">*/}
|
||||||
<div className="col-12">
|
{/* <div className="form-group col-md-4">*/}
|
||||||
<label className="mb-1">Birthday</label>
|
{/* <label htmlFor="inputState3">City</label>*/}
|
||||||
</div>
|
{/* <select id="inputState3" className="form-control">*/}
|
||||||
<div className="form-group col-md-4">
|
{/* <option>Choose...</option>*/}
|
||||||
<select id="inputState" className="form-control">
|
{/* <option selected="">London</option>*/}
|
||||||
<option>Date</option>
|
{/* <option>Montreal</option>*/}
|
||||||
<option>01</option>
|
{/* <option>Delhi</option>*/}
|
||||||
<option>02</option>
|
{/* <option>Tokyo</option>*/}
|
||||||
<option>03</option>
|
{/* </select>*/}
|
||||||
<option>04</option>
|
{/* </div>*/}
|
||||||
<option>05</option>
|
{/* <div className="form-group col-md-4">*/}
|
||||||
<option>06</option>
|
{/* <label htmlFor="inputState4">State</label>*/}
|
||||||
<option>07</option>
|
{/* <select id="inputState4" className="form-control">*/}
|
||||||
<option>08</option>
|
{/* <option>Choose...</option>*/}
|
||||||
<option>09</option>
|
{/* <option selected="">England</option>*/}
|
||||||
<option>10</option>
|
{/* <option>California</option>*/}
|
||||||
<option selected="">11</option>
|
{/* <option>Texas</option>*/}
|
||||||
<option>12</option>
|
{/* <option>Scotland</option>*/}
|
||||||
<option>13</option>
|
{/* </select>*/}
|
||||||
<option>14</option>
|
{/* </div>*/}
|
||||||
<option>15</option>
|
{/* <div className="form-group col-md-4">*/}
|
||||||
<option>16</option>
|
{/* <label htmlFor="inputZip">Zip</label>*/}
|
||||||
<option>17</option>
|
{/* <input type="text" className="form-control" id="inputZip"*/}
|
||||||
<option>18</option>
|
{/* value="EC1A 1BB" />*/}
|
||||||
<option>19</option>
|
{/* </div>*/}
|
||||||
<option>20</option>
|
{/*</div>*/}
|
||||||
<option>21</option>
|
{/*<div className="form-group">*/}
|
||||||
<option>22</option>
|
{/* <div className="form-check">*/}
|
||||||
<option>23</option>
|
{/* <input className="form-check-input" type="checkbox"*/}
|
||||||
<option>24</option>
|
{/* id="gridCheck" />*/}
|
||||||
<option>25</option>
|
{/* <label className="form-check-label" htmlFor="gridCheck">*/}
|
||||||
<option>26</option>
|
{/* I agree to receive email notification.*/}
|
||||||
<option>27</option>
|
{/* </label>*/}
|
||||||
<option>28</option>
|
{/* </div>*/}
|
||||||
<option>29</option>
|
{/*</div>*/}
|
||||||
<option>30</option>
|
<div style={{textAlign:"right"}}>
|
||||||
<option>31</option>
|
<button type="submit" className="btn btn-primary">Update Profile
|
||||||
</select>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="form-group col-md-4">
|
|
||||||
<select id="inputState1" className="form-control">
|
|
||||||
<option>Month</option>
|
|
||||||
<option>January</option>
|
|
||||||
<option>February</option>
|
|
||||||
<option>March</option>
|
|
||||||
<option>April</option>
|
|
||||||
<option selected="">May</option>
|
|
||||||
<option>June</option>
|
|
||||||
<option>July</option>
|
|
||||||
<option>August</option>
|
|
||||||
<option>September</option>
|
|
||||||
<option>October</option>
|
|
||||||
<option>November</option>
|
|
||||||
<option>December</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-group col-md-4">
|
|
||||||
<select id="inputState2" className="form-control">
|
|
||||||
<option>Year</option>
|
|
||||||
<option>1984</option>
|
|
||||||
<option>1985</option>
|
|
||||||
<option>1986</option>
|
|
||||||
<option>1987</option>
|
|
||||||
<option>1988</option>
|
|
||||||
<option>1989</option>
|
|
||||||
<option>1990</option>
|
|
||||||
<option>1991</option>
|
|
||||||
<option>1992</option>
|
|
||||||
<option>1993</option>
|
|
||||||
<option selected="">1994</option>
|
|
||||||
<option>1995</option>
|
|
||||||
<option>1996</option>
|
|
||||||
<option>1997</option>
|
|
||||||
<option>1998</option>
|
|
||||||
<option>1999</option>
|
|
||||||
<option>2000</option>
|
|
||||||
<option>2001</option>
|
|
||||||
<option>2002</option>
|
|
||||||
<option>2003</option>
|
|
||||||
<option>2004</option>
|
|
||||||
<option>2005</option>
|
|
||||||
<option>2006</option>
|
|
||||||
<option>2007</option>
|
|
||||||
<option>2008</option>
|
|
||||||
<option>2009</option>
|
|
||||||
<option>2010</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="form-row">
|
|
||||||
<div className="form-group col-md-4">
|
|
||||||
<label htmlFor="inputState3">City</label>
|
|
||||||
<select id="inputState3" className="form-control">
|
|
||||||
<option>Choose...</option>
|
|
||||||
<option selected="">London</option>
|
|
||||||
<option>Montreal</option>
|
|
||||||
<option>Delhi</option>
|
|
||||||
<option>Tokyo</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div className="form-group col-md-4">
|
|
||||||
<label htmlFor="inputState4">State</label>
|
|
||||||
<select id="inputState4" className="form-control">
|
|
||||||
<option>Choose...</option>
|
|
||||||
<option selected="">England</option>
|
|
||||||
<option>California</option>
|
|
||||||
<option>Texas</option>
|
|
||||||
<option>Scotland</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div className="form-group col-md-4">
|
|
||||||
<label htmlFor="inputZip">Zip</label>
|
|
||||||
<input type="text" className="form-control" id="inputZip"
|
|
||||||
value="EC1A 1BB" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="form-group">
|
|
||||||
<div className="form-check">
|
|
||||||
<input className="form-check-input" type="checkbox"
|
|
||||||
id="gridCheck" />
|
|
||||||
<label className="form-check-label" htmlFor="gridCheck">
|
|
||||||
I agree to receive email notification.
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button type="submit" className="btn btn-primary">Update Information
|
|
||||||
</button>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -282,7 +204,10 @@ export default function Settings(){
|
|||||||
<input type="text" className="form-control" id="we"
|
<input type="text" className="form-control" id="we"
|
||||||
value="https://yourwebsite.com" />
|
value="https://yourwebsite.com" />
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" className="btn btn-primary">Save & Update</button>
|
<div style={{textAlign:"right"}}>
|
||||||
|
<button type="submit" className="btn btn-primary">Update Links</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
|
||||||
|
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() {
|
||||||
|
|
||||||
|
const pricingFields ={
|
||||||
|
starter: { name: 'Starter', price: 5.99, active: true },
|
||||||
|
basic: { name: 'Basic', price: 12.99, 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 (
|
||||||
|
<>
|
||||||
|
<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="col-12 col-lg-6 col-xl-3">
|
||||||
|
<div className="card card-statistics text-center py-3">
|
||||||
|
<div className="card-body pricing-content">
|
||||||
|
<div className="pricing-content-card">
|
||||||
|
<h5>Current Subscription(s)</h5>
|
||||||
|
<h2 className="text-primary pt-3">{currentSubscription?.display_name}</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<>
|
||||||
|
{Object.entries(otherSubscriptions)?.map(([key, value]) => (
|
||||||
|
|
||||||
|
<div key={key} className="col-12 col-lg-6 col-xl-3">
|
||||||
|
<div className="card card-statistics text-center py-3">
|
||||||
|
<div className="card-body pricing-content">
|
||||||
|
<div className="pricing-content-card">
|
||||||
|
<h5>{value.display_name}</h5>
|
||||||
|
<h2 className="text-primary pt-3">${value.monthly}</h2>
|
||||||
|
<p className="text-primary pb-3">/ Monthly</p>
|
||||||
|
<ul className="py-2">
|
||||||
|
{value?.items?.map(item =>(
|
||||||
|
<li key={item}>{item}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
<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>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -53,172 +53,172 @@ export default function Users(){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-xxl-3 col-xl-4 col-sm-6">
|
{/*<div className="col-xxl-3 col-xl-4 col-sm-6">*/}
|
||||||
<div className="card card-statistics contact-contant">
|
{/* <div className="card card-statistics contact-contant">*/}
|
||||||
<div className="card-body py-4">
|
{/* <div className="card-body py-4">*/}
|
||||||
<div className="d-flex align-items-center">
|
{/* <div className="d-flex align-items-center">*/}
|
||||||
<div className="bg-img">
|
{/* <div className="bg-img">*/}
|
||||||
<img src="assets/img/avtar/02.jpg" alt="" className="img-fluid" />
|
{/* <img src="assets/img/avtar/02.jpg" alt="" className="img-fluid" />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div className="ml-3">
|
{/* <div className="ml-3">*/}
|
||||||
<h4 className="mb-0">Samuel Woods</h4>
|
{/* <h4 className="mb-0">Samuel Woods</h4>*/}
|
||||||
<p><span className="badge badge-success-inverse px-2 py-1 mt-1">Friends</span></p>
|
{/* <p><span className="badge badge-success-inverse px-2 py-1 mt-1">Friends</span></p>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div>
|
{/* <div>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon">
|
{/* <div className="img-icon">*/}
|
||||||
<div className="img-icon"><i className="fa fa-mobile"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-mobile"></i></div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>026-123-8546</p>
|
{/* <p>026-123-8546</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-phone"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-phone"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>80-1230-8546</p>
|
{/* <p>80-1230-8546</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-envelope-o"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-envelope-o"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>Samuel.Woods@gmail.com</p>
|
{/* <p>Samuel.Woods@gmail.com</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/*</div>*/}
|
||||||
<div className="col-xxl-3 col-xl-4 col-sm-6">
|
{/*<div className="col-xxl-3 col-xl-4 col-sm-6">*/}
|
||||||
<div className="card card-statistics contact-contant">
|
{/* <div className="card card-statistics contact-contant">*/}
|
||||||
<div className="card-body py-4">
|
{/* <div className="card-body py-4">*/}
|
||||||
<div className="d-flex align-items-center">
|
{/* <div className="d-flex align-items-center">*/}
|
||||||
<div className="bg-img">
|
{/* <div className="bg-img">*/}
|
||||||
<img src="assets/img/avtar/03.jpg" alt="" className="img-fluid" />
|
{/* <img src="assets/img/avtar/03.jpg" alt="" className="img-fluid" />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div className="ml-3">
|
{/* <div className="ml-3">*/}
|
||||||
<h4 className="mb-0">Garettdon</h4>
|
{/* <h4 className="mb-0">Garettdon</h4>*/}
|
||||||
<p><span className="badge badge-primary-inverse px-2 py-1 mt-1">Office</span></p>
|
{/* <p><span className="badge badge-primary-inverse px-2 py-1 mt-1">Office</span></p>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div>
|
{/* <div>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-mobile"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-mobile"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>026-123-8546</p>
|
{/* <p>026-123-8546</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-phone"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-phone"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>80-1230-8546</p>
|
{/* <p>80-1230-8546</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-envelope-o"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-envelope-o"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>Garettdon@gmail.com</p>
|
{/* <p>Garettdon@gmail.com</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/*</div>*/}
|
||||||
<div className="col-xxl-3 col-xl-4 col-sm-6">
|
{/*<div className="col-xxl-3 col-xl-4 col-sm-6">*/}
|
||||||
<div className="card card-statistics contact-contant">
|
{/* <div className="card card-statistics contact-contant">*/}
|
||||||
<div className="card-body py-4">
|
{/* <div className="card-body py-4">*/}
|
||||||
<div className="d-flex align-items-center">
|
{/* <div className="d-flex align-items-center">*/}
|
||||||
<div className="bg-img">
|
{/* <div className="bg-img">*/}
|
||||||
<img src="assets/img/avtar/04.jpg" alt="" className="img-fluid" />
|
{/* <img src="assets/img/avtar/04.jpg" alt="" className="img-fluid" />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div className="ml-3">
|
{/* <div className="ml-3">*/}
|
||||||
<h4 className="mb-0">Garynice</h4>
|
{/* <h4 className="mb-0">Garynice</h4>*/}
|
||||||
<p><span className="badge badge-warning-inverse px-2 py-1 mt-1">Home</span></p>
|
{/* <p><span className="badge badge-warning-inverse px-2 py-1 mt-1">Home</span></p>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div>
|
{/* <div>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-mobile"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-mobile"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>026-123-8546</p>
|
{/* <p>026-123-8546</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-phone"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-phone"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>80-1230-8546</p>
|
{/* <p>80-1230-8546</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-envelope-o"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-envelope-o"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>Garynice@gmail.com</p>
|
{/* <p>Garynice@gmail.com</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/*</div>*/}
|
||||||
<div className="col-xxl-3 col-xl-4 col-sm-6">
|
{/*<div className="col-xxl-3 col-xl-4 col-sm-6">*/}
|
||||||
<div className="card card-statistics contact-contant">
|
{/* <div className="card card-statistics contact-contant">*/}
|
||||||
<div className="card-body py-4">
|
{/* <div className="card-body py-4">*/}
|
||||||
<div className="d-flex align-items-center">
|
{/* <div className="d-flex align-items-center">*/}
|
||||||
<div className="bg-img">
|
{/* <div className="bg-img">*/}
|
||||||
<img src="assets/img/avtar/05.jpg" alt="" className="img-fluid" />
|
{/* <img src="assets/img/avtar/05.jpg" alt="" className="img-fluid" />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div className="ml-3">
|
{/* <div className="ml-3">*/}
|
||||||
<h4 className="mb-0">Andrew nico</h4>
|
{/* <h4 className="mb-0">Andrew nico</h4>*/}
|
||||||
<p><span className="badge badge-success-inverse px-2 py-1 mt-1">Friends</span></p>
|
{/* <p><span className="badge badge-success-inverse px-2 py-1 mt-1">Friends</span></p>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div>
|
{/* <div>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-mobile"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-mobile"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>026-123-8546</p>
|
{/* <p>026-123-8546</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-phone"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-phone"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>80-1230-8546</p>
|
{/* <p>80-1230-8546</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
<ul className="nav">
|
{/* <ul className="nav">*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<div className="img-icon"><i className="fa fa-envelope-o"></i></div>
|
{/* <div className="img-icon"><i className="fa fa-envelope-o"></i></div>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
<li className="nav-item">
|
{/* <li className="nav-item">*/}
|
||||||
<p>Andrew.nico@gmail.com</p>
|
{/* <p>Andrew.nico@gmail.com</p>*/}
|
||||||
</li>
|
{/* </li>*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/*</div>*/}
|
||||||
<div className="col-xxl-3 col-xl-4 col-sm-6">
|
<div className="col-xxl-3 col-xl-4 col-sm-6">
|
||||||
<div className="card card-statistics contact-contant">
|
<div className="card card-statistics contact-contant">
|
||||||
<div className="card-body py-4">
|
<div className="card-body py-4">
|
||||||
|
|||||||
@@ -31,13 +31,14 @@
|
|||||||
.fc-event {
|
.fc-event {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
border: none;
|
border: none;
|
||||||
cursor: move;
|
// cursor: move;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
margin: 5px 0px;
|
margin: 5px 0px;
|
||||||
padding: 10px 10px 10px 40px;
|
padding: 10px 10px 10px 40px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
position:relative;
|
position:relative;
|
||||||
&:before {
|
&:before {
|
||||||
|
display: none;
|
||||||
content:'';
|
content:'';
|
||||||
position:absolute;
|
position:absolute;
|
||||||
width:15px;
|
width:15px;
|
||||||
@@ -49,6 +50,9 @@
|
|||||||
&-primary {
|
&-primary {
|
||||||
@include hex-rgba($primary, 0.2);
|
@include hex-rgba($primary, 0.2);
|
||||||
color:$primary;
|
color:$primary;
|
||||||
|
& label {
|
||||||
|
color:$primary;
|
||||||
|
}
|
||||||
&:before {
|
&:before {
|
||||||
@include hex-rgba($primary, 0.8);
|
@include hex-rgba($primary, 0.8);
|
||||||
}
|
}
|
||||||
@@ -59,6 +63,9 @@
|
|||||||
&-warning {
|
&-warning {
|
||||||
@include hex-rgba($warning, 0.2);
|
@include hex-rgba($warning, 0.2);
|
||||||
color:$warning;
|
color:$warning;
|
||||||
|
& label {
|
||||||
|
color:$warning;
|
||||||
|
}
|
||||||
&:before {
|
&:before {
|
||||||
@include hex-rgba($warning, 0.8);
|
@include hex-rgba($warning, 0.8);
|
||||||
}
|
}
|
||||||
@@ -69,6 +76,9 @@
|
|||||||
&-danger {
|
&-danger {
|
||||||
@include hex-rgba($danger, 0.2);
|
@include hex-rgba($danger, 0.2);
|
||||||
color:$danger;
|
color:$danger;
|
||||||
|
& label {
|
||||||
|
color:$danger;
|
||||||
|
}
|
||||||
&:before {
|
&:before {
|
||||||
@include hex-rgba($danger, 0.8);
|
@include hex-rgba($danger, 0.8);
|
||||||
}
|
}
|
||||||
@@ -79,6 +89,9 @@
|
|||||||
&-success {
|
&-success {
|
||||||
@include hex-rgba($success, 0.2);
|
@include hex-rgba($success, 0.2);
|
||||||
color:$success;
|
color:$success;
|
||||||
|
& label {
|
||||||
|
color:$success;
|
||||||
|
}
|
||||||
&:before {
|
&:before {
|
||||||
@include hex-rgba($success, 0.8);
|
@include hex-rgba($success, 0.8);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
}
|
}
|
||||||
.mail-msg{
|
.mail-msg{
|
||||||
max-height: 747px;
|
max-height: 747px;
|
||||||
overflow: hidden;
|
overflow-y: auto;
|
||||||
outline: none;
|
outline: none;
|
||||||
@include laptop {
|
@include laptop {
|
||||||
max-height: 450px;
|
max-height: 450px;
|
||||||
@@ -85,7 +85,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mail-contant .mail-f{
|
.mail-contant .mail-f{
|
||||||
position: absolute;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
@include desktop {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
@include desktop-lg {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -588,11 +588,16 @@
|
|||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.show + .dropdown-menu{
|
.show{
|
||||||
margin-top: 0;
|
margin-top: 0!important;
|
||||||
visibility: visible;
|
visibility: visible!important;
|
||||||
opacity: 1;
|
opacity: 1!important;
|
||||||
}
|
}
|
||||||
|
// .show + .dropdown-menu{
|
||||||
|
// margin-top: 0;
|
||||||
|
// visibility: visible;
|
||||||
|
// opacity: 1;
|
||||||
|
// }
|
||||||
// .show {
|
// .show {
|
||||||
// .dropdown-menu{
|
// .dropdown-menu{
|
||||||
// margin-top: 0;
|
// margin-top: 0;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ body {
|
|||||||
outline:0;
|
outline:0;
|
||||||
background:$body;
|
background:$body;
|
||||||
color:$muted;
|
color:$muted;
|
||||||
|
font-weight: $font-regular;
|
||||||
&.sidebar-mini {
|
&.sidebar-mini {
|
||||||
.app-main {
|
.app-main {
|
||||||
padding-left:$sidebar-mini;
|
padding-left:$sidebar-mini;
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ h6 {
|
|||||||
|
|
||||||
p {
|
p {
|
||||||
color: $muted;
|
color: $muted;
|
||||||
font-weight: $font-regular;
|
font-size: $font-18;
|
||||||
font-size: $font-base;
|
|
||||||
line-height: $line-md;
|
line-height: $line-md;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
|
|||||||
@@ -35,13 +35,13 @@ $container-max-widths: (
|
|||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
$body : #f9f9fb;
|
$body : #f9f9fb;
|
||||||
$primary : #8E54E9;
|
$primary : #148399; //#8E54E9;
|
||||||
$primary2 : #4776E6;
|
$primary2 : #4776E6;
|
||||||
$secondary : #a1a1a1;
|
$secondary : #a1a1a1;
|
||||||
$light-gray : #eceef3;
|
$light-gray : #eceef3;
|
||||||
$dark-gray : #2c2e3e;
|
$dark-gray : #2c2e3e;
|
||||||
$darker-gray : #333333;
|
$darker-gray : #333333;
|
||||||
$muted : #a6a9b7;
|
$muted : #6c757d; //#a6a9b7;
|
||||||
$info : #45aaf2;
|
$info : #45aaf2;
|
||||||
$danger : #e3324c;
|
$danger : #e3324c;
|
||||||
$cyan : #2bcbba;
|
$cyan : #2bcbba;
|
||||||
@@ -75,7 +75,7 @@ $behance : #053eff;
|
|||||||
$whatsapp : #4FCE5D;
|
$whatsapp : #4FCE5D;
|
||||||
|
|
||||||
// Font family
|
// Font family
|
||||||
$font-primary : 'Roboto', sans-serif;
|
$font-primary : 'Plus Jakarta Sans', sans-serif;
|
||||||
|
|
||||||
//Font size
|
//Font size
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,18 @@ $today-highlight-bg: #fcf8e3;
|
|||||||
$btn-bg: #8e54e9;
|
$btn-bg: #8e54e9;
|
||||||
$btn-border: #8e54e9;
|
$btn-border: #8e54e9;
|
||||||
$event-padding: 10px;
|
$event-padding: 10px;
|
||||||
|
.manage{
|
||||||
|
background-color:lightgreen !important;
|
||||||
|
border-radius: 5px !important;
|
||||||
|
}
|
||||||
|
.creating{
|
||||||
|
background-color: lightyellow !important;
|
||||||
|
border-radius: 5px !important;
|
||||||
|
}
|
||||||
|
.billing{
|
||||||
|
background-color: darkgoldenrod;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
.extraProductCard{
|
.extraProductCard{
|
||||||
background-color: aliceblue;
|
background-color: aliceblue;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
@@ -138,14 +149,28 @@ $event-padding: 10px;
|
|||||||
|
|
||||||
.fc-today-button.fc-button,
|
.fc-today-button.fc-button,
|
||||||
.fc-timeGridWeek-button.fc-button-active, .fc-timeGridDay-button.fc-button-active, .fc-dayGridMonth-button.fc-button-active{
|
.fc-timeGridWeek-button.fc-button-active, .fc-timeGridDay-button.fc-button-active, .fc-dayGridMonth-button.fc-button-active{
|
||||||
color: #fff!important;
|
color: #fff !important;
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #8E54E9!important;
|
background-color: #8E54E9 !important;
|
||||||
text-transform: capitalize !important;
|
text-transform: capitalize !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fc-h-event,
|
||||||
.fc-event.fc-event-draggable.fc-event-start.fc-event-end.fc-daygrid-event,
|
.fc-event.fc-event-draggable.fc-event-start.fc-event-end.fc-daygrid-event,
|
||||||
.fc-event.fc-event-draggable.fc-event-start.fc-event-end.fc-daygrid-event{
|
.fc-event.fc-event-draggable.fc-event-start.fc-event-end.fc-daygrid-event{
|
||||||
padding: 10px 2px !important;
|
padding: 10px 2px !important;
|
||||||
|
background-color: #3788d8 !important;
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fc-theme-standard .fc-popover{
|
||||||
|
overflow-y: auto !important;
|
||||||
|
// height: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc .fc-more-popover .fc-popover-body {
|
||||||
|
overflow-y: auto;
|
||||||
|
height: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* END OF CALENDER STYLE */
|
/* END OF CALENDER STYLE */
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
// import './index.css';
|
// import './index.css';
|
||||||
import { Provider } from 'react-redux';
|
// import { Provider } from 'react-redux';
|
||||||
|
// import store from './store/store'
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
import store from './store/store'
|
|
||||||
|
|
||||||
import App from './App';
|
import App from './App';
|
||||||
//import reportWebVitals from './reportWebVitals';
|
//import reportWebVitals from './reportWebVitals';
|
||||||
@@ -17,9 +17,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'));
|
|||||||
root.render(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Provider store={store}>
|
<App />
|
||||||
<App />
|
|
||||||
</Provider>
|
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,18 +1,23 @@
|
|||||||
const siteLinks = {
|
const siteLinks = {
|
||||||
error: '*',
|
error: '*',
|
||||||
|
help: '/help',
|
||||||
home: '/',
|
home: '/',
|
||||||
dash: '/dash',
|
dash: '/dash',
|
||||||
|
profile_complete: '/profile-complete',
|
||||||
product: '/product/*',
|
product: '/product/*',
|
||||||
contacts: '/contacts',
|
contacts: '/contacts',
|
||||||
comments: '/comments',
|
comments: '/comments',
|
||||||
reports: '/reports',
|
reports: '/reports',
|
||||||
|
subscription: '/subscription',
|
||||||
|
onboard: '/subscription',
|
||||||
user: '/user',
|
user: '/user',
|
||||||
calendar: '/calendar',
|
calendar: '/calendar',
|
||||||
settings: '/settings',
|
settings: '/settings',
|
||||||
login: '/auth/login',
|
login: '/auth/login',
|
||||||
signup: '/auth/signup',
|
signup: '/auth/signup',
|
||||||
forgetpwd: '/auth/forgetpwd',
|
forgetpwd: '/auth/forgetpwd',
|
||||||
csignup: '/csignup/:jwt'
|
csignup: '/csignup/:jwt',
|
||||||
|
accreset: '/accreset/:token'
|
||||||
}
|
}
|
||||||
|
|
||||||
export default siteLinks
|
export default siteLinks
|
||||||
@@ -1,10 +1,17 @@
|
|||||||
const queryKeys = {
|
const queryKeys = {
|
||||||
|
user_details: ['user_details'],
|
||||||
|
product_url: ['product_url'],
|
||||||
|
products: ['product-data'],
|
||||||
|
myproduct_provision: ['myproduct_provision'],
|
||||||
|
product_page: ['product_page'],
|
||||||
|
recentAction: ['recent-action'],
|
||||||
|
settingsData: ['settings_data'],
|
||||||
|
subscriptions: ['subscriptions'],
|
||||||
|
|
||||||
dashboard: ['dashboard'],
|
dashboard: ['dashboard'],
|
||||||
topBar: ['top-bar'],
|
topBar: ['top-bar'],
|
||||||
recentAction: ['recent-action'],
|
calendar_events: ['calendar_events'],
|
||||||
product: ['product-data'],
|
contacts: ['contacts']
|
||||||
product_url: ['product_url'],
|
|
||||||
myproduct_provision: ['myproduct_provision']
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default queryKeys
|
export default queryKeys
|
||||||
@@ -4,12 +4,13 @@ import axios from "axios"
|
|||||||
axios.interceptors.request.use(
|
axios.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
config.headers = {
|
config.headers = {
|
||||||
// Accept: "application/json",
|
Accept: "application/json",
|
||||||
"Access-Control-Allow-Origin": "*",
|
"Access-Control-Allow-Origin": "*",
|
||||||
// "Access-Control-Expose-Headers": "Access-Control-Allow-Origin",
|
// "Access-Control-Expose-Headers": "Access-Control-Allow-Origin",
|
||||||
// "Access-Control-Allow-Headers": "Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token",
|
// "Access-Control-Allow-Headers": "Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token",
|
||||||
// "Content-Type": "application/json;charset=UTF-8",
|
// "Content-Type": "application/json;charset=UTF-8",
|
||||||
'Authorization': `Bearer ${localStorage.getItem('token')}`
|
'Authorization': (localStorage && localStorage.getItem('access_token')) ? `Bearer ${localStorage.getItem('access_token')}` : '',
|
||||||
|
// 'uuid': 'dummy'
|
||||||
};
|
};
|
||||||
// config.headers['Authorization'] = `Bearer ${localStorage.getItem('token')}`;
|
// config.headers['Authorization'] = `Bearer ${localStorage.getItem('token')}`;
|
||||||
// config.baseURL = process.env.REACT_APP_MAIN_API
|
// config.baseURL = process.env.REACT_APP_MAIN_API
|
||||||
@@ -25,7 +26,7 @@ const postAuxEnd = (path, postData, media=false) => {
|
|||||||
return axios.post(`${basePath}${path}`, postData).then(res => {
|
return axios.post(`${basePath}${path}`, postData).then(res => {
|
||||||
return res
|
return res
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
throw new Error(err.response.data.message);
|
throw new Error(err.response.data.msg);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,20 +43,164 @@ const getAuxEnd = (path, reqData= null) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO AUTHORIZE USER IN
|
||||||
|
export const userToken = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData
|
||||||
|
}
|
||||||
|
return postAuxEnd('/Authorize', postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
// FUNCTION TO LOGIN USER IN
|
// FUNCTION TO LOGIN USER IN
|
||||||
export const loginUser = (reqData) => {
|
export const loginUser = (reqData) => {
|
||||||
let postData = {
|
let postData = {
|
||||||
...reqData
|
...reqData
|
||||||
}
|
}
|
||||||
return postAuxEnd('/panel/auth/login', postData, false)
|
return postAuxEnd('/panel/Login', postData, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET USER INFO DATA
|
||||||
|
export const userInfo = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData
|
||||||
|
}
|
||||||
|
return postAuxEnd('/panel/account', postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET DASHBOARD TOP BAR SECTION
|
||||||
|
export const topBar = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/account/bar`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET PRODUCT BY ID
|
||||||
|
export const MyProductData = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/myproduct/dash`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET CALENDAR EVENTS
|
||||||
|
export const getCalendarEvents = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/account/calendar`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET DASHBOARD PRODUCT DATA SECTION
|
||||||
|
export const contactData = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/contacts`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET DASHBOARD PRODUCT URL DATA SECTION
|
||||||
|
export const productsURL = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/account/products/url`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET DASHBOARD PRODUCT DATA SECTION
|
||||||
|
export const productsData = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/account/products`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO REFRESH SITE
|
||||||
|
export const productRefreshSite = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/account/products/refresh`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET DASHBOARD RECENT ACTIONS SECTION
|
||||||
|
export const recentActions = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
|
//return getAuxEnd(`/panel/account/actions`)
|
||||||
|
return postAuxEnd(`/panel/account/actions`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO VERIFY RESET TOKEN
|
||||||
|
export const verifyResetToken = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData
|
||||||
|
}
|
||||||
|
return postAuxEnd('/panel/auth/resetverify', postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO COMPLETE PASSWORD RESET
|
||||||
|
export const completePWDReset = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData
|
||||||
|
}
|
||||||
|
return postAuxEnd('/panel/auth/resetcomplete', postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO SUBMIT PAGE TAB SETTINGS
|
||||||
|
export const pageSettings = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/myproduct/settings`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET SETTINGS DATA
|
||||||
|
export const getSettingsData = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/myproduct/settings/values`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET PRODUCT SUBSCRIPTIONS
|
||||||
|
export const completeProfile = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/account/startprofile`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO COMPLETE PROFILE
|
||||||
|
export const getSubscriptions = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/subscription/products`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET COMMON PRACTICE
|
||||||
|
export const getCommonPractice = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData,
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/common/practice`, postData, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// FUNCTION TO REGISTER USER
|
// FUNCTION TO REGISTER USER
|
||||||
export const signUpUser = (reqData) => {
|
export const signUpUser = (reqData) => {
|
||||||
let postData = {
|
let postData = {
|
||||||
...reqData
|
...reqData
|
||||||
}
|
}
|
||||||
return postAuxEnd('/panel/auth/register', postData, false)
|
return postAuxEnd('/panel/Register', postData, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION TO VERIFY EMAIL
|
// FUNCTION TO VERIFY EMAIL
|
||||||
@@ -63,7 +208,7 @@ export const verifyEmail = (reqData) => {
|
|||||||
let postData = {
|
let postData = {
|
||||||
...reqData
|
...reqData
|
||||||
}
|
}
|
||||||
return postAuxEnd('/panel/auth/register/verify', postData, false)
|
return postAuxEnd('/panel/Register/verify', postData, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION TO COMPLETE REGISTRATION
|
// FUNCTION TO COMPLETE REGISTRATION
|
||||||
@@ -71,15 +216,17 @@ export const completeRegistration = (reqData) => {
|
|||||||
let postData = {
|
let postData = {
|
||||||
...reqData
|
...reqData
|
||||||
}
|
}
|
||||||
return postAuxEnd('/panel/auth/register/complete', postData, false)
|
return postAuxEnd('/panel/Register/complete', postData, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION TO SUBSCRIBE
|
// FUNCTION TO SUBSCRIBE
|
||||||
export const subscribe = (reqData) => {
|
export const subscribe = (reqData) => {
|
||||||
let postData = {
|
let postData = {
|
||||||
...reqData
|
...reqData,
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
}
|
}
|
||||||
return postAuxEnd('/panel/myproduct/subscription', postData, false)
|
return postAuxEnd(`/panel/myproduct/subscription`, postData, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -91,39 +238,14 @@ export const recoverPWD = (reqData) => {
|
|||||||
return postAuxEnd('/panel/auth/reset', postData, false)
|
return postAuxEnd('/panel/auth/reset', postData, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION TO GET DASHBOARD DATA
|
|
||||||
export const accountDashboard = () => {
|
|
||||||
return getAuxEnd(`/panel/account/dash`)
|
|
||||||
}
|
|
||||||
|
|
||||||
// FUNCTION TO GET DASHBOARD TOP BAR SECTION
|
|
||||||
export const topBar = () => {
|
|
||||||
return getAuxEnd(`/panel/account/bar`)
|
|
||||||
}
|
|
||||||
|
|
||||||
// FUNCTION TO GET DASHBOARD RECENT ACTIONS SECTION
|
|
||||||
export const recentActions = () => {
|
|
||||||
return getAuxEnd(`/panel/account/actions`)
|
|
||||||
}
|
|
||||||
|
|
||||||
// FUNCTION TO GET MY PRODUCT PROVISION DATA
|
// FUNCTION TO GET MY PRODUCT PROVISION DATA
|
||||||
export const productProvision = (productID) => {
|
export const productProvision = (reqData) => {
|
||||||
const reqData = { product_id : productID}
|
let postData = {
|
||||||
return getAuxEnd(`/panel/myproduct/provision`,reqData)
|
...reqData,
|
||||||
|
token: localStorage.getItem('token'), // USER TOKEN
|
||||||
|
uid: localStorage.getItem('uid') // USER UID
|
||||||
|
}
|
||||||
|
return postAuxEnd(`/panel/myproduct/provision`, postData, false)
|
||||||
|
// return getAuxEnd(`/panel/myproduct/provision`, postData)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION TO GET DASHBOARD PRODUCT DATA SECTION
|
|
||||||
export const productData = () => {
|
|
||||||
return getAuxEnd(`/panel/account/products`)
|
|
||||||
}
|
|
||||||
|
|
||||||
// FUNCTION TO GET DASHBOARD PRODUCT URL DATA SECTION
|
|
||||||
export const productsURL = () => {
|
|
||||||
return getAuxEnd(`/panel/account/products/url`)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const MyProductData = (productID) => {
|
|
||||||
const reqData = { product_id : productID}
|
|
||||||
//console.log(reqData)
|
|
||||||
return getAuxEnd(`/panel/myproduct/dash`,reqData)
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
function getCustomTime(dateStr) {
|
||||||
|
let date = new Date(dateStr);
|
||||||
|
|
||||||
|
if(isNaN(date)){
|
||||||
|
return '00:00'
|
||||||
|
}
|
||||||
|
const hours = date.getHours()
|
||||||
|
const minutes = date.getMinutes()
|
||||||
|
|
||||||
|
return `${hours}:${minutes} ${hours >= 12 ? 'PM' : 'AM'}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export default getCustomTime
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
let getImage = (location) => {
|
let getImage = (location) => {
|
||||||
if (!location) {
|
if (!location) {
|
||||||
return require(`../assets/img/logo.png`);
|
return require(`../assets/img/logo-pink.png`);
|
||||||
} else {
|
} else {
|
||||||
return require(`../assets/img/${location}`);
|
return require(`../assets/img/${location}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import AccPWDReset from '../component/auth/AccPWDReset'
|
||||||
|
|
||||||
|
export default function AccPWDResetPage() {
|
||||||
|
return (
|
||||||
|
<AccPWDReset />
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import HelpCom from '../component/help/HelpCom'
|
||||||
|
|
||||||
|
export default function HelpPage() {
|
||||||
|
return (
|
||||||
|
<HelpCom />
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
import Onboard from '../component/onboard/Onboard';
|
||||||
|
|
||||||
|
|
||||||
|
export default function OnboardPage(){
|
||||||
|
return <Onboard />
|
||||||
|
}
|
||||||
@@ -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,5 @@
|
|||||||
|
import ProfileCompleteCom from '../component/profile_complete/ProfileCompleteCom';
|
||||||
|
|
||||||
|
export default function ProfileCompletePage(){
|
||||||
|
return <ProfileCompleteCom />
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
import Subscription from '../component/subscription/Subscription';
|
||||||
|
|
||||||
|
|
||||||
|
export default function SubscriptionPage(){
|
||||||
|
return <Subscription />
|
||||||
|
}
|
||||||