-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
336 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,111 @@ | ||
import React from 'react'; | ||
import Rayon from 'rayon'; | ||
import user from './../models/UserModel'; | ||
import {browserHistory} from 'react-router'; | ||
import $ from 'jquery'; | ||
|
||
export default React.createClass({ | ||
getInitialState: function() { | ||
return { | ||
regModalVisible: false, | ||
regModalVisible: false, | ||
user: user | ||
}; | ||
}, | ||
componentDidMount: function() { | ||
this.state.user.on('change', () => { | ||
this.setState({ | ||
user: user | ||
}); | ||
}); | ||
}, | ||
render: function() { | ||
return ( | ||
<h3 className="header">Header</h3> | ||
<div> | ||
<div className="navBar"> | ||
<div className="logoDiv"> | ||
<h3 className="homeFinderLogo navLeft">Logo Goes Here</h3> | ||
<h3 className="homeFinderName navLeft">Home Finder Lite</h3> | ||
</div> | ||
<div className="navLinks"> | ||
<a className="navLink" onClick={this.regOpenModal}>Sign Up</a> | ||
<a className="navLink" onClick={this.logOpenModal}>Sign In</a> | ||
<a className="navLink" onClick={this.logout}>Sign Out</a> | ||
</div> | ||
</div> | ||
<Rayon className="regForm" isOpen={this.state.regModalVisible} onClose={this.regCloseModal}> | ||
<form action="/auth/register" method="post"> | ||
<div> | ||
<input type="text" placeholder="first name" name="firstName"/> | ||
</div> | ||
<div> | ||
<input type="text" placeholder="last name" name="lastName"/> | ||
</div> | ||
<div> | ||
<input type="text" placeholder="phone" name="phone"/> | ||
</div> | ||
<div> | ||
<input type="email" placeholder="email" name="email"/> | ||
</div> | ||
<div> | ||
<input type="text" placeholder="bio" name="bio"/> | ||
</div> | ||
<div> | ||
<input type="password" placeholder="password" name="password"/> | ||
</div> | ||
<button>Register</button> | ||
</form> | ||
<button onClick={this.regCloseModal}>Cancel</button> | ||
</Rayon> | ||
<Rayon className="loginForm" isOpen={this.state.logModalVisible} onClose={this.logCloseModal}> | ||
<form action="auth/login" method="post"> | ||
<div> | ||
<input type="email" placeholder="email" name="email"/> | ||
</div> | ||
<div> | ||
<input type="password" placeholder="password" name="password"/> | ||
</div> | ||
<button>Log in</button> | ||
</form> | ||
<button onClick={this.logCloseModal}>Cancel</button> | ||
</Rayon> | ||
</div> | ||
); | ||
}, | ||
regOpenModal: function() { | ||
this.setState({ | ||
regModalVisible: true | ||
}); | ||
console.log(this.state.user.get('id')); | ||
}, | ||
regCloseModal: function() { | ||
this.setState({ | ||
regModalVisible: false | ||
}); | ||
console.log(this.state.user.get('id')); | ||
|
||
}, | ||
logOpenModal: function() { | ||
this.setState({ | ||
logModalVisible: true | ||
}); | ||
console.log(this.state.props.user); | ||
|
||
}, | ||
logCloseModal: function() { | ||
this.setState({ | ||
logModalVisible: false | ||
}); | ||
console.log(this.state.props.user); | ||
|
||
}, | ||
logout: function(e) { | ||
e.preventDefault(); | ||
this.state.user.clear(); | ||
$.ajax({ | ||
type: 'POST', | ||
url: '/auth/logout' | ||
}); | ||
browserHistory.push('/'); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React from 'react'; | ||
import ListingCollection from './../collections/ListingCollection.js'; | ||
|
||
export default React.createClass({ | ||
getInitialState: function() { | ||
return {formData: {}}; | ||
}, | ||
componentDidMount: function() { | ||
// check this.props.type to deteremine where to make the ajax request | ||
//make an ajax request and update state formData | ||
}, | ||
render: function() { | ||
return( | ||
<div> | ||
<form onChange={this.formChange}> | ||
<input type="text" placeholder="Address" value={this.state.formData.address} ref="address"/> | ||
<input type="text" placeholder="Price" value={this.state.formData.price} ref="price"/> | ||
<input type="text" placeholder="Beds" value={this.state.formData.beds} ref="beds"/> | ||
<input type="text" placeholder="Baths" value={this.state.formData.baths} ref="baths"/> | ||
<input type="text" placeholder="Square Feet" value={this.state.formData.sqft} ref="sqft"/> | ||
<input type="text" placeholder="Acres" value={this.state.formData.acres} ref="acres"/> | ||
<input type="text" placeholder="Property Type" value={this.state.formData.type} ref="type"/> | ||
<input type="text" placeholder="Stories" value={this.state.formData.stories} ref="stories"/> | ||
<input type="text" placeholder="Year Built" value={this.state.formData.year} ref="year"/> | ||
<input type="button" onClick={this.clearForm} value="Clear"/> | ||
<input type="button" onCLick={this.deleteHouse} value="Delete" /> | ||
<input type="button" onClick={this.handleSubmit} value="Submit"/> | ||
</form> | ||
</div> | ||
); | ||
}, | ||
formChange: function() { | ||
this.setState({formData: { | ||
address: this.refs.address.value, | ||
price: this.refs.price.value, | ||
beds: this.refs.beds.value, | ||
baths: this.refs.baths.value, | ||
sqft: this.refs.sqft.value, | ||
acres: this.refs.acres.value, | ||
type: this.refs.type.value, | ||
stories: this.refs.stories.value, | ||
year: this.refs.year.value | ||
}}); | ||
}, | ||
clearForm: function() { | ||
this.setState({formData: {}}); | ||
}, | ||
handleSubmit: function(e) { | ||
console.log(this.state.formData); | ||
e.preventDefault(); | ||
ListingCollection.save({ | ||
address: this.refs.address.value, | ||
price: this.refs.price.value, | ||
beds: this.refs.beds.value, | ||
baths: this.refs.baths.value, | ||
sqft: this.refs.sqft.value, | ||
acres: this.refs.acres.value, | ||
type: this.refs.type.value, | ||
stories: this.refs.stories.value, | ||
year: this.refs.year.value | ||
}); | ||
} | ||
}); | ||
|
||
// fetch data | ||
// this.props.params for route | ||
// react router documentation | ||
// if statements for which route to plug into fetch call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
export default React.createClass({ | ||
render: function() { | ||
return ( | ||
<div> | ||
<form> | ||
<input type="text" placeholder="Enter search terms"/> | ||
<input type="submit" value="Search"/> | ||
<input type="button" value="Clear"/> | ||
</form> | ||
</div> | ||
); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.