Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.scss";
import { BrowserRouter, Route, Switch } from "react-router-dom";
import AdminMembership from "./js/components/AdminMembershipPage/AdminMembership"
import {BrowserRouter, Route, Switch, NavLink } from "react-router-dom";
import "./App.sass";
import Dummy from "./js/components/Dummy";
import Home from "./js/components/Home/Home";
import Navbar from "./js/components/Navbar/Navbar";
import { Provider } from "react-redux";
import Books from "./js/components/Books/Books";
import Login from "./js/components/LoginPage/Login";
import SignUp from "./js/components/RegisterPage/SignUp";

import ForgotSignIn from "./js/components/ForgotSignIn/ForgotSignIn";
import ArticleReader from "./js/components/Articles/ArticleReader";
import VideoPlayer from "./js/components/Articles/VideoPlayer";
import AdminMembershipDisplay from "./js/components/AdminMembershipPage/AdminMembershipDisplay";
import main from "./js/components/Main_Menu/Main";
import collection from "./js/components/CollectionsPage/Collection";
import donation from "./js/components/DonationPage/Donation";
import volunteer from "./js/components/VolunteerPage/Volunteer";
import donationSuccess from "./js/components/DonationPage/DonationSuccess";
import store from "./js/components/StorePage/Store";
class App extends Component {
render() {
var loc_navBarTitle = "KnowYourNation";
var loc_navbarItems = [true, true, true, true];

return (
<div className="app">
<div className="App">
<BrowserRouter>
<div>
<Switch>
<Route path="/login" component={Login} />
<Route path="/register" component={SignUp} />
<Route path="/resetpassword" component={ForgotSignIn} />
<Route path="/collection" component={collection} />
<Route path="/Books" component={Books} />
<Route path="/collection" component={collection} />
<Route path="/donation" component={donation} />
<Route path="/volunteer" component={volunteer}/>
<Route path = "/donationSuccess" component={donationSuccess}/>
<Route path="/store" component={store} />
<Route path="/main" component={main}/>
<Route path="/books" component={Books} />
<Route path="/ereader" component={ArticleReader} />
<Route path="/videoplayer" component={VideoPlayer} />
<Route path="/AdminMembership" component={AdminMembership}/>
<Route path="/AdminMembershipDisplay" component={AdminMembershipDisplay}/>
<Route component={Home} />
</Switch>
</div>
</BrowserRouter>
</div>
);
Expand Down
165 changes: 165 additions & 0 deletions src/js/components/DonationPage/Donation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@

import React, { Component } from "react";
import renderHTML from 'react-render-html';
import { Container, Col,FormGroup, Label, Input, Button, Form} from 'reactstrap';

//import { validatePassword, validateEmail, validateUsername } from './Validators.js';
import { BrowserRouter, Route, Switch, NavLink } from "react-router-dom";
/* <form>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GC has been preached many times.
Please remove it

Amount : <input type="text" id="AmountID" /><br/>
Organisation : <input type="checkbox" id="Org_One" /><Button variant="secondary"> View more </Button><br/>
Organisation : <input type="checkbox" id="Org_One" /><Button variant="secondary">View more </Button><br/>
</form>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<label>Payment </label>
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="WR3NGAATKPUWS" />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" border="0" src="https://www.paypal.com/en_ZA/i/scr/pixel.gif" width="1" height="1" />
</form>
*/
class donation extends Component {
constructor(props){
super(props);
this.state ={
"cardNumber": "",
"nameonCard": "",
"expirationDate": "",
"cvc": "",
"country": "",
"state": "",
"city": "",
"postal": "",
"email": "",
}

// this.onChange=this.onChange.bind(this);
//this.onSubmit=this.onSubmit.bind(this);
}

Payment(){

const RequestObject = {
"cardNumber": this.state.cardNumber,
"nameonCard": this.state.nameonCard,
"expirationDate": this.state.expirationDate,
"cvc": this.state.cvc,
"country": this.state.country,
"state": this.state.state,
"city": this.state.city,
"postal": this.state.emailValue,
"email": this.state.email,
}
fetch("https://localhost:44311/api/PayPal", {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(RequestObject)
}).then(function(response) {
return response.json();
}).catch(function(data) {
});

}

render() {
return (

<div className="App">
<div>

<form>
<h>Donation details</h><br/>
Amount &nbsp;<input type="text" name="Amount" placeholder="R50.00"/><br/>


<p><b>Organisation</b><br/> Please choose your organisation of choice</p>

<br/>
Organisation Name &nbsp;<input type="checkbox" name="SecondOrganisation" size="50%" />&nbsp;
<navItem>
<NavLink to="/register" ><button>view more</button></NavLink>
</navItem><br/><br/>
Organisation Name &nbsp;<input type="checkbox" name="SecondOrganisation" size="50%" />&nbsp;
<navItem>
<NavLink to="/register" ><button>view more</button></NavLink>
</navItem>
</form>


<form>
<h>Payments</h><br/>
Credit card number&nbsp;<input type="number" name="card number" placeholder="1234567890"/><br/><br/>
Expiration date&nbsp;<input type="date" name="ExpDate" placeholder="1234567890"/><br/><br/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expiration field of credit cards is usually made of the month and the year in two separated fields.
e.g: exp month: MM || exp year: YYYY

Security code&nbsp;<input type="password" name="SecurityCode" placeholder="****"/><br/><br/>
<nav>
<navItem>
<NavLink to="/donationSuccess" ><button>click me for payment</button></NavLink>
</navItem><hr />
</nav>

</form>



</div>
</div>



);
}
}

export default donation;
{/* <form>
<FormGroup controlId="CardNumber" >
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove your GC codes here too.

<label>Card Number</label>
<input type="text" name="cardNumber" id="us" placeholder="Card number" />

</FormGroup>
<FormGroup controlId="nameonCard" >
<label>Nameoncard</label>
<input type="text" name="nameonCard" id="us" placeholder="Name on Card" />

</FormGroup>
<FormGroup controlId="nameonCardID" >
<label>Experation Date</label>
<input type="text" name="expirationDate" id="us" placeholder="Expiration Date" />

</FormGroup>
<FormGroup controlId="cvcID" >
<label>CVC</label>
<input type="text" name="cvc" id="us" placeholder="CVC" />

</FormGroup>
<FormGroup controlId="Country">
<label>Country</label>
<input name="country" name="cvc" id="us" placeholder="Country " />

</FormGroup>
<FormGroup controlId="State">
<label>State</label>
<input name="state" type="text" id="us" placeholder="State" />

</FormGroup>
<FormGroup controlId="City">
<label>city</label>
<input name="city" type="text" id="us" placeholder="City" />

</FormGroup>
<FormGroup controlId="Postal">
<label>Postal</label>
<input type="text" name="postal" id="us" placeholder="Postal" />

</FormGroup>
<FormGroup controlId="Email">
<label>Email</label>
<input type="text" name="email" id="us" placeholder="name@mail.com" />

</FormGroup>
<Button onClick={this.Payment} >Submit</Button>
</form> */}
47 changes: 47 additions & 0 deletions src/js/components/DonationPage/DonationSuccess.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

import React, { Component } from "react";

import renderHTML from 'react-render-html';
import { Container, Col,FormGroup, Label, Input, Button, Form} from 'reactstrap';
//import { validatePassword, validateEmail, validateUsername } from './Validators.js';
import { BrowserRouter, Route, Switch, NavLink } from "react-router-dom";
/* <form>
Amount : <input type="text" id="AmountID" /><br/>
Organisation : <input type="checkbox" id="Org_One" /><Button variant="secondary"> View more </Button><br/>
Organisation : <input type="checkbox" id="Org_One" /><Button variant="secondary">View more </Button><br/>
</form>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<label>Payment </label>
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="WR3NGAATKPUWS" />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" border="0" src="https://www.paypal.com/en_ZA/i/scr/pixel.gif" width="1" height="1" />
</form>
*/
class donationSuccess extends Component {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have so many spaces between your elements.

How does it look like?

Exactly like this!

Is it ok?

No!

Please make sure that you have few of them.



render() {
return (

<div className="App">
<div>


<h>Thank you</h><br/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which h is this tag?
h1, h2, h3, h4, h5 or h6?




<button type="submit" variant="primary">Browse Books</button><br/><button type="submit" variant="primary">Share</button>

</div>
</div>



);
}
}

export default donationSuccess;
29 changes: 29 additions & 0 deletions src/js/components/DonationPage/paypal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link type="text/css" rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="http://cdn.rawgit.com/odra/ng-json-explorer/master/dist/angular-json-explorer.min.css"/>
<link rel="stylesheet" type="text/css" href="css/ngFormBuilder-complete.css"/>
</head>
<body>
<form id="default_form" runat="server" ng-app="paypalApp" ng-controller="paypalAppCtrl">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<div class="well" style="background-color: #fff;">
<formio form="form"></formio>
</div>
</div>
</div>
</form>
</body>
<script src="http://code.jquery.com/jquery-1.12.4.js" type="text/javascript"></script>
<script src="https://cdn.ckeditor.com/4.5.11/standard/ckeditor.js"></script>
<script src="https://unpkg.com/signature_pad@1.5.3/signature_pad.min.js"></script>
<script src="Scripts/ngFormBuilder-full.js"></script>
<script src="https://cdn.rawgit.com/odra/ng-json-explorer/master/dist/angular-json-explorer.min.js"></script>

<script type="text/javascript" src="http://www.google.com/recaptcha/api.js?onload=reCAPTCHALoad&render=explicit"></script>

<script src="Scripts/paypalclient.js"></script>
</html>