This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(decorator): Add responsive decorator (#14)
- Loading branch information
1 parent
747f9bb
commit efe70d9
Showing
4 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// @flow | ||
import React from "react"; | ||
import ResponsiveComponent from "./ResponsiveComponent"; | ||
|
||
export default function Responsive(WrapperComponent: ReactClass<*>): ReactClass<*> { | ||
return class ResponsiveComponentWrapper extends ResponsiveComponent { | ||
render(): React$Element<*> { | ||
return <WrapperComponent window={this.state.window} {...this.props} />; | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
// @flow | ||
import ResponsiveComponent from "./ResponsiveComponent"; | ||
import responsive from "./Responsive"; | ||
import {MediaQuery} from "./MediaQuery"; | ||
import ResponsiveStyleSheet from "./ResponsiveStyleSheet"; | ||
|
||
export { | ||
MediaQuery, | ||
ResponsiveComponent, | ||
ResponsiveStyleSheet | ||
ResponsiveStyleSheet, | ||
responsive | ||
} |