@@ -12,6 +12,44 @@ import { withTranslation } from 'react-i18next';
1212const { OHIFStudyMetadata } = metadata ;
1313const { studyMetadataManager, updateMetaDataManager } = utils ;
1414
15+ const dropZoneLinkDialog = ( onDrop , i18n , dir ) => {
16+ return (
17+ < Dropzone onDrop = { onDrop } noDrag >
18+ { ( { getRootProps, getInputProps } ) => (
19+ < span { ...getRootProps ( ) } className = "link-dialog" >
20+ { dir ? (
21+ < span >
22+ { i18n ( 'Load folders' ) }
23+ < input
24+ { ...getInputProps ( ) }
25+ webkitdirectory = "true"
26+ mozdirectory = "true"
27+ />
28+ </ span >
29+ ) : (
30+ < span >
31+ { i18n ( 'Load files' ) }
32+ < input { ...getInputProps ( ) } />
33+ </ span >
34+ ) }
35+ </ span >
36+ ) }
37+ </ Dropzone >
38+ ) ;
39+ } ;
40+
41+ const linksDialogMessage = ( onDrop , i18n ) => {
42+ return (
43+ < >
44+ { i18n ( 'Or click to ' ) }
45+ { dropZoneLinkDialog ( onDrop , i18n ) }
46+ { i18n ( ' or ' ) }
47+ { dropZoneLinkDialog ( onDrop , i18n , true ) }
48+ { i18n ( ' from dialog' ) }
49+ </ >
50+ ) ;
51+ } ;
52+
1553class ViewerLocalFileData extends Component {
1654 static propTypes = {
1755 studies : PropTypes . array ,
@@ -73,7 +111,7 @@ class ViewerLocalFileData extends Component {
73111 }
74112
75113 return (
76- < Dropzone onDrop = { onDrop } >
114+ < Dropzone onDrop = { onDrop } noClick >
77115 { ( { getRootProps, getInputProps } ) => (
78116 < div { ...getRootProps ( ) } style = { { width : '100%' , height : '100%' } } >
79117 { this . state . studies ? (
@@ -96,15 +134,10 @@ class ViewerLocalFileData extends Component {
96134 'Drag and Drop DICOM files here to load them in the Viewer'
97135 ) }
98136 </ h3 >
99- < h4 >
100- { this . props . t (
101- "Or click to load the browser's file selector"
102- ) }
103- </ h4 >
137+ < h4 > { linksDialogMessage ( onDrop , this . props . t ) } </ h4 >
104138 </ >
105139 ) }
106140 </ div >
107- < input { ...getInputProps ( ) } style = { { display : 'none' } } />
108141 </ div >
109142 ) }
110143 </ div >
0 commit comments