This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/frontend/components/Offline/injectOffline.js
2016-08-19 08:02:56 -07:00

20 lines
408 B
JavaScript

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;