Implemented offline indicator

This commit is contained in:
Jori Lallo
2016-08-19 08:02:56 -07:00
parent e3e5ead9e0
commit 8fb88529a0
5 changed files with 108 additions and 27 deletions

View File

@ -0,0 +1,19 @@
import React from 'react';
const injectOffline = (WrappedComponent) => {
return class OfflineWrapper extends React.Component {
static contextTypes = {
offline: React.PropTypes.bool,
};
render() {
const newProps = {
offline: this.context.offline,
};
return (<WrappedComponent { ...this.props } { ...newProps } />);
}
};
};
export default injectOffline;