Skip to content

Commit

Permalink
fix(static-scene): mode prop is passed correctly & zoom feature is se…
Browse files Browse the repository at this point in the history
…t only for presentation
  • Loading branch information
ozsirmajotform committed Mar 3, 2023
1 parent 3caf4ab commit 6c045f5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/components/Presentation/Presentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const Presentation = ({
hashCode={hashCode}
hideZoom={true}
itemAccessor={itemAccessor}
mode="presentation"
pages={pages}
presentationPage={presentationPage}
/>
Expand Down
1 change: 1 addition & 0 deletions src/components/Preview/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const Preview = ({
isExistsZoom
itemAccessor={itemAccessor}
lastScrollPosition={lastScrollPosition}
mode="preview"
pages={pages}
/>
</ReportWrapper>
Expand Down
3 changes: 1 addition & 2 deletions src/components/Preview/StaticScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ StaticScene.propTypes = {
hideZoom: PropTypes.bool,
itemAccessor: PropTypes.func,
lastScrollPosition: PropTypes.number,
mode: PropTypes.string,
mode: PropTypes.string.isRequired,
pages: PropTypes.arrayOf(PropTypes.shape({})),
presentationPage: PropTypes.number,
};
Expand All @@ -143,7 +143,6 @@ StaticScene.defaultProps = {
hideZoom: false,
itemAccessor: () => {},
lastScrollPosition: 0,
mode: 'preview',
pages: [],
presentationPage: 0,
};
Expand Down
5 changes: 1 addition & 4 deletions src/components/Print/PrintModeWithoutContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const PrintModeWithoutContext = ({
additionalPageItems,
hashCode,
itemAccessor,
mode,
pages,
settings,
theme,
Expand Down Expand Up @@ -42,7 +41,7 @@ const PrintModeWithoutContext = ({
hashCode={hashCode}
hideZoom={true}
itemAccessor={itemAccessor}
mode={mode}
mode="print"
pages={pages}
/>
</ReportWrapper>
Expand All @@ -54,7 +53,6 @@ PrintModeWithoutContext.propTypes = {
additionalPageItems: PropTypes.arrayOf(PropTypes.node),
hashCode: PropTypes.string,
itemAccessor: PropTypes.func,
mode: PropTypes.string,
pages: PropTypes.arrayOf(
PropTypes.shape({}),
),
Expand All @@ -70,7 +68,6 @@ PrintModeWithoutContext.defaultProps = {
additionalPageItems: [],
hashCode: '',
itemAccessor: () => {},
mode: 'print',
pages: [],
settings: {},
theme: 'lightMode',
Expand Down
2 changes: 1 addition & 1 deletion src/components/withZoomPanPinchHOC.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const withZoomPanPinchHOC = WrappedComponent => {
const { zoom } = useBuilderContext();
const { fittedZoom } = usePresentationContext();

if (mode === 'print') {
if (mode !== 'presentation') {
return <WrappedComponent {...props} />;
}

Expand Down

0 comments on commit 6c045f5

Please sign in to comment.