Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
vicotor
frontend
Commits
bc0d69ae
Commit
bc0d69ae
authored
Dec 28, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaks
parent
0c1fa3f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
SearchResults.tsx
ui/pages/SearchResults.tsx
+4
-4
SearchBar.tsx
ui/snippets/searchBar/SearchBar.tsx
+1
-0
useSearchQuery.tsx
ui/snippets/searchBar/useSearchQuery.tsx
+1
-0
No files found.
ui/pages/SearchResults.tsx
View file @
bc0d69ae
...
...
@@ -18,7 +18,7 @@ import SearchBarInput from 'ui/snippets/searchBar/SearchBarInput';
import
useSearchQuery
from
'
ui/snippets/searchBar/useSearchQuery
'
;
const
SearchResultsPageContent
=
()
=>
{
const
{
query
,
searchTerm
,
handleSearchTermChange
}
=
useSearchQuery
(
true
);
const
{
query
,
searchTerm
,
debouncedSearchTerm
,
handleSearchTermChange
}
=
useSearchQuery
(
true
);
const
{
data
,
isError
,
isLoading
,
pagination
,
isPaginationVisible
}
=
query
;
const
handleSubmit
=
React
.
useCallback
((
event
:
FormEvent
<
HTMLFormElement
>
)
=>
{
...
...
@@ -54,7 +54,7 @@ const SearchResultsPageContent = () => {
<
span
>
Found
</
span
>
<
chakra
.
span
fontWeight=
{
700
}
>
{
num
}{
data
.
next_page_params
||
pagination
.
page
>
1
?
'
+
'
:
''
}
</
chakra
.
span
>
<
span
>
matching results for
</
span
>
“
<
chakra
.
span
fontWeight=
{
700
}
>
{
s
earchTerm
}
</
chakra
.
span
>
”
“
<
chakra
.
span
fontWeight=
{
700
}
>
{
debouncedS
earchTerm
}
</
chakra
.
span
>
”
</
Box
>
);
...
...
@@ -80,7 +80,7 @@ const SearchResultsPageContent = () => {
{
data
.
items
.
length
>
0
&&
(
<>
<
Show
below=
"lg"
ssr=
{
false
}
>
{
data
.
items
.
map
((
item
,
index
)
=>
<
SearchResultListItem
key=
{
index
}
data=
{
item
}
searchTerm=
{
s
earchTerm
}
/>)
}
{
data
.
items
.
map
((
item
,
index
)
=>
<
SearchResultListItem
key=
{
index
}
data=
{
item
}
searchTerm=
{
debouncedS
earchTerm
}
/>)
}
</
Show
>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Table
variant=
"simple"
size=
"md"
fontWeight=
{
500
}
>
...
...
@@ -92,7 +92,7 @@ const SearchResultsPageContent = () => {
</
Tr
>
</
Thead
>
<
Tbody
>
{
data
.
items
.
map
((
item
,
index
)
=>
<
SearchResultTableItem
key=
{
index
}
data=
{
item
}
searchTerm=
{
s
earchTerm
}
/>)
}
{
data
.
items
.
map
((
item
,
index
)
=>
<
SearchResultTableItem
key=
{
index
}
data=
{
item
}
searchTerm=
{
debouncedS
earchTerm
}
/>)
}
</
Tbody
>
</
Table
>
</
Hide
>
...
...
ui/snippets/searchBar/SearchBar.tsx
View file @
bc0d69ae
...
...
@@ -62,6 +62,7 @@ const SearchBar = ({ isHomepage, withShadow }: Props) => {
onClose=
{
onClose
}
placement=
"bottom-start"
offset=
{
isMobile
&&
!
isHomepage
?
[
16
,
-
12
]
:
undefined
}
isLazy
>
<
PopoverTrigger
>
<
SearchBarInput
...
...
ui/snippets/searchBar/useSearchQuery.tsx
View file @
bc0d69ae
...
...
@@ -76,6 +76,7 @@ export default function useSearchQuery(isSearchPage = false) {
return
{
searchTerm
,
debouncedSearchTerm
,
handleSearchTermChange
,
query
,
};
...
...
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