-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/dev' into move-reply-to-hooks
- Loading branch information
Showing
57 changed files
with
177 additions
and
238 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 was deleted.
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
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
53 changes: 12 additions & 41 deletions
53
src/components/CompanyAndJobTitle/TimeAndSalary/ViewLog.js
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,54 +1,25 @@ | ||
import { Component } from 'react'; | ||
import { useEffect } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { connect } from 'react-redux'; | ||
import { bindActionCreators } from 'redux'; | ||
import { useViewSalaryWorkTimes } from 'hooks/viewLog'; | ||
|
||
import { viewSalaryWorkTimes } from '../../../actions/viewLog'; | ||
|
||
class ViewLog extends Component { | ||
componentDidMount() { | ||
const { contentIds } = this.props; | ||
const ViewLog = ({ pageName, page, contentIds }) => { | ||
// Send view to backend | ||
const viewSalaryWorkTimes = useViewSalaryWorkTimes(); | ||
useEffect(() => { | ||
const referrer = window.location.href; | ||
viewSalaryWorkTimes({ contentIds, referrer }); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [pageName, page, viewSalaryWorkTimes]); | ||
|
||
this.props.viewSalaryWorkTimes({ contentIds, referrer }); | ||
} | ||
|
||
componentDidUpdate(prevProps) { | ||
const prevPageName = prevProps.pageName; | ||
const prevPage = prevProps.page; | ||
const pageName = this.props.pageName; | ||
const page = this.props.page; | ||
|
||
if (prevPageName !== pageName || prevPage !== page) { | ||
const { contentIds } = this.props; | ||
const referrer = window.location.href; | ||
|
||
this.props.viewSalaryWorkTimes({ contentIds, referrer }); | ||
} | ||
} | ||
|
||
render() { | ||
return null; | ||
} | ||
} | ||
return null; | ||
}; | ||
|
||
ViewLog.propTypes = { | ||
// key | ||
pageName: PropTypes.string.isRequired, | ||
page: PropTypes.number.isRequired, | ||
|
||
contentIds: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
|
||
// method | ||
viewSalaryWorkTimes: PropTypes.func.isRequired, | ||
}; | ||
|
||
const mapStateToProps = state => ({}); | ||
|
||
const mapDispatchToProps = dispatch => | ||
bindActionCreators({ viewSalaryWorkTimes }, dispatch); | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
)(ViewLog); | ||
export default ViewLog; |
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
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.