-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- modify the getuser's recipe controller - modify the get all recipes controller - create the controller for updating user profile - redesign ui for reviews - redesign ui for user recipes
- Loading branch information
Showing
23 changed files
with
568 additions
and
384 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import Modal from 'react-modal'; | ||
|
||
const FavoriteModal = props => ( | ||
<Modal | ||
isOpen={!!props.selectedFavorite} | ||
onRequestClose={props.handleClearFavoriteRecipe} | ||
closeTimeoutMS={300} | ||
className="modal-class" | ||
ariaHideApp={false} | ||
> | ||
<h3> Remove recipe from list of favorites?</h3> | ||
<div className="group-btn"> | ||
<button | ||
className="btn btn-danger user-btn" | ||
onClick={props.removeFavorite} | ||
> | ||
Yes | ||
</button> | ||
<button | ||
className="btn user-btn" | ||
onClick={props.handleClearFavoriteRecipe} | ||
> | ||
No | ||
</button> | ||
</div> | ||
</Modal> | ||
); | ||
|
||
export default FavoriteModal; |
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,32 @@ | ||
import React from 'react'; | ||
import Modal from 'react-modal'; | ||
|
||
const DeleteModal = props => ( | ||
<Modal | ||
isOpen={!!props.selectedRecipe} | ||
contentLabel="Delete Recipe?" | ||
onRequestClose={props.handleClearSelectedRecipe} | ||
closeTimeoutMS={300} | ||
className="modal-class" | ||
ariaHideApp={false} | ||
> | ||
<h3 className="modal-ptag"> Delete Recipe? </h3> | ||
<p className="modal-ptag"> Do you want to delete this recipe?</p> | ||
<div className="group-btn"> | ||
<button | ||
className="btn btn-danger user-btn" | ||
onClick={props.onRemoveRecipe} | ||
> | ||
Yes | ||
</button> | ||
<button | ||
className="btn user-btn" | ||
onClick={props.handleClearSelectedRecipe} | ||
> | ||
No | ||
</button> | ||
</div> | ||
</Modal> | ||
); | ||
|
||
export default DeleteModal; |
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,29 +1,41 @@ | ||
import React from 'react'; | ||
import React, { Component } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import Footer from './Footer'; | ||
import { startGetUserInfo } from '../actions/signinRequest'; | ||
import { getUserInformation } from '../actions/signinRequest'; | ||
import cool from '../assets/img/cooll.jpg'; | ||
|
||
const ProfilePage = props => ( | ||
<div> | ||
class ProfilePage extends Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
componentDidMount() { | ||
getUserInformation(this.props.userInformation.id) | ||
} | ||
render() { | ||
return ( | ||
<div> | ||
<main className="container"> | ||
<h1 className="profile-h1">My Profile</h1> | ||
<div className="profile-card"> | ||
<img src={cool} alt="John" className="profile-image" /> | ||
<p className="profile-email">Username</p> | ||
<p className="prop-username"> {props.userInformation.username} </p> | ||
<p className="prop-username"> {this.props.userInformation.username} </p> | ||
<p className="profile-email">Email Address</p> | ||
<p className="prop-email"> {props.userInformation.emailAddress} </p> | ||
<p className="prop-email"> {this.props.userInformation.emailAddress} </p> | ||
</div> | ||
</main> | ||
<Footer /> | ||
</div> | ||
); | ||
) | ||
} | ||
}; | ||
|
||
const mapStateToProps = (state, props) => { | ||
console.log('user details', state); | ||
return { | ||
userInformation: state.auth.user | ||
}; | ||
}; | ||
|
||
export default connect(mapStateToProps, { startGetUserInfo })(ProfilePage); | ||
|
||
export default connect(mapStateToProps, { getUserInformation })(ProfilePage); |
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,6 +1,5 @@ | ||
const recipeDefaultState = { | ||
pages: 0, | ||
voters: 0, | ||
recipes: [], | ||
userRecipe: [], | ||
singleRecipe: '', | ||
|
Oops, something went wrong.