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
afd73d91
Commit
afd73d91
authored
Jun 15, 2021
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Jun 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use shared `Panel` component
parent
47ecae4c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
33 deletions
+28
-33
LaunchErrorPanel.js
src/sidebar/components/LaunchErrorPanel.js
+2
-4
NotebookView.js
src/sidebar/components/NotebookView.js
+1
-2
SidebarContentError.js
src/sidebar/components/SidebarContentError.js
+21
-21
SidebarPanel.js
src/sidebar/components/SidebarPanel.js
+2
-2
LaunchErrorPanel.scss
src/styles/sidebar/components/LaunchErrorPanel.scss
+2
-4
No files found.
src/sidebar/components/LaunchErrorPanel.js
View file @
afd73d91
import
Panel
from
'./Panel
'
;
import
{
Panel
}
from
'@hypothesis/frontend-shared
'
;
/**
* @typedef LaunchErrorPanelProps
...
...
@@ -16,9 +16,7 @@ import Panel from './Panel';
export
default
function
LaunchErrorPanel
({
error
})
{
return
(
<
div
className
=
"LaunchErrorPanel"
>
<
Panel
title
=
"Unable to start Hypothesis"
>
<
p
>
{
error
.
message
}
<
/p
>
<
/Panel
>
<
Panel
title
=
"Unable to start Hypothesis"
>
{
error
.
message
}
<
/Panel
>
<
/div
>
);
}
src/sidebar/components/NotebookView.js
View file @
afd73d91
import
{
IconButton
}
from
'@hypothesis/frontend-shared'
;
import
{
IconButton
,
Panel
}
from
'@hypothesis/frontend-shared'
;
import
{
useEffect
,
useLayoutEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
scrollIntoView
from
'scroll-into-view'
;
...
...
@@ -8,7 +8,6 @@ import { useStoreProxy } from '../store/use-store';
import
NotebookFilters
from
'./NotebookFilters'
;
import
NotebookResultCount
from
'./NotebookResultCount'
;
import
Panel
from
'./Panel'
;
import
PaginatedThreadList
from
'./PaginatedThreadList'
;
import
useRootThread
from
'./hooks/use-root-thread'
;
...
...
src/sidebar/components/SidebarContentError.js
View file @
afd73d91
import
{
LabeledButton
}
from
'@hypothesis/frontend-shared'
;
import
{
LabeledButton
,
Panel
}
from
'@hypothesis/frontend-shared'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
Panel
from
'./Panel'
;
/**
* @typedef SidebarContentErrorProps
* @prop {'annotation'|'group'} errorType
...
...
@@ -42,23 +40,25 @@ export default function SidebarContentError({
})();
return
(
<
Panel
icon
=
"restricted"
title
=
{
errorTitle
}
>
<
p
>
{
errorMessage
}
<
/p
>
<
div
className
=
"u-layout-row--justify-right u-horizontal-rhythm"
>
{
showClearSelection
&&
(
<
LabeledButton
variant
=
{
isLoggedIn
?
'primary'
:
undefined
}
onClick
=
{()
=>
store
.
clearSelection
()}
>
Show
all
annotations
<
/LabeledButton
>
)}
{
!
isLoggedIn
&&
(
<
LabeledButton
variant
=
"primary"
onClick
=
{
onLoginRequest
}
>
Log
in
<
/LabeledButton
>
)}
<
/div
>
<
/Panel
>
<
div
className
=
"u-sidebar-container"
>
<
Panel
icon
=
"restricted"
title
=
{
errorTitle
}
>
<
p
>
{
errorMessage
}
<
/p
>
<
div
className
=
"u-layout-row--justify-right u-horizontal-rhythm"
>
{
showClearSelection
&&
(
<
LabeledButton
variant
=
{
isLoggedIn
?
'primary'
:
undefined
}
onClick
=
{()
=>
store
.
clearSelection
()}
>
Show
all
annotations
<
/LabeledButton
>
)}
{
!
isLoggedIn
&&
(
<
LabeledButton
variant
=
"primary"
onClick
=
{
onLoginRequest
}
>
Log
in
<
/LabeledButton
>
)}
<
/div
>
<
/Panel
>
<
/div
>
);
}
src/sidebar/components/SidebarPanel.js
View file @
afd73d91
import
{
Panel
}
from
'@hypothesis/frontend-shared'
;
import
{
useCallback
,
useEffect
,
useRef
}
from
'preact/hooks'
;
import
scrollIntoView
from
'scroll-into-view'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
Panel
from
'./Panel'
;
import
Slider
from
'./Slider'
;
/**
...
...
@@ -60,7 +60,7 @@ export default function SidebarPanel({
return
(
<
Slider
visible
=
{
panelIsActive
}
>
<
div
ref
=
{
panelElement
}
>
<
div
ref
=
{
panelElement
}
className
=
"u-sidebar-container"
>
<
Panel
title
=
{
title
}
icon
=
{
icon
}
onClose
=
{
closePanel
}
>
{
children
}
<
/Panel
>
...
...
src/styles/sidebar/components/LaunchErrorPanel.scss
View file @
afd73d91
.LaunchErrorPanel
{
// Top margin ensures that the error notice appears below the Notebook's
// "Close" button.
margin-top
:
50px
;
margin-left
:
5px
;
margin-right
:
5px
;
margin
:
0
.5rem
;
margin-top
:
3rem
;
}
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