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
Hide 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
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
{
useRootThread
}
from
'./hooks/use-root-thread
'
;
import
{
tabForAnnotation
}
from
'../helpers/tabs
'
;
import
{
withServices
}
from
'../service-context'
;
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
{
useSidebarStore
}
from
'../store'
;
import
{
tabForAnnotation
}
from
'../helpers/tabs'
;
import
{
useRootThread
}
from
'./hooks/use-root-thread'
;
import
FilterStatus
from
'./FilterStatus'
;
import
FilterStatus
from
'./FilterStatus'
;
import
LoggedOutMessage
from
'./LoggedOutMessage'
;
import
LoggedOutMessage
from
'./LoggedOutMessage'
;
...
@@ -12,19 +16,18 @@ import SelectionTabs from './SelectionTabs';
...
@@ -12,19 +16,18 @@ import SelectionTabs from './SelectionTabs';
import
SidebarContentError
from
'./SidebarContentError'
;
import
SidebarContentError
from
'./SidebarContentError'
;
import
ThreadList
from
'./ThreadList'
;
import
ThreadList
from
'./ThreadList'
;
/**
export
type
SidebarViewProps
=
{
* @typedef SidebarViewProps
onLogin
:
()
=>
void
;
* @prop {() => void} onLogin
onSignUp
:
()
=>
void
;
* @prop {() => void} onSignUp
* @prop {import('../services/frame-sync').FrameSyncService} frameSync
// injected
* @prop {import('../services/load-annotations').LoadAnnotationsService} loadAnnotationsService
frameSync
:
FrameSyncService
;
* @prop {import('../services/streamer').StreamerService} streamer
loadAnnotationsService
:
LoadAnnotationsService
;
*/
streamer
:
StreamerService
;
};
/**
/**
* Render the sidebar and its components
* Render the content of the sidebar, including tabs and threads (annotations)
*
* @param {SidebarViewProps} props
*/
*/
function
SidebarView
({
function
SidebarView
({
frameSync
,
frameSync
,
...
@@ -32,7 +35,7 @@ function SidebarView({
...
@@ -32,7 +35,7 @@ function SidebarView({
onSignUp
,
onSignUp
,
loadAnnotationsService
,
loadAnnotationsService
,
streamer
,
streamer
,
})
{
}
:
SidebarViewProps
)
{
const
rootThread
=
useRootThread
();
const
rootThread
=
useRootThread
();
// Store state values
// Store state values
...
@@ -89,7 +92,7 @@ function SidebarView({
...
@@ -89,7 +92,7 @@ function SidebarView({
// on a particular user).
// on a particular user).
if
(
prevGroupId
.
current
)
{
if
(
prevGroupId
.
current
)
{
// Respect applied focus-mode filtering when changing focused group
// Respect applied focus-mode filtering when changing focused group
le
t
restoreFocus
=
store
.
focusState
().
active
;
cons
t
restoreFocus
=
store
.
focusState
().
active
;
store
.
clearSelection
();
store
.
clearSelection
();
if
(
restoreFocus
)
{
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