Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Only do waypoint if rendering all reference pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcuva committed Nov 27, 2018
1 parent f87fb13 commit 6249385
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/api-explorer/src/Doc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,18 @@ class Doc extends React.Component {
const { doc } = this.props;
const oas = this.oas;

const renderPage = () => {
if (this.props.appearance.splitPages) {
return this.renderEndpoint();
} else {
return (
<Waypoint onEnter={this.waypointEntered} fireOnRapidScroll={false} bottomOffset="-1%">
{this.state.showEndpoint && this.renderEndpoint()}
</Waypoint>
);
}
}

return (
<div className="hub-reference" id={`page-${doc.slug}`}>
{
Expand Down Expand Up @@ -326,9 +338,8 @@ class Doc extends React.Component {
<div className="hub-reference-right">&nbsp;</div>
</div>

<Waypoint onEnter={this.waypointEntered} fireOnRapidScroll={false} bottomOffset="-1%">
{this.state.showEndpoint && this.renderEndpoint()}
</Waypoint>
{ renderPage() }


{
// TODO maybe we dont need to do this with a hidden input now
Expand Down

0 comments on commit 6249385

Please sign in to comment.