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';
import AnnotationViewerContent from './annotation-viewer-content';
import HelpPanel from './help-panel';
import ShareAnnotationsPanel from './share-annotations-panel';
import SidebarContent from './sidebar-content';
import SidebarView from './sidebar-view';
import StreamContent from './stream-content';
import ToastMessages from './toast-messages';
import TopBar from './top-bar';
......@@ -197,7 +197,7 @@ function HypothesisApp({
{route === 'notebook' && <StreamContent />}
{route === 'stream' && <StreamContent />}
{route === 'sidebar' && (
<SidebarContent onLogin={login} onSignUp={signUp} />
<SidebarView onLogin={login} onSignUp={signUp} />
)}
</main>
)}
......
......@@ -15,7 +15,7 @@ import SidebarContentError from './sidebar-content-error';
import ThreadList from './thread-list';
/**
* @typedef SidebarContentProps
* @typedef SidebarViewProps
* @prop {() => any} onLogin
* @prop {() => any} onSignUp
* @prop {Object} [frameSync] - Injected service
......@@ -26,9 +26,9 @@ import ThreadList from './thread-list';
/**
* Render the sidebar and its components
*
* @param {SidebarContentProps} props
* @param {SidebarViewProps} props
*/
function SidebarContent({
function SidebarView({
frameSync,
onLogin,
onSignUp,
......@@ -151,7 +151,7 @@ function SidebarContent({
);
}
SidebarContent.propTypes = {
SidebarView.propTypes = {
onLogin: propTypes.func.isRequired,
onSignUp: propTypes.func.isRequired,
frameSync: propTypes.object,
......@@ -159,10 +159,6 @@ SidebarContent.propTypes = {
streamer: propTypes.object,
};
SidebarContent.injectedProps = [
'frameSync',
'loadAnnotationsService',
'streamer',
];
SidebarView.injectedProps = ['frameSync', 'loadAnnotationsService', 'streamer'];
export default withServices(SidebarContent);
export default withServices(SidebarView);
......@@ -96,14 +96,11 @@ describe('HypothesisApp', () => {
it('does not render content if route is not yet determined', () => {
fakeStore.route.returns(null);
const wrapper = createComponent();
[
'main',
'AnnotationViewerContent',
'StreamContent',
'SidebarContent',
].forEach(contentComponent => {
assert.isFalse(wrapper.exists(contentComponent));
});
['main', 'AnnotationViewerContent', 'StreamContent', 'SidebarView'].forEach(
contentComponent => {
assert.isFalse(wrapper.exists(contentComponent));
}
);
});
[
......@@ -113,7 +110,7 @@ describe('HypothesisApp', () => {
},
{
route: 'sidebar',
contentComponent: 'SidebarContent',
contentComponent: 'SidebarView',
},
{
route: 'notebook',
......
import { mount } from 'enzyme';
import { createElement } from 'preact';
import SidebarContent from '../sidebar-content';
import { $imports } from '../sidebar-content';
import SidebarView from '../sidebar-view';
import { $imports } from '../sidebar-view';
import { checkAccessibility } from '../../../test-util/accessibility';
import mockImportedComponents from '../../../test-util/mock-imported-components';
describe('SidebarContent', () => {
describe('SidebarView', () => {
let fakeFrameSync;
let fakeLoadAnnotationsService;
let fakeUseRootThread;
......@@ -17,7 +17,7 @@ describe('SidebarContent', () => {
const createComponent = props =>
mount(
<SidebarContent
<SidebarView
onLogin={() => null}
onSignUp={() => null}
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