File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
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 ;
You can’t perform that action at this time.
0 commit comments