remove stock links v1
This commit is contained in:
+29
-29
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import {useState} from "react";
|
||||
import {useFormik ,Form} from "formik";
|
||||
import { useState } from "react";
|
||||
import { useFormik, Form } from "formik";
|
||||
import { Formik } from "formik";
|
||||
|
||||
import * as Yup from 'yup'
|
||||
@@ -10,21 +10,21 @@ import {
|
||||
MDBInputGroupElement, MDBContainer, MDBRow, MDBIcon, MDBInput, MDBBtn, MDBSpinner, MDBTypography
|
||||
} from 'mdb-react-ui-kit'
|
||||
import axios from "axios";
|
||||
import {AppUrl} from "../../lib/api";
|
||||
import {AiOutlinePhone, AiOutlineUser} from "react-icons/ai";
|
||||
import { AppUrl } from "../../lib/api";
|
||||
import { AiOutlinePhone, AiOutlineUser } from "react-icons/ai";
|
||||
|
||||
const Connect = () => {
|
||||
const [Loading,setLoading] = useState(false);
|
||||
const [Success,setSuccess] = useState(false);
|
||||
const [Loading, setLoading] = useState(false);
|
||||
const [Success, setSuccess] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Formik
|
||||
initialValues={{ name: "" ,PhoneNumber: "",text: ""}}
|
||||
onSubmit={async (values,{resetForm}) => {
|
||||
initialValues={{ name: "", PhoneNumber: "", text: "" }}
|
||||
onSubmit={async (values, { resetForm }) => {
|
||||
setLoading(true);
|
||||
const dataForm = values;
|
||||
const SubmitForm = axios.post(AppUrl('contact-us'),dataForm).then((res) => {
|
||||
const SubmitForm = axios.post(AppUrl('contact-us'), dataForm).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setLoading(false);
|
||||
setSuccess(true);
|
||||
@@ -39,8 +39,8 @@ const Connect = () => {
|
||||
validateOnBlur={false}
|
||||
validationSchema={Yup.object().shape({
|
||||
name: Yup.string().required("وارد کردن نام الزامی است."),
|
||||
PhoneNumber : Yup.string().required('شماره تلفن الزامی است .'),
|
||||
text : Yup.string().required('متن پیام وارد نشده است. '),
|
||||
PhoneNumber: Yup.string().required('شماره تلفن الزامی است .'),
|
||||
text: Yup.string().required('متن پیام وارد نشده است. '),
|
||||
})}
|
||||
>
|
||||
{props => {
|
||||
@@ -55,12 +55,12 @@ const Connect = () => {
|
||||
handleReset
|
||||
} = props;
|
||||
return (
|
||||
<form id={'contactUsform'} style={{marginTop: '25px'}} onSubmit={handleSubmit}>
|
||||
<div className='lg:mx-20 sm:mx-5'>
|
||||
<h5 className={'right-align font-weight-bold'}> تماس با ما و مشاوره خرید سهام </h5>
|
||||
<form id={'contactUsform'} style={{ marginTop: '25px' }} onSubmit={handleSubmit}>
|
||||
<div className='lg:mx-20 sm:mx-5'>
|
||||
<h5 className={'right-align font-weight-bold'}> تماس با ما </h5>
|
||||
<br />
|
||||
<MDBRow>
|
||||
<MDBInputGroup className='mb-3' style={{width: '50%'}}>
|
||||
<MDBInputGroup className='mb-3' style={{ width: '50%' }}>
|
||||
<MDBInputGroupElement
|
||||
onChange={handleChange}
|
||||
onBlur={handleBlur}
|
||||
@@ -77,7 +77,7 @@ const Connect = () => {
|
||||
|
||||
</MDBInputGroup>
|
||||
|
||||
<MDBInputGroup className='mb-3' style={{width: '50%'}}>
|
||||
<MDBInputGroup className='mb-3' style={{ width: '50%' }}>
|
||||
<MDBInputGroupElement
|
||||
value={values.name}
|
||||
onChange={handleChange}
|
||||
@@ -90,7 +90,7 @@ const Connect = () => {
|
||||
<AiOutlineUser />
|
||||
</MDBInputGroupText>
|
||||
</MDBInputGroup>
|
||||
<MDBInputGroup className='mb-3' style={{width: '100%'}}>
|
||||
<MDBInputGroup className='mb-3' style={{ width: '100%' }}>
|
||||
<MDBInputGroupElement
|
||||
name={'text'}
|
||||
id={'text'}
|
||||
@@ -98,7 +98,7 @@ const Connect = () => {
|
||||
onChange={handleChange}
|
||||
dir={'rtl'}
|
||||
className={'right-align RTL'}
|
||||
style={{height: '100%'}}
|
||||
style={{ height: '100%' }}
|
||||
placeholder='متن پیام خود را وارد کنید'
|
||||
textarea
|
||||
type='text' />
|
||||
@@ -106,11 +106,11 @@ const Connect = () => {
|
||||
</MDBRow>
|
||||
<MDBBtn type={'submit'}>
|
||||
{Loading ? (
|
||||
<>
|
||||
<MDBSpinner grow size='sm' role='status' tag='span' />
|
||||
<span className='visually-hidden'>Loading...</span>
|
||||
</>
|
||||
):
|
||||
<>
|
||||
<MDBSpinner grow size='sm' role='status' tag='span' />
|
||||
<span className='visually-hidden'>Loading...</span>
|
||||
</>
|
||||
) :
|
||||
<>
|
||||
ارسال
|
||||
</>
|
||||
@@ -120,23 +120,23 @@ const Connect = () => {
|
||||
<div className={'d-flex justify-content-end text-danger '}>
|
||||
{errors.PhoneNumber}
|
||||
</div>
|
||||
): null}
|
||||
) : null}
|
||||
{touched.name && errors.name ? (
|
||||
<div className={'d-flex justify-content-end text-danger '}>
|
||||
{errors.name}
|
||||
</div>
|
||||
): null}
|
||||
) : null}
|
||||
{touched.text && errors.text ? (
|
||||
<div className={'d-flex justify-content-end text-danger '}>
|
||||
{errors.text}
|
||||
</div>
|
||||
): null}
|
||||
<br/>
|
||||
) : null}
|
||||
<br />
|
||||
{Success ? (
|
||||
<MDBTypography style={{direction: 'rtl',borderRadius: '6px solid',borderRight: '6px solid #00B74A',borderLeft: 'none'}} note noteColor='success'>
|
||||
<MDBTypography style={{ direction: 'rtl', borderRadius: '6px solid', borderRight: '6px solid #00B74A', borderLeft: 'none' }} note noteColor='success'>
|
||||
اطلاعات شما ارسال شد ، بعد از بررسی با شما تماس گرفته می شود .
|
||||
</MDBTypography>
|
||||
): null}
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user