Created
February 15, 2018 03:16
-
-
Save persianturtle/b5bd892506e60c7dd40cf649e534f30b to your computer and use it in GitHub Desktop.
partial from render field
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
let x = List.hd(List.rev(self.state.nav.position)); | |
let x' = List.hd(self.state.nav.position); | |
... | |
<nav | |
className=(self.state.nav.isOpen ? "active" : "") | |
onClick=(event => ReactEventRe.Mouse.stopPropagation(event)) | |
style=( | |
self.state.nav.isSwiping^ ? | |
ReactDOMRe.Style.make( | |
~transform= | |
"translateX(" | |
++ string_of_float(x' -. x > 0.0 ? 0.0 : x' -. x) | |
++ "px)", | |
~transition="none", | |
() | |
) : | |
ReactDOMRe.Style.make() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment