Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Block Explorer UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
Block Explorer UI
Commits
7f24e1af
Commit
7f24e1af
authored
2 months ago
by
Dima Rifai
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#433
- Use NoResult component
parent
8dc0ee0a
No related branches found
No related tags found
1 merge request
!526
Delrifai/#433 add no result component
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/home/searches/searchesResults/BlockSearchResults.tsx
+16
-15
16 additions, 15 deletions
...ents/home/searches/searchesResults/BlockSearchResults.tsx
with
16 additions
and
15 deletions
components/home/searches/searchesResults/BlockSearchResults.tsx
+
16
−
15
View file @
7f24e1af
...
...
@@ -5,6 +5,7 @@ import useBlockSearch from "@/hooks/api/homePage/useBlockSearch";
import
useOperationsTypes
from
"
@/hooks/api/common/useOperationsTypes
"
;
import
ErrorPage
from
"
@/pages/ErrorPage
"
;
import
{
getBlockPageLink
}
from
"
../utils/blockSearchHelpers
"
;
import
NoResults
from
"
@/components/NoResults
"
;
const
BlockSearchResults
=
()
=>
{
const
{
blockSearchProps
}
=
useSearchesContext
();
...
...
@@ -22,26 +23,26 @@ const BlockSearchResults = () => {
if
(
!
blockSearchData
)
return
;
return
(
<
div
className
=
"bg-theme dark:bg-theme p-2 md: h-fit rounded"
>
<
div
className
=
"text-center"
>
Results:
</
div
>
<
div
className
=
"flex flex-wrap"
>
<
div
className
=
"bg-theme dark:bg-theme p-2 md:h-fit rounded"
>
{
blockSearchData
.
total_blocks
>
0
?
(
blockSearchData
.
blocks_result
.
map
(({
block_num
})
=>
(
<
Link
key
=
{
block_num
}
href
=
{
blockPageLink
(
block_num
)
}
>
<
div
className
=
"m-1 border border-solid p-1"
>
{
block_num
}
</
div
>
</
Link
>
))
<>
<
div
className
=
"text-center"
>
Results:
</
div
>
<
div
className
=
"flex flex-wrap"
>
{
blockSearchData
.
blocks_result
.
map
(({
block_num
})
=>
(
<
Link
key
=
{
block_num
}
href
=
{
blockPageLink
(
block_num
)
}
>
<
div
className
=
"m-1 border border-solid p-1"
>
{
block_num
}
</
div
>
</
Link
>
))
}
</
div
>
</>
)
:
(
<
div
className
=
"flex justify-center w-full"
>
No blocks matching given criteria
</
div
>
<
NoResults
/>
)
}
</
div
>
</
div
>
);
};
export
default
BlockSearchResults
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment