Compare commits
26 Commits
login-bug-fix
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 47d3bded9d | |||
| 22c7182993 | |||
| 29a2c937fe | |||
| 3a81da3713 | |||
| 4ace1acda3 | |||
| 04afae48a2 | |||
| 1a35a8c9b8 | |||
| 4f3fb44fcd | |||
| ef24f269dc | |||
| 51df8293c3 | |||
| 546b6177dc | |||
| db116f36e3 | |||
| 4f93c5b2c2 | |||
| 0a3ca0234e | |||
| a88da5cf0e | |||
| 159f1fcdc8 | |||
| f50df99417 | |||
| 9217e88831 | |||
| 49c6c6afe9 | |||
| ffd00155e0 | |||
| 9fd3636ffd | |||
| 5ff6b4a4d2 | |||
| 22c431c8e0 | |||
| 2db3a4d6f4 | |||
| 1310561e55 | |||
| edcb6cac7d |
@@ -23,3 +23,7 @@ REACT_APP_DNS1='dns1.mermsemr.net'
|
|||||||
REACT_APP_DNS2='dns1.mermsemr.net'
|
REACT_APP_DNS2='dns1.mermsemr.net'
|
||||||
REACT_APP_DNS_LINK='https://qa-www.mermsemr.com/info/dns'
|
REACT_APP_DNS_LINK='https://qa-www.mermsemr.com/info/dns'
|
||||||
|
|
||||||
|
|
||||||
|
#CLOUDFLARE
|
||||||
|
REACT_APP_TURNSTILE_SITE_KEY=0x4AAAAAADQV82wuocFR-u5O
|
||||||
|
|
||||||
|
|||||||
@@ -24,3 +24,6 @@ REACT_APP_DNS1='dns1.mermsemr.net'
|
|||||||
REACT_APP_DNS2='dns1.mermsemr.net'
|
REACT_APP_DNS2='dns1.mermsemr.net'
|
||||||
REACT_APP_DNS_LINK='https://qa-www.mermsemr.com/info/dns'
|
REACT_APP_DNS_LINK='https://qa-www.mermsemr.com/info/dns'
|
||||||
|
|
||||||
|
#CLOUDFLARE
|
||||||
|
REACT_APP_TURNSTILE_SITE_KEY=0x4AAAAAADQV82wuocFR-u5O
|
||||||
|
|
||||||
|
|||||||
@@ -22,3 +22,7 @@ REACT_APP_SHOW_DOWNLOAD=0
|
|||||||
REACT_APP_DNS1='dns1.mermsemr.net'
|
REACT_APP_DNS1='dns1.mermsemr.net'
|
||||||
REACT_APP_DNS2='dns1.mermsemr.net'
|
REACT_APP_DNS2='dns1.mermsemr.net'
|
||||||
REACT_APP_DNS_LINK='https://www.mermsemr.com/info/dns'
|
REACT_APP_DNS_LINK='https://www.mermsemr.com/info/dns'
|
||||||
|
|
||||||
|
#CLOUDFLARE
|
||||||
|
REACT_APP_TURNSTILE_SITE_KEY=0x4AAAAAADQV82wuocFR-u5O
|
||||||
|
|
||||||
|
|||||||
@@ -19,3 +19,7 @@ REACT_APP_TIMEOUT=600000
|
|||||||
REACT_APP_DNS1='dns1.mermsemr.net'
|
REACT_APP_DNS1='dns1.mermsemr.net'
|
||||||
REACT_APP_DNS2='dns1.mermsemr.net'
|
REACT_APP_DNS2='dns1.mermsemr.net'
|
||||||
REACT_APP_DNS_LINK='https://qa-www.mermsemr.com/info/dns'
|
REACT_APP_DNS_LINK='https://qa-www.mermsemr.com/info/dns'
|
||||||
|
|
||||||
|
#CLOUDFLARE
|
||||||
|
REACT_APP_TURNSTILE_SITE_KEY=0x4AAAAAADQV82wuocFR-u5O
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
version: '3'
|
# version: '3'
|
||||||
services:
|
services:
|
||||||
merms-panel:
|
merms-panel:
|
||||||
# image: registry.chiefsoft.net/merms-panel-reactjs:latest
|
# image: registry.chiefsoft.net/merms-panel-reactjs:latest
|
||||||
|
|||||||
Generated
+9863
-3874
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@
|
|||||||
"@fullcalendar/interaction": "^6.1.15",
|
"@fullcalendar/interaction": "^6.1.15",
|
||||||
"@fullcalendar/react": "^6.1.15",
|
"@fullcalendar/react": "^6.1.15",
|
||||||
"@fullcalendar/timegrid": "^6.1.15",
|
"@fullcalendar/timegrid": "^6.1.15",
|
||||||
|
"@marsidev/react-turnstile": "^1.5.2",
|
||||||
"@popperjs/core": "^2.11.8",
|
"@popperjs/core": "^2.11.8",
|
||||||
"@reduxjs/toolkit": "^2.4.0",
|
"@reduxjs/toolkit": "^2.4.0",
|
||||||
"@stripe/react-stripe-js": "^3.9.1",
|
"@stripe/react-stripe-js": "^3.9.1",
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export default function CSignup() {
|
|||||||
},
|
},
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
if(res?.data?.resultCode != '0'){
|
if(res?.data?.resultCode != '0'){
|
||||||
throw({message: res?.data?.resultDescription})
|
throw({message: res?.data?.error_message})
|
||||||
}
|
}
|
||||||
const {token, room, uid} = res?.data
|
const {token, room, uid} = res?.data
|
||||||
if(!token || !room){
|
if(!token || !room){
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { Form, Formik } from "formik";
|
import { Form, Formik } from "formik";
|
||||||
|
import { Turnstile } from '@marsidev/react-turnstile'
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
// import LoginImg from '../../assets/bg/login.svg'
|
// import LoginImg from '../../assets/bg/login.svg'
|
||||||
|
|
||||||
@@ -17,13 +18,14 @@ const validationSchema = Yup.object().shape({
|
|||||||
// /^[^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"
|
||||||
// )
|
// )
|
||||||
.min(3, "Minimum 3 characters")
|
.min(3, "Username must be at least 3 characters")
|
||||||
.max(25, "Maximum 25 characters")
|
.max(25, "Entered Username is too long")
|
||||||
.required("Email is required"),
|
.required("Enter a valid username to continue"),
|
||||||
})
|
})
|
||||||
|
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
username: ''
|
username: '',
|
||||||
|
turnstileToken: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Forgetpwd2() {
|
export default function Forgetpwd2() {
|
||||||
@@ -77,8 +79,18 @@ export default function Forgetpwd2() {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<div className="text-center col-12 mt-3">
|
||||||
|
<Turnstile
|
||||||
|
siteKey={process.env.REACT_APP_TURNSTILE_SITE_KEY}
|
||||||
|
onSuccess={(token) => props.setFieldValue('turnstileToken', token)}
|
||||||
|
onExpire={() => props.setFieldValue('turnstileToken', null)}
|
||||||
|
onError={() => props.setFieldValue('turnstileToken', null)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="col-12 mt-3 text-end">
|
<div className="col-12 mt-3 text-end">
|
||||||
<button type='submit' className="btn btn-primary text-uppercase">{mutation.isPending ? 'loading...' : 'Send'}</button>
|
<button type='submit' disabled={!props.values.turnstileToken || mutation.isPending} className="btn btn-primary text-uppercase">{mutation.isPending ? 'loading...' : 'Send'}</button>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
:
|
:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { useMutation } from '@tanstack/react-query'
|
import { useMutation } from '@tanstack/react-query'
|
||||||
import { useDispatch, useSelector } from 'react-redux'
|
import { useDispatch, useSelector } from 'react-redux'
|
||||||
|
import { Turnstile } from '@marsidev/react-turnstile'
|
||||||
|
|
||||||
// import LoginImg from '../../assets/bg/login.svg'
|
// import LoginImg from '../../assets/bg/login.svg'
|
||||||
|
|
||||||
@@ -26,6 +27,8 @@ export default function Login() {
|
|||||||
remember: false
|
remember: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const [turnstileToken, setTurnstileToken] = useState(null)
|
||||||
|
|
||||||
const handleChange = ({target:{name, value}}) => {
|
const handleChange = ({target:{name, value}}) => {
|
||||||
if(name == 'remember'){
|
if(name == 'remember'){
|
||||||
return setFields(prev => ({...prev, remember:!prev.remember}))
|
return setFields(prev => ({...prev, remember:!prev.remember}))
|
||||||
@@ -34,13 +37,13 @@ export default function Login() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const login = useMutation({
|
const login = useMutation({
|
||||||
mutationFn: (fields) => {
|
mutationFn: ({ turnstileToken, ...fields }) => {
|
||||||
if(!fields.username || !fields.password){
|
if(!fields.username || !fields.password){
|
||||||
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)
|
||||||
delete fields.remember // REMOVING REMEMBER FROM THE PAYLOAD
|
delete fields.remember
|
||||||
return loginUser(fields)
|
return loginUser({ ...fields, turnstileToken })
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -69,7 +72,7 @@ export default function Login() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(()=>{ // NAVIGATES USER TO HOME PAGE IF USER IS ACTIVE
|
useEffect(()=>{ // NAVIGATES USER TO HOME PAGE IF USER IS CURRENTLY ACTIVE
|
||||||
if(loggedIn){
|
if(loggedIn){
|
||||||
navigate(siteLinks.dash)
|
navigate(siteLinks.dash)
|
||||||
}
|
}
|
||||||
@@ -101,6 +104,14 @@ export default function Login() {
|
|||||||
<input maxLength={25} name='password' value={fields.password} onChange={handleChange} type="password" className="form-control" placeholder="Password" />
|
<input maxLength={25} name='password' value={fields.password} onChange={handleChange} type="password" className="form-control" placeholder="Password" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="text-center col-12 mt-3">
|
||||||
|
<Turnstile
|
||||||
|
siteKey={process.env.REACT_APP_TURNSTILE_SITE_KEY}
|
||||||
|
onSuccess={setTurnstileToken}
|
||||||
|
onExpire={() => setTurnstileToken(null)}
|
||||||
|
onError={() => setTurnstileToken(null)}
|
||||||
|
/>
|
||||||
|
</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">
|
||||||
@@ -120,7 +131,7 @@ export default function Login() {
|
|||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
<div className="col-12 mt-3 text-end">
|
<div className="col-12 mt-3 text-end">
|
||||||
<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, turnstileToken})}} disabled={!turnstileToken || login.isPending} 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> <Link to={siteLinks.signup}>
|
<p> <Link to={siteLinks.signup}>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React, {useState} from 'react'
|
import React, {useState} from 'react'
|
||||||
import {Form, Formik} from "formik";
|
import {Form, Formik} from "formik";
|
||||||
|
import { Turnstile } from '@marsidev/react-turnstile'
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
|
|
||||||
// import LoginImg from '../../assets/bg/login.svg'
|
// import LoginImg from '../../assets/bg/login.svg'
|
||||||
@@ -33,6 +34,7 @@ const initialValues = {
|
|||||||
firstname: '',
|
firstname: '',
|
||||||
lastname: '',
|
lastname: '',
|
||||||
isChecked: false,
|
isChecked: false,
|
||||||
|
turnstileToken: '',
|
||||||
// username: '',
|
// username: '',
|
||||||
// password: ''
|
// password: ''
|
||||||
};
|
};
|
||||||
@@ -157,9 +159,17 @@ export default function Signup2() {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
<div className="text-center col-12 mt-3">
|
||||||
|
<Turnstile
|
||||||
|
siteKey={process.env.REACT_APP_TURNSTILE_SITE_KEY}
|
||||||
|
onSuccess={(token) => props.setFieldValue('turnstileToken', token)}
|
||||||
|
onExpire={() => props.setFieldValue('turnstileToken', null)}
|
||||||
|
onError={() => props.setFieldValue('turnstileToken', null)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div className="col-12 mt-3 text-end">
|
<div className="col-12 mt-3 text-end">
|
||||||
<button type='submit'
|
<button type='submit'
|
||||||
|
disabled={!props.values.turnstileToken || mutation.isPending}
|
||||||
className="btn btn-primary text-uppercase">{mutation.isPending ? 'loading...' : 'Sign up'}</button>
|
className="btn btn-primary text-uppercase">{mutation.isPending ? 'loading...' : 'Sign up'}</button>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -42,19 +42,35 @@ export default function SocketIOContextProvider({children}) {
|
|||||||
// setSocketMsgReceived(data.message);
|
// setSocketMsgReceived(data.message);
|
||||||
// dispatch(tableReload({type:'CHATMESSAGELIST'})) // dispatches to update chat message sending from owner to worker and vice versa
|
// dispatch(tableReload({type:'CHATMESSAGELIST'})) // dispatches to update chat message sending from owner to worker and vice versa
|
||||||
console.log('SOCKET RECEIVED DATA *** ', data)
|
console.log('SOCKET RECEIVED DATA *** ', data)
|
||||||
|
if(data?.message_action === socketOnEvents.refresh_all_actions){
|
||||||
queryClient.refetchQueries({
|
queryClient.refetchQueries({
|
||||||
queryKey: [...queryKeys.recentAction],
|
queryKey: [...queryKeys.recentAction],
|
||||||
// type: 'active',
|
// type: 'active',
|
||||||
// exact: true,
|
// exact: true,
|
||||||
})
|
})
|
||||||
});
|
}
|
||||||
|
if(data?.message_action === socketOnEvents.refresh_provision){
|
||||||
socket.on(socketOnEvents.refresh_provision, (data) => {
|
queryClient.refetchQueries({ // refetches product Page API call
|
||||||
|
queryKey: [...queryKeys.product_page],
|
||||||
|
})
|
||||||
queryClient.refetchQueries({ // refetches productProvision API call
|
queryClient.refetchQueries({ // refetches productProvision API call
|
||||||
queryKey: [...queryKeys.myproduct_provision],
|
queryKey: [...queryKeys.myproduct_provision],
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// socket.on(socketOnEvents.refresh_provision, (data) => {
|
||||||
|
// queryClient.refetchQueries({ // refetches productProvision API call
|
||||||
|
// queryKey: [...queryKeys.myproduct_provision],
|
||||||
|
// })
|
||||||
|
// // queryClient.invalidateQueries({ queryKey: [...queryKeys.product_page] })
|
||||||
|
// queryClient.refetchQueries({ // refetches product Page API call
|
||||||
|
// queryKey: [...queryKeys.product_page],
|
||||||
|
// })
|
||||||
|
// console.log('SOCKET RECEIVED DATA *** 111 ', data)
|
||||||
|
// });
|
||||||
|
|
||||||
// client-side
|
// client-side
|
||||||
socket.on("connect", () => {
|
socket.on("connect", () => {
|
||||||
console.log(socket.id);
|
console.log(socket.id);
|
||||||
|
|||||||
@@ -6,5 +6,6 @@ export const socketEmitEvents = {
|
|||||||
|
|
||||||
export const socketOnEvents = {
|
export const socketOnEvents = {
|
||||||
receive_message: 'receive_message',
|
receive_message: 'receive_message',
|
||||||
|
refresh_all_actions: 'refresh_all_actions',
|
||||||
refresh_provision: 'refresh_provision_actions'
|
refresh_provision: 'refresh_provision_actions'
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ export default function Products() {
|
|||||||
return (
|
return (
|
||||||
<div key={product.uid+index} className={`col-12 col-lg-6 mb-2 mb-xxl-0`}>
|
<div key={product.uid+index} className={`col-12 col-lg-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 ${product?.icon_style}`} style={{borderColor:'black', borderWidth: '2px'}} >
|
<div className={`d-flex align-items-center extraProductCard ${product?.icon_style}`} style={{borderColor:'black', borderWidth: '2px', paddingLeft:"1px"}} >
|
||||||
<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 ${product?.product_icon} text-primary`}></i>
|
<i className={`fa ${product?.product_icon} text-primary`}></i>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default function UserFooter(){
|
|||||||
<p>© Copyright {year}. 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 autoMedSys A.I.</p>
|
<p>A division of MERMS(AI)</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ const TemplateConfigure = ({ productData }) => {
|
|||||||
backgroundColor: "aliceblue",
|
backgroundColor: "aliceblue",
|
||||||
margin: "2px",
|
margin: "2px",
|
||||||
maxHeight: "150px",
|
maxHeight: "150px",
|
||||||
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ export default function ProfileForm({data}) {
|
|||||||
const handleSetInfoToUpdate = (values, helpers) => {
|
const handleSetInfoToUpdate = (values, helpers) => {
|
||||||
delete values.email
|
delete values.email
|
||||||
delete values.country
|
delete values.country
|
||||||
|
delete values?.picture
|
||||||
setInfoToUpdate(values)
|
setInfoToUpdate(values)
|
||||||
var modal = new Modal(document.getElementById('modal'));
|
var modal = new Modal(document.getElementById('modal'));
|
||||||
modal.show();
|
modal.show();
|
||||||
|
|||||||
@@ -1,14 +1,29 @@
|
|||||||
import React from 'react';
|
import React from "react";
|
||||||
import { loadStripe } from '@stripe/stripe-js';
|
import { loadStripe } from "@stripe/stripe-js";
|
||||||
import { Elements, useStripe, useElements, CardElement } from '@stripe/react-stripe-js';
|
import {
|
||||||
import {MyProductData, StripeSubscriptionCreate} from '../../services/services';
|
Elements,
|
||||||
|
useStripe,
|
||||||
|
useElements,
|
||||||
|
CardElement,
|
||||||
|
} from "@stripe/react-stripe-js";
|
||||||
|
import {
|
||||||
|
MyProductData,
|
||||||
|
StripeSubscriptionCreate,
|
||||||
|
} 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 { useNavigate } from 'react-router-dom';
|
import { useNavigate } from "react-router-dom";
|
||||||
//const stripePromise = loadStripe('your_stripe_publishable_key');
|
//const stripePromise = loadStripe('your_stripe_publishable_key');
|
||||||
const stripePromise = loadStripe('pk_test_51RqL5WLjZLojw6IZmEpwFidNZSl9lLlVUHNvuFZNEz1eTR9XXepnyyVhfvXe9cp4eMnqkDPpoe9wxLLRSV0dxRee00UfhayUOT');
|
const stripePromise = loadStripe(
|
||||||
|
"pk_test_51RqL5WLjZLojw6IZmEpwFidNZSl9lLlVUHNvuFZNEz1eTR9XXepnyyVhfvXe9cp4eMnqkDPpoe9wxLLRSV0dxRee00UfhayUOT",
|
||||||
|
);
|
||||||
|
|
||||||
const CheckoutForm = ({ priceId, customerId ,option_name }) => {
|
const CheckoutForm = ({
|
||||||
|
priceId,
|
||||||
|
customerId,
|
||||||
|
option_name,
|
||||||
|
selected_display_name,
|
||||||
|
}) => {
|
||||||
const stripe = useStripe();
|
const stripe = useStripe();
|
||||||
const elements = useElements();
|
const elements = useElements();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -23,9 +38,9 @@ const CheckoutForm = ({ priceId, customerId ,option_name }) => {
|
|||||||
priceId: priceId,
|
priceId: priceId,
|
||||||
customerId: customerId,
|
customerId: customerId,
|
||||||
option_name: option_name,
|
option_name: option_name,
|
||||||
token: localStorage.getItem('token'), // USER TOKEN
|
token: localStorage.getItem("token"), // USER TOKEN
|
||||||
uid: localStorage.getItem('uid') // USER UID
|
uid: localStorage.getItem("uid"), // USER UID
|
||||||
}
|
};
|
||||||
|
|
||||||
StripeSubscriptionCreate(reqData).then((res) => {
|
StripeSubscriptionCreate(reqData).then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
@@ -33,23 +48,36 @@ const CheckoutForm = ({ priceId, customerId ,option_name }) => {
|
|||||||
//navigate(res.data.stripe_session)
|
//navigate(res.data.stripe_session)
|
||||||
window.location.replace(res.data.stripe_session);
|
window.location.replace(res.data.stripe_session);
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<CardElement />
|
{/*<CardElement />*/}
|
||||||
<button type="submit" disabled={!stripe}>
|
<button
|
||||||
Subscribe
|
type="submit"
|
||||||
|
disabled={!stripe}
|
||||||
|
className="btn btn-primary text-uppercase"
|
||||||
|
>
|
||||||
|
Start {selected_display_name} Subscription
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const StripeSubscriptionButton = ({ priceId, customerId ,option_name}) => {
|
const StripeSubscriptionButton = ({
|
||||||
|
priceId,
|
||||||
|
customerId,
|
||||||
|
option_name,
|
||||||
|
selected_display_name,
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<Elements stripe={stripePromise}>
|
<Elements stripe={stripePromise}>
|
||||||
<CheckoutForm priceId={priceId} customerId={customerId} option_name={option_name} />
|
<CheckoutForm
|
||||||
|
priceId={priceId}
|
||||||
|
customerId={customerId}
|
||||||
|
option_name={option_name}
|
||||||
|
selected_display_name={selected_display_name}
|
||||||
|
/>
|
||||||
</Elements>
|
</Elements>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,14 +5,13 @@ import SubscribeNewCard from "./SubscribeNewCard";
|
|||||||
import SubscribePreviousCard from "./SubscribePreviousCard";
|
import SubscribePreviousCard from "./SubscribePreviousCard";
|
||||||
import SubcribePaymentOptions from "./SubcribePaymentOptions";
|
import SubcribePaymentOptions from "./SubcribePaymentOptions";
|
||||||
import StripeSubscriptionButton from "./StripeSubscriptionButton";
|
import StripeSubscriptionButton from "./StripeSubscriptionButton";
|
||||||
|
import SubscribeInfo from "./SubscribeInfo";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function Subscribe() {
|
export default function Subscribe() {
|
||||||
const {state: {selectedSubscription,customerId}} = useLocation()
|
const {state: {selectedSubscription, customerId, currentSubscription}} = useLocation()
|
||||||
|
|
||||||
console.log('selectedSubscription', selectedSubscription)
|
console.log('selectedSubscription', selectedSubscription)
|
||||||
|
console.log('currentSubscription', currentSubscription)
|
||||||
console.log('selectedSubscription.option_name', selectedSubscription.option_name)
|
console.log('selectedSubscription.option_name', selectedSubscription.option_name)
|
||||||
console.log('customerId', customerId)
|
console.log('customerId', customerId)
|
||||||
|
|
||||||
@@ -27,17 +26,22 @@ export default function Subscribe() {
|
|||||||
<div className="card card-statistics text-center py-3">
|
<div className="card card-statistics text-center py-3">
|
||||||
<div className="card-body pricing-content">
|
<div className="card-body pricing-content">
|
||||||
<div className="pricing-content-card">
|
<div className="pricing-content-card">
|
||||||
<h5>Current Subscription(s)</h5>
|
<h3>Your Current Subscription</h3>
|
||||||
{/*<h2 className="text-primary pt-3">{currentSubscription?.display_name}</h2>*/}
|
<h2 className="text-primary pt-3">{currentSubscription?.display_name}</h2>
|
||||||
<SubcribePaymentOptions activePaymentType={activePaymentType}
|
{/*<SubcribePaymentOptions activePaymentType={activePaymentType}*/}
|
||||||
setActivePaymentType={setActivePaymentType}/>
|
{/* setActivePaymentType={setActivePaymentType}/>*/}
|
||||||
{activePaymentType == 'new' ?
|
{/*{activePaymentType == 'new' ?*/}
|
||||||
<SubscribeNewCard/>
|
{/* <SubscribeNewCard/>*/}
|
||||||
:
|
{/* :*/}
|
||||||
<SubscribePreviousCard/>
|
{/* <SubscribePreviousCard/>*/}
|
||||||
}
|
{/*}*/}
|
||||||
<>
|
<>
|
||||||
<StripeSubscriptionButton priceId={selectedSubscription.stripe_price_id} customerId={customerId} option_name={selectedSubscription.option_name} />
|
<SubscribeInfo />
|
||||||
|
<StripeSubscriptionButton priceId={selectedSubscription.stripe_price_id}
|
||||||
|
customerId={customerId}
|
||||||
|
option_name={selectedSubscription.option_name}
|
||||||
|
selected_display_name={selectedSubscription.display_name}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function SubscribeInfo() {
|
||||||
|
|
||||||
|
return <>
|
||||||
|
<div className="row">
|
||||||
|
<div className="col-md-12 col-12 selects-contant">
|
||||||
|
<div className="card card-statistics">
|
||||||
|
<div className="card-body">
|
||||||
|
<div className="form-group mb-0">
|
||||||
|
Your subscription terms outline the details of your plan, including billing frequency,
|
||||||
|
renewal dates, payment methods, and cancellation policies. Please review your subscription
|
||||||
|
agreement for information on your current plan, how to manage or update your subscription,
|
||||||
|
and any applicable fees or renewal conditions. Contact support if you have questions about
|
||||||
|
your subscription.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</>
|
||||||
|
|
||||||
|
}
|
||||||
@@ -91,7 +91,8 @@ export default function Subscription() {
|
|||||||
navigate(siteLinks.subscribe, {
|
navigate(siteLinks.subscribe, {
|
||||||
state: {
|
state: {
|
||||||
selectedSubscription: value,
|
selectedSubscription: value,
|
||||||
customerId: stripe_customer_id
|
customerId: stripe_customer_id,
|
||||||
|
currentSubscription: currentSubscription
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -2072,7 +2072,7 @@ ul.activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.img-icon i{
|
.img-icon i{
|
||||||
font-size:20px;
|
font-size:35px;
|
||||||
}
|
}
|
||||||
@media (max-width: 1440px) and (min-width:1200px){
|
@media (max-width: 1440px) and (min-width:1200px){
|
||||||
.border-xxl-t{
|
.border-xxl-t{
|
||||||
|
|||||||
Reference in New Issue
Block a user