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
8d393848
Commit
8d393848
authored
Jan 13, 2023
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Jan 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update `SidebarPanel` to use updated shared Panel component
parent
26c4f7e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
LoginPromptPanel.tsx
src/sidebar/components/LoginPromptPanel.tsx
+6
-2
SidebarPanel.tsx
src/sidebar/components/SidebarPanel.tsx
+4
-3
No files found.
src/sidebar/components/LoginPromptPanel.tsx
View file @
8d393848
import
{
Button
,
CardActions
}
from
'@hypothesis/frontend-shared/lib/next'
;
import
{
Button
,
CardActions
,
RestrictedIcon
,
}
from
'@hypothesis/frontend-shared/lib/next'
;
import
{
useSidebarStore
}
from
'../store'
;
...
...
@@ -23,7 +27,7 @@ export default function LoginPromptPanel({
}
return
(
<
SidebarPanel
icon=
"restricted"
icon=
{
RestrictedIcon
}
title=
"Login needed"
panelName=
"loginPrompt"
>
...
...
src/sidebar/components/SidebarPanel.tsx
View file @
8d393848
import
{
Panel
}
from
'@hypothesis/frontend-shared'
;
import
{
Panel
}
from
'@hypothesis/frontend-shared/lib/next'
;
import
type
{
IconComponent
}
from
'@hypothesis/frontend-shared/lib/types'
;
import
type
{
ComponentChildren
}
from
'preact'
;
import
{
useCallback
,
useEffect
,
useRef
}
from
'preact/hooks'
;
import
scrollIntoView
from
'scroll-into-view'
;
...
...
@@ -11,7 +12,7 @@ import Slider from './Slider';
export
type
SidebarPanelProps
=
{
children
:
ComponentChildren
;
/** An optional icon name for display next to the panel's title */
icon
?:
string
;
icon
?:
IconComponent
;
/**
* A string identifying this panel. Only one `panelName` may be active at any
* time. Multiple panels with the same `panelName` would be "in sync", opening
...
...
@@ -29,7 +30,7 @@ export type SidebarPanelProps = {
*/
export
default
function
SidebarPanel
({
children
,
icon
=
''
,
icon
,
panelName
,
title
,
onActiveChanged
,
...
...
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