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
812b271f
Commit
812b271f
authored
Feb 15, 2023
by
Alejandro Celaya
Committed by
Alejandro Celaya
Feb 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate HypothesisApp to TypeScript
parent
719d80e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
15 deletions
+19
-15
HypothesisApp.tsx
src/sidebar/components/HypothesisApp.tsx
+19
-15
No files found.
src/sidebar/components/HypothesisApp.
js
→
src/sidebar/components/HypothesisApp.
tsx
View file @
812b271f
...
@@ -2,10 +2,15 @@ import classnames from 'classnames';
...
@@ -2,10 +2,15 @@ import classnames from 'classnames';
import
{
useEffect
,
useMemo
}
from
'preact/hooks'
;
import
{
useEffect
,
useMemo
}
from
'preact/hooks'
;
import
{
confirm
}
from
'../../shared/prompts'
;
import
{
confirm
}
from
'../../shared/prompts'
;
import
type
{
SidebarSettings
}
from
'../../types/config'
;
import
{
serviceConfig
}
from
'../config/service-config'
;
import
{
serviceConfig
}
from
'../config/service-config'
;
import
{
shouldAutoDisplayTutorial
}
from
'../helpers/session'
;
import
{
shouldAutoDisplayTutorial
}
from
'../helpers/session'
;
import
{
applyTheme
}
from
'../helpers/theme'
;
import
{
applyTheme
}
from
'../helpers/theme'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
import
type
{
AuthService
}
from
'../services/auth'
;
import
type
{
FrameSyncService
}
from
'../services/frame-sync'
;
import
type
{
SessionService
}
from
'../services/session'
;
import
type
{
ToastMessengerService
}
from
'../services/toast-messenger'
;
import
{
useSidebarStore
}
from
'../store'
;
import
{
useSidebarStore
}
from
'../store'
;
import
AnnotationView
from
'./AnnotationView'
;
import
AnnotationView
from
'./AnnotationView'
;
import
HelpPanel
from
'./HelpPanel'
;
import
HelpPanel
from
'./HelpPanel'
;
...
@@ -17,28 +22,27 @@ import StreamView from './StreamView';
...
@@ -17,28 +22,27 @@ import StreamView from './StreamView';
import
ToastMessages
from
'./ToastMessages'
;
import
ToastMessages
from
'./ToastMessages'
;
import
TopBar
from
'./TopBar'
;
import
TopBar
from
'./TopBar'
;
/**
export
type
HypothesisAppProps
=
{
* @typedef {import('../../types/config').SidebarSettings} SidebarSettings
auth
:
AuthService
;
*/
frameSync
:
FrameSyncService
;
settings
:
SidebarSettings
;
/**
session
:
SessionService
;
* @typedef HypothesisAppProps
toastMessenger
:
ToastMessengerService
;
* @prop {import('../services/auth').AuthService} auth
};
* @prop {import('../services/frame-sync').FrameSyncService} frameSync
* @prop {SidebarSettings} settings
* @prop {import('../services/session').SessionService} session
* @prop {import('../services/toast-messenger').ToastMessengerService} toastMessenger
*/
/**
/**
* The root component for the Hypothesis client.
* The root component for the Hypothesis client.
*
*
* This handles login/logout actions and renders the top navigation bar
* This handles login/logout actions and renders the top navigation bar
* and content appropriate for the current route.
* and content appropriate for the current route.
*
* @param {HypothesisAppProps} props
*/
*/
function
HypothesisApp
({
auth
,
frameSync
,
settings
,
session
,
toastMessenger
})
{
function
HypothesisApp
({
auth
,
frameSync
,
settings
,
session
,
toastMessenger
,
}:
HypothesisAppProps
)
{
const
store
=
useSidebarStore
();
const
store
=
useSidebarStore
();
const
profile
=
store
.
profile
();
const
profile
=
store
.
profile
();
const
route
=
store
.
route
();
const
route
=
store
.
route
();
...
...
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