);
export default ProductItem;
diff --git a/src/component/Common/Products.js b/src/component/Common/Products.js
index 23fa6ba..7a4c994 100644
--- a/src/component/Common/Products.js
+++ b/src/component/Common/Products.js
@@ -36,21 +36,23 @@ const products = [
export class Products extends Component {
render() {
return (
-
-
-
- {products.map((product, index) =>
)}
-
-
+
+
+
+
+ {products.map((product, index) =>
)}
+
+
+
+
);
}
}
diff --git a/src/component/Donate/Donate.js b/src/component/Donate/Donate.js
new file mode 100644
index 0000000..d7c0453
--- /dev/null
+++ b/src/component/Donate/Donate.js
@@ -0,0 +1,173 @@
+import React from 'react';
+import img from './richard-bell.jpg';
+import './donate.css';
+import axios from 'axios';
+import { ToastContainer, toast } from 'react-toastify';
+import 'react-toastify/dist/ReactToastify.css';
+
+
+class Donate extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ firstname: '',
+ lastname: '',
+ email: '',
+ amount: '',
+ phone: '',
+ description: ''
+ };
+ this.handleChange = this.handleChange.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ }
+
+
+ handleSubmit(e) {
+ e.preventDefault();
+ const user = { ...this.state }
+ console.log(user);
+ axios.post('/donation/donate', user)
+ .then((res) => {
+ console.log(res.data);
+
+ }).catch((error) => {
+ console.log(error);
+ });
+
+ setTimeout(() => {
+ this.setState({
+ firstname: '',
+ lastname: '',
+ email: '',
+ amount: '',
+ phone: '',
+ description: ''
+ });
+
+ }, 1000);
+ setTimeout(() => {
+ this.props.history.push('/sponsorDashboard');
+
+ }, 6000);
+
+ }
+
+ handleChange(e) {
+ const { name, value, type } = e.target;
+
+ type === 'number' ? this.setState({ [name]: value }) :
+ type === 'tel' ? this.setState({ [name]: value }) :
+ this.setState({
+ [name]: value
+ });
+ }
+
+
+ render() {
+ const notify = () => toast.success('Thanks for sponsoring a farmer');
+
+ return (
+
+
+
+
+
+
EmpowerFarmer
+
Every donation makes an impact for farmers
+
When you donate to farmers, your generosity is immediately put to work helping us buy farm facilities for farmers
+
Your donation helps us to change the lives of the farmers
+
Kindly donate now.
+
+
+
+
+
+
+ )
+ }
+}
+
+export default Donate;
diff --git a/src/component/Donate/donate.css b/src/component/Donate/donate.css
new file mode 100644
index 0000000..0abfc11
--- /dev/null
+++ b/src/component/Donate/donate.css
@@ -0,0 +1,38 @@
+
+#center{
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ background: url('./richard-bell.jpg') center center;
+ box-shadow: inset 0 0 0 100vw rgba(0, 0, 0, .4);
+ height: 97%;
+ background-repeat: no-repeat;
+ color:#fff;
+ font-family: "Droid Serif","Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
+}
+
+span{
+ color: rgb(10, 155, 46);
+ font-style: italic;
+ border-bottom: 2px solid #ccc;
+}
+
+.mgtop{
+ margin-top: 10rem;
+}
+
+.lead{
+ font-size: 1.12em !important;
+}
+
+#form{
+ background:#fff;
+ color: #111111;
+ padding: 3rem;
+}
+
+#btn-donate{
+ margin-left: 35%;
+ padding: 10px 25px !important;
+}
\ No newline at end of file
diff --git a/src/component/Donate/richard-bell.jpg b/src/component/Donate/richard-bell.jpg
new file mode 100644
index 0000000..7c6dbae
Binary files /dev/null and b/src/component/Donate/richard-bell.jpg differ
diff --git a/src/component/Pages/HomePage.js b/src/component/Pages/HomePage.js
index 2ee05c7..65fa01d 100644
--- a/src/component/Pages/HomePage.js
+++ b/src/component/Pages/HomePage.js
@@ -9,7 +9,7 @@ import Footer from '../Common/Footer';
import Navigation from '../Common/Navigation';
-if (location.search){
+if (location.search) {
const tokenData = location.search.replace('?token=', '');
const token = jwtDecode(tokenData);
localStorage.setItem('EmpowerFarmerUser', JSON.stringify(token));
@@ -18,25 +18,25 @@ if (location.search){
export class HomePage extends Component {
render() {
return (
+
}
- image ={img1}
- link = '/'
- buttonText ='Fund a Farmer'
- showButton = {true}
- />
-
-
-
-
-