Last active
February 9, 2018 19:55
-
-
Save jrwebdev/730242600799ec61375fd024a6796a4b to your computer and use it in GitHub Desktop.
withBlueBackground Subtract
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Subtract } from 'utility-types'; | |
| const withBlueBackground = <P extends InjectedBlueBackgroundProps>( | |
| UnwrappedComponent: React.ComponentType<P> | |
| ) => | |
| class WithBlueBackground extends React.Component< | |
| Subtract<P, InjectedBlueBackgroundProps> & WithBlueBackgroundProps | |
| > { | |
| render() { | |
| const { shade, ...props } = this.props; | |
| return ( | |
| <UnwrappedComponent {...props} backgroundColor={getBlueShade(shade)} /> | |
| ); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment