Transition.js 543 Bytes
Newer Older
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
1 2 3 4 5 6
const React = require("react-native");
const GL = require("gl-react-native");

class Transition extends React.Component {
  render () {
    const { width, height, shader, progress, from, to, uniforms } = this.props;
7
    const scale = React.PixelRatio.get();
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
8 9 10 11 12 13 14 15
    return <GL.View
      shader={shader}
      style={{ width, height }}
      opaque={false}
      uniforms={{
        progress,
        from,
        to,
16 17
        ...uniforms,
        resolution: [ width * scale, height * scale ]
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
18 19 20 21 22 23
      }}
    />;
  }
}

module.exports = Transition;