Guest User

Untitled

a guest
Jun 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. const injectSheetConditionally = (BaseComponent) => {
  2. const WrappedComponent = (props) => {
  3. let finalStyles = styles;
  4.  
  5. if (props.style === 'vertical') {
  6. finalStyles = mergeDeepRight(styles, verticalStyles);
  7. } else {
  8. finalStyles = mergeDeepRight(styles, horizontalStyles);
  9. }
  10.  
  11. return React.createElement(
  12. injectSheet(finalStyles)(BaseComponent),
  13. props,
  14. );
  15. }
  16.  
  17. return WrappedComponent;
  18. }
  19.  
  20. export default injectSheetConditionally(InfluencerSimilars);
Add Comment
Please, Sign In to add comment