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
19,229 changes: 11,542 additions & 7,687 deletions client/package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@
"name": "client",
"version": "0.1.0",
"private": true,
"proxy": {
"/auth/google": {
"target": "http://localhost:5000"
},
"/api/*": {
"target": "http://localhost:5000"
}
},
"dependencies": {
"axios": "^0.18.0",
"body-parser": "^1.18.3",
"http-proxy-middleware": "^0.19.1",
"materialize-css": "^1.0.0",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-number-format": "^3.6.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.5",
"react-scripts": "^2.1.1",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
},
Expand All @@ -27,5 +21,11 @@
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
2 changes: 2 additions & 0 deletions client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Landing from "./Landing";
import Profile from "./Profile";
import Type from "./Type";
import Projects from "./Project";
import Donor from "./Donor"

class App extends Component {
componentDidMount() {
Expand All @@ -23,6 +24,7 @@ class App extends Component {
<Route exact path="/" component={Landing} />
<Route exact path="/projects" component={Projects} />
<Route path="/type" component={Type} />
<Route exact path="/donor" component={Donor} />
{/* <Route path="/projects/new" component={ProjectsNew} /> */}
<Route path="/user_profile" component={Profile} />
</div>
Expand Down
16 changes: 8 additions & 8 deletions client/src/components/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ class Card extends Component {
render() {
return (
<div className="container">
<div className="overlay"></div>
<div className="overlay"></div>
<div className="row">
<div className="col s4">
<div className="card hoverable center-align">
<div className="card-image">
<img src="https://www.gannett-cdn.com/-mm-/959b8a0d077ef37a2f32651fca1907698404cf74/c=0-62-580-388/local/-/media/2018/07/02/USATODAY/usatsports/MotleyFool-TMOT-87cfe4f6-charity_large.jpg?width=3200&height=1680&fit=crop" alt="image"/>
<img src="https://www.gannett-cdn.com/-mm-/959b8a0d077ef37a2f32651fca1907698404cf74/c=0-62-580-388/local/-/media/2018/07/02/USATODAY/usatsports/MotleyFool-TMOT-87cfe4f6-charity_large.jpg?width=3200&height=1680&fit=crop" alt="image" />
<div className="card-title">
Card Title
</div>
<div className="card-content">
<p>Description</p>
<p>I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.</p>
<p> Target: x out of x dollars</p>
<span>Donate: <input type='text'></input></span>
<p>Description</p>
<p>I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.</p>
<p> Target: x out of x dollars</p>
<span>Donate: <input type='text'></input></span>
</div>
</div>
</div>
Expand All @@ -27,7 +27,7 @@ class Card extends Component {
<div className="col s4">
<div className="card hoverable">
<div className="card-image">
<img src="https://www.gannett-cdn.com/-mm-/959b8a0d077ef37a2f32651fca1907698404cf74/c=0-62-580-388/local/-/media/2018/07/02/USATODAY/usatsports/MotleyFool-TMOT-87cfe4f6-charity_large.jpg?width=3200&height=1680&fit=crop" alt="image"/>
<img src="https://www.gannett-cdn.com/-mm-/959b8a0d077ef37a2f32651fca1907698404cf74/c=0-62-580-388/local/-/media/2018/07/02/USATODAY/usatsports/MotleyFool-TMOT-87cfe4f6-charity_large.jpg?width=3200&height=1680&fit=crop" alt="image" />
{/* <a className="btn-floating halfway-fab waves-effect waves-light red"><i class="material-icons">add</i></a> */}
</div>
<div className="card-title center-align">
Expand All @@ -42,7 +42,7 @@ class Card extends Component {
<div className="col s4">
<div className="card hoverable">
<div className="card-image">
<img src="https://www.gannett-cdn.com/-mm-/959b8a0d077ef37a2f32651fca1907698404cf74/c=0-62-580-388/local/-/media/2018/07/02/USATODAY/usatsports/MotleyFool-TMOT-87cfe4f6-charity_large.jpg?width=3200&height=1680&fit=crop" alt="image"/>
<img src="https://www.gannett-cdn.com/-mm-/959b8a0d077ef37a2f32651fca1907698404cf74/c=0-62-580-388/local/-/media/2018/07/02/USATODAY/usatsports/MotleyFool-TMOT-87cfe4f6-charity_large.jpg?width=3200&height=1680&fit=crop" alt="image" />
{/* <a className="btn-floating halfway-fab waves-effect waves-light red"><i class="material-icons">add</i></a> */}
</div>
<div className="card-title center-align">Card Title</div>
Expand Down
23 changes: 23 additions & 0 deletions client/src/components/Donor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import DonorInfo from "./DonorInfo";
import "./donor.css"

class Donor extends Component {
render() {
return (
<div id="donor" className="container">
<div className="row">
<h5>Thank you for signing up using Google, {this.props.auth.userName}, please fill out the following information in order to complete your SevaFund profile</h5>
<DonorInfo />
</div>
</div>
);
}
}

function mapStateToProps({ auth }) {
return { auth };
}

export default connect(mapStateToProps)(Donor);
159 changes: 159 additions & 0 deletions client/src/components/DonorInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import React, { Component } from "react";
import NumberFormat from "react-number-format";
import axios from "axios";

class DonorInfo extends Component {
constructor(props) {
super(props);
this.state = {
address: "",
city: "",
$state: "",
zipcode: "",
phone: "",
email: ""
};

this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.emptyForm = this.emptyForm.bind(this);

}

handleChange(event) {
const { name, value } = event.target;
this.setState({
[event.target.name]: event.target.value
});
}

//empty form after submit
emptyForm(event) {
this.setState({
address: "",
city: "",
$state: "",
zipcode: "",
phone: "",
email: ""
})
}

//handle the submit
handleSubmit(event) {
event.preventDefault();

const payload = {
address: this.state.address,
city: this.state.city,
$state: this.state.$state,
zipcode: this.state.zipcode,
phone: this.state.phone,
email: this.state.email,
}

console.log(payload);

axios.post("/api/new_donor", payload)
.then(res => {
console.log(res);
console.log(res.data);
});

//run emptyForm
this.emptyForm()
}

render() {
return (
<div className="row">
<form className="col s12" onSubmit={this.handleSubmit}>
<div className="row">
<div className="input-field col s6">
<input
value={this.state.address}
name="address"
onChange={this.handleChange}
id="address"
type="text"
className="validate"
/>
<label htmlFor="address">Address</label>
</div>
</div>
<div className="row">
<div className="input-field col s3">
<input
value={this.state.city}
name="city"
onChange={this.handleChange}
id="city"
type="text"
className="validate"
/>
<label htmlFor="address">City</label>
</div>

<div className="input-field col s3">
<input
value={this.state.$state}
name="$state"
onChange={this.handleChange}
id="$state"
type="text"
className="validate"
/>
<label htmlFor="address">State</label>
</div>
<div className="input-field col s3">
<input
value={this.state.zipcode}
name="zipcode"
onChange={this.handleChange}
id="zipcode"
type="text"
className="validate"
/>
<label htmlFor="address">Zipcode</label>
</div>
</div>
<div className="row">
<div className="input-field col s4">
<NumberFormat
format="+1 (###) ###-####"
value={this.state.phone}
name="phone"
onChange={this.handleChange}
id="phone"
/>
<label htmlFor="phone">Phone Number</label>
</div>

<div className="row">
<div className="input-field col s4">
<input
value={this.state.email}
name="email"
onChange={this.handleChange}
id="email"
type="text"
className="validate"
/>
<label htmlFor="email">Email</label>
</div>
</div>
</div>
<button
className="btn waves-effect waves-light"
type="submit"
name="action"
>
Submit
</button>
</form>
</div>
);
}
}

export default DonorInfo;
3 changes: 2 additions & 1 deletion client/src/components/Landing.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from "react";
import "./landing.css";

const Landing = () => {
return (
<div>
<div className="main">
<h1>Welcome to SevaFund</h1>
</div>
);
Expand Down
Loading