Compare commits

..

3 Commits

Author SHA1 Message Date
victorAnumudu 44d99f5e20 contact API added 2024-07-16 21:03:11 +01:00
CHIEFSOFT\ameye eb57654d59 No shared 2024-07-12 17:33:37 -04:00
CHIEFSOFT\ameye 0eae8c27a6 no collection 2024-07-12 17:28:14 -04:00
6 changed files with 100 additions and 48 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

+8 -7
View File
@@ -1,11 +1,12 @@
import Axios from 'axios'; import axios from 'axios';
import getConfig from './../Config/config'
async function ContactData(callData) { async function ContactData(reqData) {
// debugger; let formData = new FormData()
var site = getConfig()[0]; for (let value in reqData) {
let response = await Axios.post(`${process.env.REACT_APP_AUX_ENDPOINT}/sitecontact`, callData); formData.append(value, reqData[value]);
return response.data.result; }
let response = await axios.post(`${process.env.REACT_APP_AUX_ENDPOINT}/sitecontact`, reqData);
return response;
} }
export default ContactData; export default ContactData;
+83 -32
View File
@@ -1,4 +1,4 @@
import React from 'react'; import React, {useState} from 'react';
import getConfig from './../../Config/config' import getConfig from './../../Config/config'
import ContactData from '../../Services/ContactData'; import ContactData from '../../Services/ContactData';
@@ -7,34 +7,69 @@ function Forms() {
var site = getConfig()[0]; var site = getConfig()[0];
const [formDetails, setFormDetails] = useState({
first_name: '',
last_name: '',
email: '',
subject: '',
phone_number: '',
action: 1001,
message: '',
channel: 'WEB',
terms_conditions: false
})
const validForm = formDetails.first_name && formDetails.last_name && formDetails.email && formDetails.phone_number && formDetails.subject && formDetails.message
const handleChange = ({target:{name, value}}) => {
setFormDetails(prev => ({...prev, [name]:value}))
}
const [requestStatus, setRequestStatus] = useState({loading:false, status:false, msg:''})
function handleSubmit(e) { function handleSubmit(e) {
e.preventDefault(); e.preventDefault()
// console.log('You clicked submit.'); setRequestStatus({loading:true, status:false, msg:''})
// console.log(e); if(!validForm){
// debugger; setRequestStatus({loading:false, status:false, msg:'please, fill all fields'})
const firstname = e.target['f-name'].value; setTimeout(()=>{
const lastname = e.target['l-name'].value; setRequestStatus({loading:false, status:false, msg:''})
const email = e.target['email'].value; },3000)
const phone = e.target['phone'].value; return
const subject = e.target['subject'].value; }
const message = e.target['message'].value;
const terms = e.target['terms-conditions'].checked;
//alert(terms);
var callData = [{ delete formDetails.terms_conditions
"firstname": firstname,
"lastname": lastname,
"email": email,
"phone": phone,
"subject": subject,
"message": message,
"channel": 'WEB'
}];
const callRet = ContactData(callData); ContactData(formDetails).then(res =>{
console.log('You clicked submit========> '+ callRet); if(res?.data?.result != '100'){
setRequestStatus({loading:false, status:false, msg:'failed to send message'})
} setTimeout(()=>{
setRequestStatus({loading:false, status:false, msg:''})
},3000)
return
}
setRequestStatus({loading:false, status:true, msg:'message Sent'})
setTimeout(()=>{
setRequestStatus({loading:false, status:false, msg:''})
setFormDetails({
first_name: '',
last_name: '',
email: '',
subject: '',
phone_number: '',
action: 1001,
message: '',
channel: 'WEB',
terms_conditions: false
})
},3000)
}).catch(err => {
setRequestStatus({loading:false, status:false, msg:'failed something went wrong'})
setTimeout(()=>{
setRequestStatus({loading:false, status:false, msg:''})
},3000)
});
}
return ( return (
@@ -99,10 +134,10 @@ function Forms() {
<h4>Lets Connect</h4> <h4>Lets Connect</h4>
<form onSubmit={handleSubmit} className="row"> <form onSubmit={handleSubmit} className="row">
<div className="col-md-6"> <div className="col-md-6">
<input type="text" name="f-name" placeholder="First Name" maxLength={15} /> <input type="text" name="first_name" placeholder="First Name" maxLength={15} onChange={handleChange} value={formDetails.first_name} />
</div> </div>
<div className="col-md-6"> <div className="col-md-6">
<input type="text" name="l-name" placeholder="Last Name" maxLength={15} /> <input type="text" name="last_name" placeholder="Last Name" maxLength={15} onChange={handleChange} value={formDetails.last_name} />
</div> </div>
<div className="col-md-6"> <div className="col-md-6">
<input <input
@@ -110,36 +145,52 @@ function Forms() {
name="email" name="email"
placeholder="Email Address" placeholder="Email Address"
maxLength={35} maxLength={35}
onChange={handleChange}
value={formDetails.email}
/> />
</div> </div>
<div className="col-md-6"> <div className="col-md-6">
<input <input
type="number" type="number"
name="phone" name="phone_number"
placeholder="Phone Number" placeholder="Phone Number"
maxLength={15} maxLength={15}
onChange={handleChange}
value={formDetails.phone_number}
/> />
</div> </div>
<div className="col-md-12"> <div className="col-md-12">
<input type="text" name="subject" placeholder="Subject" maxLength={35} /> <input type="text" name="subject" placeholder="Subject" maxLength={35} value={formDetails.subject} onChange={handleChange} />
</div> </div>
<div className="col-md-12"> <div className="col-md-12">
<textarea <textarea
name="message" name="message"
placeholder="How can we help?" placeholder="How can we help?"
onChange={handleChange}
value={formDetails.message}
></textarea> ></textarea>
</div> </div>
<div className="col-md-6"> <div className="col-md-6">
<div className="condition-check"> <div className="condition-check">
<input id="terms-conditions" name="terms-conditions" type="checkbox" /> <input id="terms-conditions" name="terms_conditions" type="checkbox" value={formDetails.terms_conditions} onChange={handleChange} />
<label htmlFor="terms-conditions"> <label htmlFor="terms-conditions">
I agree to the <a href="#">Terms & Conditions</a> I agree to the <a href="#">Terms & Conditions</a>
</label> </label>
</div> </div>
</div> </div>
<div className="col-md-6 text-right"> <div className="col-md-6 text-right">
<input type="submit" name="submit" value="Send Message" /> <input
type="submit"
value={ requestStatus.loading ? 'Sending...' : 'Send Message'}
disabled={requestStatus.loading}
className={`${!validForm ? 'opacity-25' : 'opacity-100'}`}
/>
</div> </div>
{/* <div className="p-2 col-12">
{requestStatus.msg &&
}
</div> */}
<p className={`p-1 w-100 text-center ${requestStatus.status ? 'text-success' : 'text-danger'}`}>{requestStatus.msg}</p>
</form> </form>
</div> </div>
</div> </div>
+7 -7
View File
@@ -26,7 +26,7 @@ const Main = ({gredient}) => {
} }
<div className="container"> <div className="container">
<div className="row"> <div className="row">
<div className="col-12"> <div className="col-lg-6">
<div className="w-100"> <div className="w-100">
<div className="p-0 appie-traffic-title section_title" data-aos="fade-up" data-aos-duration="1500" data-aos-delay="100"> <div className="p-0 appie-traffic-title section_title" data-aos="fade-up" data-aos-duration="1500" data-aos-delay="100">
<h3 className='title'>Set Chores, Set Goals <div className='section_sub_title'>Reward Accomplishments</div></h3> <h3 className='title'>Set Chores, Set Goals <div className='section_sub_title'>Reward Accomplishments</div></h3>
@@ -34,15 +34,15 @@ const Main = ({gredient}) => {
Set goals, tasks, or anything that motivates or needs to be done and reward completion. WrenchBoard is the platform to plan rewards. Set goals, tasks, or anything that motivates or needs to be done and reward completion. WrenchBoard is the platform to plan rewards.
</p> </p>
</div> </div>
<div className="appie-traffic-title section_title my-5" data-aos="fade-up" data-aos-duration="1500" data-aos-delay="100" style={{padding: '0'}}> <div className="appie-traffic-title section_title mb-3" data-aos="fade-up" data-aos-duration="1500" data-aos-delay="100" style={{padding: '0'}}>
<h3 className='title text-center'>Assign Faster with</h3> <h3 className='title text-center text-lg-left'>Assign Faster with</h3>
<h3 className='w-100 title text-center d-flex justify-content-center flex-nowrap'> <h3 className='w-100 title text-center d-flex justify-content-center justify-content-lg-end flex-nowrap'>
<div className='color-blue italic'>wrench</div><div className='color-purple'>Agent</div> <div className='color-blue italic'>wrench</div><div className='color-purple'>Agent</div>
</h3> </h3>
</div> </div>
<div className="row my-4"> <div className="row">
{list?.map(({ icon, header, paragraph, name }, idx) => ( {list?.map(({ icon, header, paragraph, name }, idx) => (
<div className="col-12 col-md-6 mb-10 d-flex justify-content-center" key={idx} onClick={()=>changeActiveImg(name)} style={{cursor: 'pointer'}}> <div className="col-12 col-md-6 mb-10" key={idx} onClick={()=>changeActiveImg(name)} style={{cursor: 'pointer'}}>
<div <div
className={`appie-traffic-service features appie-modern-design`} className={`appie-traffic-service features appie-modern-design`}
> >
@@ -57,7 +57,7 @@ const Main = ({gredient}) => {
</div> </div>
</div> </div>
</div> </div>
<div className="col-12 mt-4"> <div className="col-lg-6 mt-4 mt-lg-0">
<Right /> <Right />
</div> </div>
</div> </div>
+2 -2
View File
@@ -18,8 +18,8 @@ export default function Right() {
</div> </div>
{/* </div> */} {/* </div> */}
{/* withFadeEdge-light-purple border-skyblue border-thin*/} {/* withFadeEdge-light-purple border-skyblue border-thin*/}
<div className="p-5 bg-white w-100 mx-auto border-r-10 overflow-hidden" <div className="p-2 pt-3 bg-white custom-w-90 mx-auto border-r-10 overflow-hidden"
style={{ backgroundImage: `url(${BGImage})`, backgroundPosition: 'left center', backgroundSize: 'cover', backgroundRepeat: 'no-repeat' }} style={{ backgroundImage: `url(${BGImage})`, backgroundPosition: 'left center', backgroundRepeat: 'no-repeat' }}
> >
<div className='generative-ai'> <div className='generative-ai'>
{list?.map((item, idx) => ( {list?.map((item, idx) => (