renderInjection() { var injection = qs.parse(window.location.search).injection return <div className='injection' dangerouslySetInnerHTML={{ __html: injection }} /> }
render() { if (this.state.show) { if (typeof this.state.qs.added !== 'undefined') { return (<FlashMassage show={this.state.show} duration={4500} persistOnHover={true}><Alert bsStyle="success" onClick={this.handleClose}><p>Item added.</p></Alert></FlashMassage>) } else if(typeof this.state.qs.updated !== 'undefined') { return (<FlashMassage show={this.state.show} duration={4500} persistOnHover={true}><Alert bsStyle="success" onClick={this.handleClose}><p>Item updated.</p></Alert></FlashMassage>) } else if(typeof this.state.qs.deleted !== 'undefined') { return (<FlashMassage show={this.state.show} duration={4500} persistOnHover={true}><Alert bsStyle="warning" onClick={this.handleClose}><p>Item removed.</p></Alert></FlashMassage>) } else { return '' } } else { return '' } }
/** * * 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="/" /> }