Commit 2d195fd9 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Rename `AnnotationViewerContent` -> `AnnotationView`

parent b62f95ea
......@@ -10,7 +10,7 @@ import ThreadList from './thread-list';
import SidebarContentError from './sidebar-content-error';
/**
* @typedef AnnotationViewerContentProps
* @typedef AnnotationViewProps
* @prop {() => any} onLogin
* @prop {Object} [loadAnnotationsService] - Injected service
*/
......@@ -18,9 +18,9 @@ import SidebarContentError from './sidebar-content-error';
/**
* The main content for the single annotation page (aka. https://hypothes.is/a/<annotation ID>)
*
* @param {AnnotationViewerContentProps} props
* @param {AnnotationViewProps} props
*/
function AnnotationViewerContent({ loadAnnotationsService, onLogin }) {
function AnnotationView({ loadAnnotationsService, onLogin }) {
const annotationId = useStore(store => store.routeParams().id);
const clearAnnotations = useStore(store => store.clearAnnotations);
const highlightAnnotations = useStore(store => store.highlightAnnotations);
......@@ -98,11 +98,11 @@ function AnnotationViewerContent({ loadAnnotationsService, onLogin }) {
);
}
AnnotationViewerContent.propTypes = {
AnnotationView.propTypes = {
onLogin: propTypes.func.isRequired,
loadAnnotationsService: propTypes.object,
};
AnnotationViewerContent.injectedProps = ['loadAnnotationsService'];
AnnotationView.injectedProps = ['loadAnnotationsService'];
export default withServices(AnnotationViewerContent);
export default withServices(AnnotationView);
......@@ -12,7 +12,7 @@ import { shouldAutoDisplayTutorial } from '../util/session';
import { applyTheme } from '../util/theme';
import { withServices } from '../util/service-context';
import AnnotationViewerContent from './annotation-viewer-content';
import AnnotationView from './annotation-view';
import HelpPanel from './help-panel';
import ShareAnnotationsPanel from './share-annotations-panel';
import SidebarView from './sidebar-view';
......@@ -191,9 +191,7 @@ function HypothesisApp({
{route && (
<main>
{route === 'annotation' && (
<AnnotationViewerContent onLogin={login} />
)}
{route === 'annotation' && <AnnotationView onLogin={login} />}
{route === 'notebook' && <StreamContent />}
{route === 'stream' && <StreamContent />}
{route === 'sidebar' && (
......
......@@ -4,11 +4,9 @@ import { mount } from 'enzyme';
import { waitFor } from '../../../test-util/wait';
import mockImportedComponents from '../../../test-util/mock-imported-components';
import AnnotationViewerContent, {
$imports,
} from '../annotation-viewer-content';
import AnnotationView, { $imports } from '../annotation-view';
describe('AnnotationViewerContent', () => {
describe('AnnotationView', () => {
let fakeStore;
let fakeOnLogin;
let fakeUseRootThread;
......@@ -45,7 +43,7 @@ describe('AnnotationViewerContent', () => {
function createComponent(props = {}) {
return mount(
<AnnotationViewerContent
<AnnotationView
loadAnnotationsService={fakeLoadAnnotationsService}
onLogin={fakeOnLogin}
{...props}
......
......@@ -96,7 +96,7 @@ describe('HypothesisApp', () => {
it('does not render content if route is not yet determined', () => {
fakeStore.route.returns(null);
const wrapper = createComponent();
['main', 'AnnotationViewerContent', 'StreamContent', 'SidebarView'].forEach(
['main', 'AnnotationView', 'StreamContent', 'SidebarView'].forEach(
contentComponent => {
assert.isFalse(wrapper.exists(contentComponent));
}
......@@ -106,7 +106,7 @@ describe('HypothesisApp', () => {
[
{
route: 'annotation',
contentComponent: 'AnnotationViewerContent',
contentComponent: 'AnnotationView',
},
{
route: 'sidebar',
......
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