Skip to content
Snippets Groups Projects
Unverified Commit 6a47be06 authored by Christopher Hanna Johnson's avatar Christopher Hanna Johnson Committed by GitHub
Browse files

Merge pull request #1753 from...

Merge pull request #1753 from ProjectMirador/1727-divide-windowmiddlecontent-into-component-and-container

Divide <WindowMiddleContent/> into component and container (part of #1727)
parents 7f00ceb0 6a14ebcf
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ import React from 'react'; ...@@ -2,7 +2,7 @@ import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import Window from '../../../src/components/Window'; import Window from '../../../src/components/Window';
import WindowTopBar from '../../../src/containers/WindowTopBar'; import WindowTopBar from '../../../src/containers/WindowTopBar';
import ConnectedWindowMiddleContent from '../../../src/components/WindowMiddleContent'; import WindowMiddleContent from '../../../src/containers/WindowMiddleContent';
describe('Window', () => { describe('Window', () => {
let wrapper; let wrapper;
...@@ -19,7 +19,7 @@ describe('Window', () => { ...@@ -19,7 +19,7 @@ describe('Window', () => {
}); });
it('should render <ConnectedWindowMiddleContent>', () => { it('should render <ConnectedWindowMiddleContent>', () => {
wrapper = shallow(<Window window={window} />); wrapper = shallow(<Window window={window} />);
expect(wrapper.find(ConnectedWindowMiddleContent)).toHaveLength(1); expect(wrapper.find(WindowMiddleContent)).toHaveLength(1);
}); });
it('should render bottom companions window areas', () => { it('should render bottom companions window areas', () => {
wrapper = shallow(<Window window={window} />); wrapper = shallow(<Window window={window} />);
......
import React from 'react'; import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import { WindowMiddleContent } from '../../../src/components/WindowMiddleContent'; import WindowMiddleContent from '../../../src/components/WindowMiddleContent';
import ConnectedCompanionWindow from '../../../src/components/CompanionWindow'; import ConnectedCompanionWindow from '../../../src/components/CompanionWindow';
import ConnectedWindowSideBar from '../../../src/components/WindowSideBar'; import ConnectedWindowSideBar from '../../../src/components/WindowSideBar';
import ConnectedWindowViewer from '../../../src/components/WindowViewer'; import ConnectedWindowViewer from '../../../src/components/WindowViewer';
......
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ns from '../config/css-ns'; import ns from '../config/css-ns';
import WindowTopBar from '../containers/WindowTopBar'; import WindowTopBar from '../containers/WindowTopBar';
import ConnectedWindowMiddleContent from './WindowMiddleContent'; import WindowMiddleContent from '../containers/WindowMiddleContent';
import ConnectedThumbnailNavigation from './ThumbnailNavigation'; import ConnectedThumbnailNavigation from './ThumbnailNavigation';
/** /**
...@@ -29,7 +29,7 @@ class Window extends Component { ...@@ -29,7 +29,7 @@ class Window extends Component {
windowId={window.id} windowId={window.id}
manifest={manifest} manifest={manifest}
/> />
<ConnectedWindowMiddleContent <WindowMiddleContent
window={window} window={window}
manifest={manifest} manifest={manifest}
sideBarOpen={window.sideBarOpen} sideBarOpen={window.sideBarOpen}
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ConnectedWindowSideBar from './WindowSideBar'; import ConnectedWindowSideBar from './WindowSideBar';
import ConnectedCompanionWindow from './CompanionWindow'; import ConnectedCompanionWindow from './CompanionWindow';
import ConnectedWindowViewer from './WindowViewer'; import ConnectedWindowViewer from './WindowViewer';
import miradorWithPlugins from '../lib/miradorWithPlugins';
import ns from '../config/css-ns'; import ns from '../config/css-ns';
/** /**
* WindowMiddleContent - component that renders the "middle" area of the * WindowMiddleContent - component that renders the "middle" area of the
* Mirador Window * Mirador Window
*/ */
export class WindowMiddleContent extends Component { class WindowMiddleContent extends Component {
/** /**
* renderViewer * renderViewer
* *
...@@ -66,11 +63,4 @@ WindowMiddleContent.defaultProps = { ...@@ -66,11 +63,4 @@ WindowMiddleContent.defaultProps = {
manifest: null, manifest: null,
}; };
export default WindowMiddleContent;
const enhance = compose(
connect(null, null),
miradorWithPlugins,
// further HOC go here
);
export default enhance(WindowMiddleContent);
import { compose } from 'redux';
import { connect } from 'react-redux';
import miradorWithPlugins from '../lib/miradorWithPlugins';
import WindowMiddleContent from '../components/WindowMiddleContent';
const enhance = compose(
connect(null, null),
miradorWithPlugins,
// further HOC go here
);
export default enhance(WindowMiddleContent);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment