Merge branch 'myfit_country_code_fix' of MyFit/www-myfit into master
This commit is contained in:
@@ -64,7 +64,9 @@ const Main = ({ brdcum }) => {
|
|||||||
country: "",
|
country: "",
|
||||||
}); //initial state values
|
}); //initial state values
|
||||||
const [countries, setCountries] = useState([]); // initial state for country dropdown
|
const [countries, setCountries] = useState([]); // initial state for country dropdown
|
||||||
|
|
||||||
const [myData, setMyData] = useState(null);
|
const [myData, setMyData] = useState(null);
|
||||||
|
|
||||||
// Gave a generic name for multiple calls
|
// Gave a generic name for multiple calls
|
||||||
const API_CALL = new SiteService(); // instantiating the class
|
const API_CALL = new SiteService(); // instantiating the class
|
||||||
// API CALL
|
// API CALL
|
||||||
@@ -92,10 +94,10 @@ const Main = ({ brdcum }) => {
|
|||||||
setMyData(contact);
|
setMyData(contact);
|
||||||
|
|
||||||
// Checking for errors
|
// Checking for errors
|
||||||
if (contact?.data?.status < 1 || contact?.data?.message_id == "")
|
if (contact?.data?.status < 1 || contact?.data?.message_id == ""){
|
||||||
return (errText.textContent =
|
errText.textContent = "unable to send your message, please try again";
|
||||||
"unable to send your message, please try again");
|
response.innerHTML = `<p> SEND MESSAGE </p>`;
|
||||||
else {
|
}else {
|
||||||
response.innerHTML = `<p> SEND MESSAGE </p>`;
|
response.innerHTML = `<p> SEND MESSAGE </p>`;
|
||||||
|
|
||||||
contact_body.innerHTML = `<div class='contact_body animate pop'>
|
contact_body.innerHTML = `<div class='contact_body animate pop'>
|
||||||
@@ -105,13 +107,11 @@ const Main = ({ brdcum }) => {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
navigate("/");
|
navigate("/");
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
||||||
setValues((prev) => ({ ...prev, [e.target.name]: "" }));
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch(() => {
|
||||||
errText.textContent = "unable to send your message, please try again"
|
errText.textContent = "unable to send your message, please try again";
|
||||||
console.log(error);
|
response.innerHTML = `<p> SEND MESSAGE </p>`;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -120,6 +120,7 @@ const Main = ({ brdcum }) => {
|
|||||||
allCountry().then((data) => setCountries(Object.keys(data.data))).catch((err)=>console.log(err.message));
|
allCountry().then((data) => setCountries(Object.keys(data.data))).catch((err)=>console.log(err.message));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// myData
|
// myData
|
||||||
// }, [myData]);
|
// }, [myData]);
|
||||||
@@ -222,9 +223,7 @@ const Main = ({ brdcum }) => {
|
|||||||
value={values.country}
|
value={values.country}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
required>
|
required>
|
||||||
<option
|
<option value={""}>
|
||||||
value={""}
|
|
||||||
onCha>
|
|
||||||
Country
|
Country
|
||||||
</option>
|
</option>
|
||||||
{countries.length > 0 &&
|
{countries.length > 0 &&
|
||||||
@@ -255,7 +254,6 @@ const Main = ({ brdcum }) => {
|
|||||||
className="form-control"
|
className="form-control"
|
||||||
placeholder="Your message"
|
placeholder="Your message"
|
||||||
value={values.message}
|
value={values.message}
|
||||||
errorMessage='words have exceeded 350 characters!'
|
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
maxLength={300}
|
maxLength={300}
|
||||||
pattern="^[A-Za-z0-9]{5, 300}$"
|
pattern="^[A-Za-z0-9]{5, 300}$"
|
||||||
@@ -283,7 +281,7 @@ const Main = ({ brdcum }) => {
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{/* Error Tag */}
|
{/* Error Tag */}
|
||||||
<p id="errText" />
|
<p id="errText"></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Contact Info */}
|
{/* Contact Info */}
|
||||||
@@ -355,7 +353,9 @@ const Main = ({ brdcum }) => {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section className="row_am map_section">
|
<section className="row_am map_section">
|
||||||
<div className="container" />
|
<div className="container">
|
||||||
|
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user