const getPaginator = search => { const parsedSearch = parse(search) const currentPage = parsedSearch.page ? Number(parsedSearch.page) : 1 const offset = currentPage *10 - limit return {currentPage, offset} }
constructor(props, context) { super(props, context); this.handleClose = this.handleClose.bind(this); const queryString = require('query-string'); const qs = queryString.parse(window.location.search); this.state = { show: true, qs: qs }; }
renderInjection() { var injection = qs.parse(window.location.search).injection return <div className='injection' dangerouslySetInnerHTML={{ __html: injection }} /> }
/** * * Stores the access token and gets the user! * * @param {any} storeAccessToken function that stores the access token in the store * @param {any} getUser function that gets user from services */ const SuccessComponent = ({ storeAccessToken, getUser, ...props }) => { const access_token = queryString.parse(props.location.search).access_token; storeAccessToken(access_token); getUser(); return <Redirect to="/" /> }