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
9139fa35
Commit
9139fa35
authored
Jan 12, 2023
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Jan 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert SidebarView to TS
parent
c912f3d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
SidebarView.tsx
src/sidebar/components/SidebarView.tsx
+18
-15
No files found.
src/sidebar/components/SidebarView.
js
→
src/sidebar/components/SidebarView.
tsx
View file @
9139fa35
import
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
{
useRootThread
}
from
'./hooks/use-root-thread
'
;
import
{
tabForAnnotation
}
from
'../helpers/tabs
'
;
import
{
withServices
}
from
'../service-context'
;
import
type
{
FrameSyncService
}
from
'../services/frame-sync'
;
import
type
{
LoadAnnotationsService
}
from
'../services/load-annotations'
;
import
type
{
StreamerService
}
from
'../services/streamer'
;
import
{
useSidebarStore
}
from
'../store'
;
import
{
tabForAnnotation
}
from
'../helpers/tabs'
;
import
{
useRootThread
}
from
'./hooks/use-root-thread'
;
import
FilterStatus
from
'./FilterStatus'
;
import
LoggedOutMessage
from
'./LoggedOutMessage'
;
...
...
@@ -12,19 +16,18 @@ import SelectionTabs from './SelectionTabs';
import
SidebarContentError
from
'./SidebarContentError'
;
import
ThreadList
from
'./ThreadList'
;
/**
* @typedef SidebarViewProps
* @prop {() => void} onLogin
* @prop {() => void} onSignUp
* @prop {import('../services/frame-sync').FrameSyncService} frameSync
* @prop {import('../services/load-annotations').LoadAnnotationsService} loadAnnotationsService
* @prop {import('../services/streamer').StreamerService} streamer
*/
export
type
SidebarViewProps
=
{
onLogin
:
()
=>
void
;
onSignUp
:
()
=>
void
;
// injected
frameSync
:
FrameSyncService
;
loadAnnotationsService
:
LoadAnnotationsService
;
streamer
:
StreamerService
;
};
/**
* Render the sidebar and its components
*
* @param {SidebarViewProps} props
* Render the content of the sidebar, including tabs and threads (annotations)
*/
function
SidebarView
({
frameSync
,
...
...
@@ -32,7 +35,7 @@ function SidebarView({
onSignUp
,
loadAnnotationsService
,
streamer
,
})
{
}
:
SidebarViewProps
)
{
const
rootThread
=
useRootThread
();
// Store state values
...
...
@@ -89,7 +92,7 @@ function SidebarView({
// on a particular user).
if
(
prevGroupId
.
current
)
{
// Respect applied focus-mode filtering when changing focused group
le
t
restoreFocus
=
store
.
focusState
().
active
;
cons
t
restoreFocus
=
store
.
focusState
().
active
;
store
.
clearSelection
();
if
(
restoreFocus
)
{
...
...
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