@@ -12,6 +12,7 @@ const GalleryView = lazy(() => import('../containers/GalleryView'));
1212const SelectCollection = lazy ( ( ) => import ( '../containers/SelectCollection' ) ) ;
1313const WindowViewer = lazy ( ( ) => import ( '../containers/WindowViewer' ) ) ;
1414const VideoViewer = lazy ( ( ) => import ( '../containers/VideoViewer' ) ) ;
15+ const TextViewer = lazy ( ( ) => import ( '../containers/TextViewer' ) ) ;
1516
1617GalleryView . displayName = 'GalleryView' ;
1718SelectCollection . displayName = 'SelectCollection' ;
@@ -25,8 +26,8 @@ const Root = styled('div', { name: 'PrimaryWindow', slot: 'root' })(() => ({
2526
2627/** */
2728const TypeSpecificViewer = ( {
28- audioResources = [ ] , isCollection = false ,
29- isFetching = false , videoResources = [ ] , view = undefined , windowId,
29+ audioResources = [ ] , isCollection = false , isFetching = false , textResources = [ ] ,
30+ videoResources = [ ] , view = undefined , windowId,
3031} ) => {
3132 if ( isCollection ) {
3233 return (
@@ -57,6 +58,13 @@ const TypeSpecificViewer = ({
5758 />
5859 ) ;
5960 }
61+ if ( textResources . length > 0 ) {
62+ return (
63+ < TextViewer
64+ windowId = { windowId }
65+ />
66+ ) ;
67+ }
6068 return (
6169 < WindowViewer
6270 windowId = { windowId }
@@ -70,6 +78,7 @@ TypeSpecificViewer.propTypes = {
7078 audioResources : PropTypes . arrayOf ( PropTypes . object ) , // eslint-disable-line react/forbid-prop-types
7179 isCollection : PropTypes . bool ,
7280 isFetching : PropTypes . bool ,
81+ textResources : PropTypes . arrayOf ( PropTypes . object ) , // eslint-disable-line react/forbid-prop-types
7382 videoResources : PropTypes . arrayOf ( PropTypes . object ) , // eslint-disable-line react/forbid-prop-types
7483 view : PropTypes . string ,
7584 windowId : PropTypes . string . isRequired ,
@@ -80,13 +89,15 @@ TypeSpecificViewer.propTypes = {
8089 * window. Right now this differentiates between a Image, Video, or Audio viewer.
8190 */
8291export function PrimaryWindow ( {
83- audioResources = undefined , isCollection = false , isFetching = false , videoResources = undefined ,
84- view = undefined , windowId, isCollectionDialogVisible = false , children = null , className = undefined ,
92+ audioResources = undefined , children = null , className = undefined , isCollection = false ,
93+ isCollectionDialogVisible = false , isFetching = false , textResources = undefined , videoResources = undefined ,
94+ view = undefined , windowId,
8595} ) {
8696 const viewerProps = {
8797 audioResources,
8898 isCollection,
8999 isFetching,
100+ textResources,
90101 videoResources,
91102 view,
92103 windowId,
@@ -111,6 +122,7 @@ PrimaryWindow.propTypes = {
111122 isCollection : PropTypes . bool ,
112123 isCollectionDialogVisible : PropTypes . bool ,
113124 isFetching : PropTypes . bool ,
125+ textResources : PropTypes . arrayOf ( PropTypes . object ) , // eslint-disable-line react/forbid-prop-types
114126 videoResources : PropTypes . arrayOf ( PropTypes . object ) , // eslint-disable-line react/forbid-prop-types
115127 view : PropTypes . string ,
116128 windowId : PropTypes . string . isRequired ,
0 commit comments