Commit b62f95ea authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Rename `SidebarContent` -> `SidebarView`

This name better describes this component's role.
parent dea9b141
...@@ -15,7 +15,7 @@ import { withServices } from '../util/service-context'; ...@@ -15,7 +15,7 @@ import { withServices } from '../util/service-context';
import AnnotationViewerContent from './annotation-viewer-content'; import AnnotationViewerContent from './annotation-viewer-content';
import HelpPanel from './help-panel'; import HelpPanel from './help-panel';
import ShareAnnotationsPanel from './share-annotations-panel'; import ShareAnnotationsPanel from './share-annotations-panel';
import SidebarContent from './sidebar-content'; import SidebarView from './sidebar-view';
import StreamContent from './stream-content'; import StreamContent from './stream-content';
import ToastMessages from './toast-messages'; import ToastMessages from './toast-messages';
import TopBar from './top-bar'; import TopBar from './top-bar';
...@@ -197,7 +197,7 @@ function HypothesisApp({ ...@@ -197,7 +197,7 @@ function HypothesisApp({
{route === 'notebook' && <StreamContent />} {route === 'notebook' && <StreamContent />}
{route === 'stream' && <StreamContent />} {route === 'stream' && <StreamContent />}
{route === 'sidebar' && ( {route === 'sidebar' && (
<SidebarContent onLogin={login} onSignUp={signUp} /> <SidebarView onLogin={login} onSignUp={signUp} />
)} )}
</main> </main>
)} )}
......
...@@ -15,7 +15,7 @@ import SidebarContentError from './sidebar-content-error'; ...@@ -15,7 +15,7 @@ import SidebarContentError from './sidebar-content-error';
import ThreadList from './thread-list'; import ThreadList from './thread-list';
/** /**
* @typedef SidebarContentProps * @typedef SidebarViewProps
* @prop {() => any} onLogin * @prop {() => any} onLogin
* @prop {() => any} onSignUp * @prop {() => any} onSignUp
* @prop {Object} [frameSync] - Injected service * @prop {Object} [frameSync] - Injected service
...@@ -26,9 +26,9 @@ import ThreadList from './thread-list'; ...@@ -26,9 +26,9 @@ import ThreadList from './thread-list';
/** /**
* Render the sidebar and its components * Render the sidebar and its components
* *
* @param {SidebarContentProps} props * @param {SidebarViewProps} props
*/ */
function SidebarContent({ function SidebarView({
frameSync, frameSync,
onLogin, onLogin,
onSignUp, onSignUp,
...@@ -151,7 +151,7 @@ function SidebarContent({ ...@@ -151,7 +151,7 @@ function SidebarContent({
); );
} }
SidebarContent.propTypes = { SidebarView.propTypes = {
onLogin: propTypes.func.isRequired, onLogin: propTypes.func.isRequired,
onSignUp: propTypes.func.isRequired, onSignUp: propTypes.func.isRequired,
frameSync: propTypes.object, frameSync: propTypes.object,
...@@ -159,10 +159,6 @@ SidebarContent.propTypes = { ...@@ -159,10 +159,6 @@ SidebarContent.propTypes = {
streamer: propTypes.object, streamer: propTypes.object,
}; };
SidebarContent.injectedProps = [ SidebarView.injectedProps = ['frameSync', 'loadAnnotationsService', 'streamer'];
'frameSync',
'loadAnnotationsService',
'streamer',
];
export default withServices(SidebarContent); export default withServices(SidebarView);
...@@ -96,14 +96,11 @@ describe('HypothesisApp', () => { ...@@ -96,14 +96,11 @@ describe('HypothesisApp', () => {
it('does not render content if route is not yet determined', () => { it('does not render content if route is not yet determined', () => {
fakeStore.route.returns(null); fakeStore.route.returns(null);
const wrapper = createComponent(); const wrapper = createComponent();
[ ['main', 'AnnotationViewerContent', 'StreamContent', 'SidebarView'].forEach(
'main', contentComponent => {
'AnnotationViewerContent', assert.isFalse(wrapper.exists(contentComponent));
'StreamContent', }
'SidebarContent', );
].forEach(contentComponent => {
assert.isFalse(wrapper.exists(contentComponent));
});
}); });
[ [
...@@ -113,7 +110,7 @@ describe('HypothesisApp', () => { ...@@ -113,7 +110,7 @@ describe('HypothesisApp', () => {
}, },
{ {
route: 'sidebar', route: 'sidebar',
contentComponent: 'SidebarContent', contentComponent: 'SidebarView',
}, },
{ {
route: 'notebook', route: 'notebook',
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact'; import { createElement } from 'preact';
import SidebarContent from '../sidebar-content'; import SidebarView from '../sidebar-view';
import { $imports } from '../sidebar-content'; import { $imports } from '../sidebar-view';
import { checkAccessibility } from '../../../test-util/accessibility'; import { checkAccessibility } from '../../../test-util/accessibility';
import mockImportedComponents from '../../../test-util/mock-imported-components'; import mockImportedComponents from '../../../test-util/mock-imported-components';
describe('SidebarContent', () => { describe('SidebarView', () => {
let fakeFrameSync; let fakeFrameSync;
let fakeLoadAnnotationsService; let fakeLoadAnnotationsService;
let fakeUseRootThread; let fakeUseRootThread;
...@@ -17,7 +17,7 @@ describe('SidebarContent', () => { ...@@ -17,7 +17,7 @@ describe('SidebarContent', () => {
const createComponent = props => const createComponent = props =>
mount( mount(
<SidebarContent <SidebarView
onLogin={() => null} onLogin={() => null}
onSignUp={() => null} onSignUp={() => null}
frameSync={fakeFrameSync} frameSync={fakeFrameSync}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment