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
e418e397
Commit
e418e397
authored
Oct 13, 2022
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Jan 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update shared components in `SearchInput`
parent
55dd56cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
SearchInput.js
src/sidebar/components/SearchInput.js
+11
-6
No files found.
src/sidebar/components/SearchInput.js
View file @
e418e397
import
{
IconButton
,
Spinner
,
TextInput
}
from
'@hypothesis/frontend-shared'
;
import
{
IconButton
,
Input
,
SearchIcon
,
Spinner
,
}
from
'@hypothesis/frontend-shared/lib/next'
;
import
classnames
from
'classnames'
;
import
{
useCallback
,
useRef
,
useState
}
from
'preact/hooks'
;
...
...
@@ -132,7 +137,7 @@ export default function SearchInput({ alwaysExpanded, query, onSearch }) {
name
=
"searchForm"
onSubmit
=
{
onSubmit
}
>
<
Text
Input
<
Input
aria
-
label
=
"Search"
classes
=
{
classnames
(
// This element is ordered second in the flex layout (appears to the
...
...
@@ -169,7 +174,7 @@ export default function SearchInput({ alwaysExpanded, query, onSearch }) {
name
=
"query"
placeholder
=
{(
isLoading
&&
'Loading…'
)
||
'Search…'
}
disabled
=
{
isLoading
}
inpu
tRef
=
{
input
}
elemen
tRef
=
{
input
}
value
=
{
pendingQuery
||
''
}
onInput
=
{
e
=>
setPendingQuery
(
/** @type {HTMLInputElement} */
(
e
.
target
).
value
)
...
...
@@ -178,15 +183,15 @@ export default function SearchInput({ alwaysExpanded, query, onSearch }) {
{
!
isLoading
&&
(
<
div
className
=
"order-0"
>
<
IconButton
icon
=
"search"
icon
=
{
SearchIcon
}
onClick
=
{()
=>
input
.
current
?.
focus
()}
size
=
"
small
"
size
=
"
xs
"
title
=
"Search annotations"
/>
<
/div
>
)}
{
isLoading
&&
<
Spinner
size
=
"small"
/>
}
{
isLoading
&&
<
Spinner
/>
}
<
/form
>
);
}
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