Professional Documents
Culture Documents
this.handleChange = this.handleChange.bind(this);
window.scrollTo(0, 0);
this.state = {
showModal: false, title: '', description: '', type: 0, path: ''
}
}
componentWillMount = () => { };
toggleModal = () => {
this.setState({
showModal: !this.state.showModal
});
};
handleChange(field, e) {
this.setState({ [field]: e.target.value });
}
selectedSection = (type) => {
this.setState({ type: type })
this.toggleModal()
}
handleSubmit = (event) => {
event.preventDefault();
if (this.state.type == 1) this.addProduct()
}
addCountry = () => {
let countryObj = {
"path": this.state.path,
"title": this.state.title
}
// if (this.form.getChildContext()._errors.length > 0) {
// if (this.error) {
// return
// }
// else {
// return ToastService.error(this.props.translation?.fill_form)
// }
// } else {
// if (!this.error) {
CountryService.addCountry(countryObj).then((result) => {
// if (result.success) this.setState({ showModal: !this.state.showModal })
// else return ToastService.error(result.data.message)
});
}
addProduct = () => {
let productObj = {
"post_title": this.state.title,
"post_content": this.state.description,
"blog_id": localStorage.getItem('blogId')
}
// if (this.form.getChildContext()._errors.length > 0) {
// if (this.error) {
// return
// }
// else {
// return ToastService.error(this.props.translation?.fill_form)
// }
// } else {
// if (!this.error) {
ProductService.addProduct(productObj).then((result) => {
// if (result.success) this.setState({ showModal: !this.state.showModal })
// else return ToastService.error(result.data.message)
});
}
cardstyl = {
display: "flex",
alignItems: 'center',
flexDirection: "column",
flexGrow: '1',
minHeight: '150px',
cursor: "pointer",
borderRadius: "20px",
padding: "0.75rem",
boxShadow:
"rgb(0 0 0 / 20%) 6px 6px 14px 0px, rgb(180 180 180 / 63%) -8px -8px 18px
0px"
}
colorhd_ = {
fontStyle: "normal",
fontWeight: "800",
lineHeight: "28px",
color: '#525252',
margin: '1rem 0 0rem 0'
}
render() {
const { showModal, title, description, type, path } = this.state
return (<>
<section id="ayushBranch" style={{ background: 'rgb(211 215 206)' }}>
<div className="container" style={{ display: 'flex', flexDirection:
'column', rowGap: '1rem', marginBottom: '4rem' }}>
<h2 style={this.colorhd_}>
<span style={{ fontWeight: '500' }}>Welcome,</span> Digital India
Corporation
</h2>
<p style={{ fontSize: '14px', color: '#4d4d4d' }}>Lorem ipsum, dolor sit
amet consectetur adipisicing elit. Minus ratione enim ea nam magnam eligendi
repellendus pariatur exercitationem aliquam commodi quibusdam earum neque impedit,
porro totam corporis ipsum ipsam quis!</p>
<div style={{ columnGap: '2rem' }} className="d-flex justify-content-
between align-items-start">
</form>
</Modal> */}
);
}
}