0.3.9 • Published 1 year ago
screen-cover v0.3.9
Screen-Cover
How to use
- Wrap you app with ScreenCoverProvider;
- Get showCover function from context and run it.
<ScreenCoverProvider>
<App />
</ScreenCoverProvider>
const { showCover } = useScreenCover()
const handleClick = () => showCover(goToPageTwo, onEnd)
showCover receives onCover function (will be run once whole page is covered) and onEnd function (runs after animation is finished).
Class components
Use HOC withScreenCover which will pass showCover to props:
type Props = WithScreenCoverProps & OtherProps
class PageClass extends Component<Props> {...}
export default withScreenCover(PageClass)
Customisations
You can pass config to ScreenCoverProvider:
const screenCoverConfig = {
coverTime: 500,
uncoverTime: 4000,
backgroundColor: "red"
}
...
<ScreenCoverProvider config={screenCoverConfig}>
<App />
</ScreenCoverProvider>
All config properties are optional. You can also pass config to showCover to overwrite global config for selected call:
const showGreenCover = () => showCover(goToPageThree, undefined, { backgroundColor: "aquamarine" })
0.3.9
1 year ago
0.3.6
1 year ago
0.3.5
1 year ago
0.3.8
1 year ago
0.3.7
1 year ago
0.3.2
1 year ago
0.3.1
1 year ago
0.3.4
1 year ago
0.3.3
1 year ago
0.3.0
2 years ago
0.2.10
3 years ago
0.2.1
3 years ago
0.2.7
3 years ago
0.2.6
3 years ago
0.2.9
3 years ago
0.2.8
3 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.5
3 years ago
0.2.4
3 years ago
0.2.0
3 years ago
0.1.7
3 years ago
0.1.4
3 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago