re-structure to monorepo.

This commit is contained in:
a.bouhuolia
2023-02-03 01:02:31 +02:00
parent 8242ec64ba
commit 7a0a13f9d5
10400 changed files with 46966 additions and 17223 deletions

View File

@@ -0,0 +1,7 @@
// @ts-nocheck
import { connect } from "react-redux";
import { withRouter } from "react-router-dom"
export default (mapState) => {
return () => withRouter ;
};

View File

@@ -0,0 +1,32 @@
// @ts-nocheck
import { connect } from 'react-redux';
const mapDispatchToProps = (dispatch, props) => {
return {
addQuery: (key, value) => {
let pathname = props.location.pathname;
let searchParams = new URLSearchParams(props.location.search);
searchParams.set(key, value);
props.history.push({
pathname: pathname,
search: searchParams.toString(),
});
},
removeQuery: (key) => {
let pathname = props.location.pathname;
let searchParams = new URLSearchParams(props.location.search);
// returns the existing query string: '?type=fiction&author=fahid'
searchParams.delete(key);
props.history.push({
pathname: pathname,
search: searchParams.toString(),
});
},
}
}
export default connect(null, mapDispatchToProps)