Skip to content
This repository has been archived by the owner on Mar 26, 2023. It is now read-only.

Commit

Permalink
ssrReveal option
Browse files Browse the repository at this point in the history
  • Loading branch information
rnosov committed Mar 6, 2018
1 parent 2bdaedd commit c7d9f60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-reveal",
"version": "1.2.0-beta.3",
"version": "1.2.1",
"author": "Roman Nosov <rnosov@gmail.com>",
"description": "Really simple way to add reveal on scroll animation to your React app.",
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions src/RevealBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const
mountOnEnter: bool,
inEffect: inOut.isRequired,
outEffect: oneOfType([ inOut, oneOf([ false ]) ]).isRequired,
alwaysReveal: bool,
ssrReveal: bool,
collapseOnly: bool,
ssrFadeout: bool,
},
Expand Down Expand Up @@ -89,7 +89,7 @@ class RevealBase extends React.Component {
? RevealBase.getInitialCollapseStyle(props)
: void 0,
style: {
opacity: (!this.isOn||props.alwaysReveal) && props.outEffect ? 0 : void 0,
opacity: (!this.isOn||props.ssrReveal) && props.outEffect ? 0 : void 0,
//visibility: props.when ? 'visible' : 'hidden',
},
};
Expand Down Expand Up @@ -304,7 +304,7 @@ class RevealBase extends React.Component {
const parentGroup = this.context.transitionGroup;
const appear = parentGroup && !parentGroup.isMounting ? !('enter' in this.props && this.props.enter === false) : this.props.appear;
if (this.isOn && (((this.props.when !== undefined || this.props.spy !== undefined) && !appear)
|| (ssr && !fadeOutEnabled && !this.props.ssrFadeout && this.props.outEffect && !this.props.alwaysReveal && (RevealBase.getTop(this.el) < window.pageYOffset + window.innerHeight)))
|| (ssr && !fadeOutEnabled && !this.props.ssrFadeout && this.props.outEffect && !this.props.ssrReveal && (RevealBase.getTop(this.el) < window.pageYOffset + window.innerHeight)))
) {
this.isShown = true;
this.setState({
Expand Down

0 comments on commit c7d9f60

Please sign in to comment.