Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
8b2a2bc2
Commit
8b2a2bc2
authored
Nov 20, 2020
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Nov 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `StreamContent` -> `StreamView`
parent
2d195fd9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
16 deletions
+17
-16
hypothesis-app.js
src/sidebar/components/hypothesis-app.js
+5
-4
stream-view.js
src/sidebar/components/stream-view.js
+6
-6
hypothesis-app-test.js
src/sidebar/components/test/hypothesis-app-test.js
+3
-3
stream-view-test.js
src/sidebar/components/test/stream-view-test.js
+3
-3
No files found.
src/sidebar/components/hypothesis-app.js
View file @
8b2a2bc2
...
@@ -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'
&&
<
Stream
Content
/>
}
{
route
===
'notebook'
&&
<
Stream
View
/>
}
{
route
===
'stream'
&&
<
Stream
Content
/>
}
{
route
===
'stream'
&&
<
Stream
View
/>
}
{
route
===
'sidebar'
&&
(
{
route
===
'sidebar'
&&
(
<
SidebarView
onLogin
=
{
login
}
onSignUp
=
{
signUp
}
/
>
<
SidebarView
onLogin
=
{
login
}
onSignUp
=
{
signUp
}
/
>
)}
)}
...
...
src/sidebar/components/stream-
content
.js
→
src/sidebar/components/stream-
view
.js
View file @
8b2a2bc2
...
@@ -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 Stream
Content
Props
* @typedef Stream
View
Props
* @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 {Stream
Content
Props} props
* @param {Stream
View
Props} props
*/
*/
function
Stream
Content
({
api
,
toastMessenger
})
{
function
Stream
View
({
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
}
/>
;
}
}
Stream
Content
.
propTypes
=
{
Stream
View
.
propTypes
=
{
api
:
propTypes
.
object
,
api
:
propTypes
.
object
,
toastMessenger
:
propTypes
.
object
,
toastMessenger
:
propTypes
.
object
,
};
};
Stream
Content
.
injectedProps
=
[
'api'
,
'toastMessenger'
];
Stream
View
.
injectedProps
=
[
'api'
,
'toastMessenger'
];
export
default
withServices
(
Stream
Content
);
export
default
withServices
(
Stream
View
);
src/sidebar/components/test/hypothesis-app-test.js
View file @
8b2a2bc2
...
@@ -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'
,
'Stream
Content
'
,
'SidebarView'
].
forEach
(
[
'main'
,
'AnnotationView'
,
'Stream
View
'
,
'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
:
'Stream
Content
'
,
contentComponent
:
'Stream
View
'
,
},
},
{
{
route
:
'stream'
,
route
:
'stream'
,
contentComponent
:
'Stream
Content
'
,
contentComponent
:
'Stream
View
'
,
},
},
].
forEach
(({
route
,
contentComponent
})
=>
{
].
forEach
(({
route
,
contentComponent
})
=>
{
it
(
'renders app content for route'
,
()
=>
{
it
(
'renders app content for route'
,
()
=>
{
...
...
src/sidebar/components/test/stream-
content
-test.js
→
src/sidebar/components/test/stream-
view
-test.js
View file @
8b2a2bc2
...
@@ -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
Stream
Content
,
{
$imports
}
from
'../stream-content
'
;
import
Stream
View
,
{
$imports
}
from
'../stream-view
'
;
describe
(
'Stream
Content
'
,
()
=>
{
describe
(
'Stream
View
'
,
()
=>
{
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
(
<
Stream
Content
api
=
{
fakeApi
}
toastMessenger
=
{
fakeToastMessenger
}
/
>
<
Stream
View
api
=
{
fakeApi
}
toastMessenger
=
{
fakeToastMessenger
}
/
>
);
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment