Commit 8b2a2bc2 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Rename `StreamContent` -> `StreamView`

parent 2d195fd9
...@@ -13,10 +13,11 @@ import { applyTheme } from '../util/theme'; ...@@ -13,10 +13,11 @@ import { applyTheme } from '../util/theme';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import AnnotationView from './annotation-view'; import AnnotationView from './annotation-view';
import SidebarView from './sidebar-view';
import StreamView from './stream-view';
import HelpPanel from './help-panel'; import HelpPanel from './help-panel';
import ShareAnnotationsPanel from './share-annotations-panel'; import ShareAnnotationsPanel from './share-annotations-panel';
import SidebarView from './sidebar-view';
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';
...@@ -192,8 +193,8 @@ function HypothesisApp({ ...@@ -192,8 +193,8 @@ function HypothesisApp({
{route && ( {route && (
<main> <main>
{route === 'annotation' && <AnnotationView onLogin={login} />} {route === 'annotation' && <AnnotationView onLogin={login} />}
{route === 'notebook' && <StreamContent />} {route === 'notebook' && <StreamView />}
{route === 'stream' && <StreamContent />} {route === 'stream' && <StreamView />}
{route === 'sidebar' && ( {route === 'sidebar' && (
<SidebarView onLogin={login} onSignUp={signUp} /> <SidebarView onLogin={login} onSignUp={signUp} />
)} )}
......
...@@ -10,7 +10,7 @@ import useStore from '../store/use-store'; ...@@ -10,7 +10,7 @@ import useStore from '../store/use-store';
import ThreadList from './thread-list'; import ThreadList from './thread-list';
/** /**
* @typedef StreamContentProps * @typedef StreamViewProps
* @prop {Object} [api] - Injected service * @prop {Object} [api] - Injected service
* @prop {Object} [toastMessenger] - Injected service * @prop {Object} [toastMessenger] - Injected service
*/ */
...@@ -18,9 +18,9 @@ import ThreadList from './thread-list'; ...@@ -18,9 +18,9 @@ import ThreadList from './thread-list';
/** /**
* The main content of the "stream" route (https://hypothes.is/stream) * The main content of the "stream" route (https://hypothes.is/stream)
* *
* @param {StreamContentProps} props * @param {StreamViewProps} props
*/ */
function StreamContent({ api, toastMessenger }) { function StreamView({ api, toastMessenger }) {
const addAnnotations = useStore(store => store.addAnnotations); const addAnnotations = useStore(store => store.addAnnotations);
const annotationFetchStarted = useStore( const annotationFetchStarted = useStore(
store => store.annotationFetchStarted store => store.annotationFetchStarted
...@@ -82,11 +82,11 @@ function StreamContent({ api, toastMessenger }) { ...@@ -82,11 +82,11 @@ function StreamContent({ api, toastMessenger }) {
return <ThreadList thread={rootThread} />; return <ThreadList thread={rootThread} />;
} }
StreamContent.propTypes = { StreamView.propTypes = {
api: propTypes.object, api: propTypes.object,
toastMessenger: propTypes.object, toastMessenger: propTypes.object,
}; };
StreamContent.injectedProps = ['api', 'toastMessenger']; StreamView.injectedProps = ['api', 'toastMessenger'];
export default withServices(StreamContent); export default withServices(StreamView);
...@@ -96,7 +96,7 @@ describe('HypothesisApp', () => { ...@@ -96,7 +96,7 @@ 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', 'AnnotationView', 'StreamContent', 'SidebarView'].forEach( ['main', 'AnnotationView', 'StreamView', 'SidebarView'].forEach(
contentComponent => { contentComponent => {
assert.isFalse(wrapper.exists(contentComponent)); assert.isFalse(wrapper.exists(contentComponent));
} }
...@@ -114,11 +114,11 @@ describe('HypothesisApp', () => { ...@@ -114,11 +114,11 @@ describe('HypothesisApp', () => {
}, },
{ {
route: 'notebook', route: 'notebook',
contentComponent: 'StreamContent', contentComponent: 'StreamView',
}, },
{ {
route: 'stream', route: 'stream',
contentComponent: 'StreamContent', contentComponent: 'StreamView',
}, },
].forEach(({ route, contentComponent }) => { ].forEach(({ route, contentComponent }) => {
it('renders app content for route', () => { it('renders app content for route', () => {
......
...@@ -4,9 +4,9 @@ import { createElement } from 'preact'; ...@@ -4,9 +4,9 @@ import { createElement } from 'preact';
import mockImportedComponents from '../../../test-util/mock-imported-components'; import mockImportedComponents from '../../../test-util/mock-imported-components';
import { waitFor } from '../../../test-util/wait'; import { waitFor } from '../../../test-util/wait';
import StreamContent, { $imports } from '../stream-content'; import StreamView, { $imports } from '../stream-view';
describe('StreamContent', () => { describe('StreamView', () => {
let fakeApi; let fakeApi;
let fakeUseRootThread; let fakeUseRootThread;
let fakeSearchFilter; let fakeSearchFilter;
...@@ -52,7 +52,7 @@ describe('StreamContent', () => { ...@@ -52,7 +52,7 @@ describe('StreamContent', () => {
function createComponent() { function createComponent() {
return mount( return mount(
<StreamContent api={fakeApi} toastMessenger={fakeToastMessenger} /> <StreamView api={fakeApi} toastMessenger={fakeToastMessenger} />
); );
} }
......
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