mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Project Aphrodite
This commit is contained in:
25
frontend/src/Components/withCurrentPage.js
Normal file
25
frontend/src/Components/withCurrentPage.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
|
||||
function withCurrentPage(WrappedComponent) {
|
||||
function CurrentPage(props) {
|
||||
const {
|
||||
history
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<WrappedComponent
|
||||
{...props}
|
||||
useCurrentPage={history.action === 'POP'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
CurrentPage.propTypes = {
|
||||
history: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
return CurrentPage;
|
||||
}
|
||||
|
||||
export default withCurrentPage;
|
Reference in New Issue
Block a user