-
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.
Merge pull request #59 from psantos10/56_page_for_single_help_request
56 - Page for single help request
- Loading branch information
Showing
5 changed files
with
118 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React, { useEffect } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { useParams } from 'react-router-dom'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { loadHelp } from '../../store/helps/actions'; | ||
|
||
const HelpPage = (props) => { | ||
const { id } = useParams(); | ||
|
||
useEffect(() => { | ||
props.loadHelp(id); | ||
}, []); | ||
|
||
return ( | ||
<div className="container"> | ||
<br /> | ||
<h2 className="title" style={{ marginBottom: '0px' }}> | ||
{props.help.title} | ||
</h2> | ||
<p style={{ marginBottom: '15px' }}>{props.help.type}</p> | ||
|
||
<div>{props.help.description}</div> | ||
<br /> | ||
<button className="button">Oferecer Ajuda</button> | ||
<br /> | ||
<br /> | ||
<div className="tabs"> | ||
<ul> | ||
<li className="is-active"> | ||
<a>Ofertas de Ajuda Concluídas</a> | ||
</li> | ||
<li> | ||
<a>Ajudas Pendentes</a> | ||
</li> | ||
</ul> | ||
</div> | ||
<div>Em Desenvolvimento...</div> | ||
<br /> | ||
<br /> | ||
</div> | ||
); | ||
}; | ||
|
||
HelpPage.propTypes = {}; | ||
|
||
const mapStateToProps = (state) => { | ||
return { | ||
isLoading: state.helps.loading, | ||
errors: state.helps.errors, | ||
help: state.helps.currentHelp, | ||
}; | ||
}; | ||
|
||
const mapDispatchToProps = (dispatch) => { | ||
return { | ||
loadHelp: (id) => dispatch(loadHelp(id)), | ||
}; | ||
}; | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(HelpPage); |
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,3 @@ | ||
import HelpPage from './HelpPage'; | ||
|
||
export default HelpPage; |
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