Skip to content

Commit b851313

Browse files
committed
feat: Include the default sidebar in full-screen mode
1 parent 73f1e28 commit b851313

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import * as React from 'react';
2+
import { Viewer } from '@react-pdf-viewer/core';
3+
import { defaultLayoutPlugin } from '@react-pdf-viewer/default-layout';
4+
5+
import '@react-pdf-viewer/core/lib/styles/index.css';
6+
import '@react-pdf-viewer/default-layout/lib/styles/index.css';
7+
8+
interface IncludeSidebarFullScreenModeDefaultLayoutExampleProps {
9+
fileUrl: string;
10+
}
11+
12+
const IncludeSidebarFullScreenModeDefaultLayoutExample: React.FC<
13+
IncludeSidebarFullScreenModeDefaultLayoutExampleProps
14+
> = ({ fileUrl }) => {
15+
const defaultLayoutPluginInstance = defaultLayoutPlugin({
16+
toolbarPlugin: {
17+
fullScreenPlugin: {
18+
getFullScreenTarget: (pagesContainer) => pagesContainer.closest('[data-testid="core__viewer"]'),
19+
renderExitFullScreenButton: (props) => <></>,
20+
},
21+
},
22+
});
23+
24+
return <Viewer fileUrl={fileUrl} plugins={[defaultLayoutPluginInstance]} />;
25+
};
26+
27+
export default IncludeSidebarFullScreenModeDefaultLayoutExample;

0 commit comments

Comments
 (0)