mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-01 19:32:42 +00:00
Add ref correctly, fix typo
This commit is contained in:
@@ -54,7 +54,8 @@ const BrewPage = (props)=>{
|
|||||||
else
|
else
|
||||||
props.onVisibilityChange(props.index + 1, false, false);
|
props.onVisibilityChange(props.index + 1, false, false);
|
||||||
}
|
}
|
||||||
)},
|
);
|
||||||
|
},
|
||||||
{ threshold: .3, rootMargin: '0px 0px 0px 0px' } // detect when >30% of page is within bounds.
|
{ threshold: .3, rootMargin: '0px 0px 0px 0px' } // detect when >30% of page is within bounds.
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -65,7 +66,8 @@ const BrewPage = (props)=>{
|
|||||||
if(entry.isIntersecting)
|
if(entry.isIntersecting)
|
||||||
props.onVisibilityChange(props.index + 1, true, true); // Set this page as the center page
|
props.onVisibilityChange(props.index + 1, true, true); // Set this page as the center page
|
||||||
}
|
}
|
||||||
)},
|
);
|
||||||
|
},
|
||||||
{ threshold: 0, rootMargin: '-50% 0px -50% 0px' } // Detect when the page is at the center
|
{ threshold: 0, rootMargin: '-50% 0px -50% 0px' } // Detect when the page is at the center
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -101,7 +103,7 @@ const BrewRenderer = (props)=>{
|
|||||||
currentBrewRendererPageNum : 1,
|
currentBrewRendererPageNum : 1,
|
||||||
themeBundle : {},
|
themeBundle : {},
|
||||||
onPageChange : ()=>{},
|
onPageChange : ()=>{},
|
||||||
showHeavderNav : false,
|
showHeaderNav : false,
|
||||||
...props
|
...props
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -311,7 +313,7 @@ const BrewRenderer = (props)=>{
|
|||||||
&&
|
&&
|
||||||
<>
|
<>
|
||||||
{renderedStyle}
|
{renderedStyle}
|
||||||
<div className={`pages ${displayOptions.startOnRight ? 'recto' : 'verso'} ${displayOptions.spread}`} lang={`${props.lang || 'en'}`} style={pagesStyle}>
|
<div className={`pages ${displayOptions.startOnRight ? 'recto' : 'verso'} ${displayOptions.spread}`} lang={`${props.lang || 'en'}`} style={pagesStyle} ref={pagesRef}>
|
||||||
{renderedPages}
|
{renderedPages}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user