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
516dbb45
Commit
516dbb45
authored
Sep 21, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
empty state
parent
92030c31
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
12 deletions
+36
-12
AppList.tsx
ui/apps/AppList.tsx
+2
-1
EmptySearchResult.tsx
ui/apps/EmptySearchResult.tsx
+6
-3
Filters.tsx
ui/shared/Filters.tsx
+4
-0
TxInternals.tsx
ui/tx/TxInternals.tsx
+23
-7
TxInternalsFilter.tsx
ui/tx/internals/TxInternalsFilter.tsx
+1
-1
No files found.
ui/apps/AppList.tsx
View file @
516dbb45
...
@@ -3,6 +3,7 @@ import React from 'react';
...
@@ -3,6 +3,7 @@ import React from 'react';
import
type
{
AppItemOverview
}
from
'
types/client/apps
'
;
import
type
{
AppItemOverview
}
from
'
types/client/apps
'
;
import
{
apos
}
from
'
lib/html-entities
'
;
import
AppCard
from
'
ui/apps/AppCard
'
;
import
AppCard
from
'
ui/apps/AppCard
'
;
import
EmptySearchResult
from
'
ui/apps/EmptySearchResult
'
;
import
EmptySearchResult
from
'
ui/apps/EmptySearchResult
'
;
...
@@ -42,7 +43,7 @@ const AppList = ({ apps }: Props) => {
...
@@ -42,7 +43,7 @@ const AppList = ({ apps }: Props) => {
))
}
))
}
</
Grid
>
</
Grid
>
)
:
(
)
:
(
<
EmptySearchResult
/>
<
EmptySearchResult
text=
{
`Couldn${ apos }t find an app that matches your filter query.`
}
/>
)
}
)
}
</>
</>
);
);
...
...
ui/apps/EmptySearchResult.tsx
View file @
516dbb45
...
@@ -2,9 +2,12 @@ import { Box, Heading, Icon, Text } from '@chakra-ui/react';
...
@@ -2,9 +2,12 @@ import { Box, Heading, Icon, Text } from '@chakra-ui/react';
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
emptyIcon
from
'
icons/empty_search_result.svg
'
;
import
emptyIcon
from
'
icons/empty_search_result.svg
'
;
import
{
apos
}
from
'
lib/html-entities
'
;
const
EmptySearchResult
=
()
=>
{
interface
Props
{
text
:
string
;
}
const
EmptySearchResult
=
({
text
}:
Props
)
=>
{
return
(
return
(
<
Box
<
Box
display=
"flex"
display=
"flex"
...
@@ -31,7 +34,7 @@ const EmptySearchResult = () => {
...
@@ -31,7 +34,7 @@ const EmptySearchResult = () => {
variant=
"secondary"
variant=
"secondary"
align=
"center"
align=
"center"
>
>
Couldn
{
apos
}
t find an app that matches your filter query.
{
text
}
</
Text
>
</
Text
>
</
Box
>
</
Box
>
);
);
...
...
ui/shared/Filters.tsx
View file @
516dbb45
// DEPRECATED
// migrate to separate components
// ui/shared/FilterButton.tsx + custom filter
// ui/shared/FilterInput.tsx
import
{
SearchIcon
}
from
'
@chakra-ui/icons
'
;
import
{
SearchIcon
}
from
'
@chakra-ui/icons
'
;
import
{
Flex
,
Icon
,
Button
,
Circle
,
InputGroup
,
InputLeftElement
,
Input
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Icon
,
Button
,
Circle
,
InputGroup
,
InputLeftElement
,
Input
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
...
...
ui/tx/TxInternals.tsx
View file @
516dbb45
...
@@ -5,6 +5,8 @@ import type { TxInternalsType } from 'types/api/tx';
...
@@ -5,6 +5,8 @@ import type { TxInternalsType } from 'types/api/tx';
import
type
ArrayElement
from
'
types/utils/ArrayElement
'
;
import
type
ArrayElement
from
'
types/utils/ArrayElement
'
;
import
{
data
}
from
'
data/txInternal
'
;
import
{
data
}
from
'
data/txInternal
'
;
import
{
apos
}
from
'
lib/html-entities
'
;
import
EmptySearchResult
from
'
ui/apps/EmptySearchResult
'
;
import
FilterInput
from
'
ui/shared/FilterInput
'
;
import
FilterInput
from
'
ui/shared/FilterInput
'
;
import
TxInternalsFilter
from
'
ui/tx/internals/TxInternalsFilter
'
;
import
TxInternalsFilter
from
'
ui/tx/internals/TxInternalsFilter
'
;
import
TxInternalsTableItem
from
'
ui/tx/internals/TxInternalsTableItem
'
;
import
TxInternalsTableItem
from
'
ui/tx/internals/TxInternalsTableItem
'
;
...
@@ -26,13 +28,17 @@ const TxInternals = () => {
...
@@ -26,13 +28,17 @@ const TxInternals = () => {
setFilters
(
nextValue
);
setFilters
(
nextValue
);
},
[]);
},
[]);
return
(
const
content
=
(()
=>
{
<
Box
>
const
filteredData
=
data
<
Flex
>
.
filter
(({
type
})
=>
filters
.
includes
(
type
))
<
TxInternalsFilter
onFilterChange=
{
handleFilterChange
}
defaultFilters=
{
filters
}
appliedFiltersNum=
{
filters
.
length
}
/>
.
filter
(
searchFn
(
searchTerm
));
<
FilterInput
onChange=
{
setSearchTerm
}
maxW=
"360px"
ml=
{
3
}
size=
"xs"
placeholder=
"Search by addresses, hash, method..."
/>
</
Flex
>
if
(
filteredData
.
length
===
0
)
{
<
TableContainer
width=
"100%"
mt=
{
6
}
>
return
<
EmptySearchResult
text=
{
`Couldn${ apos }t find any transaction that matches your query.`
}
/>;
}
return
(
<
TableContainer
width=
"100%"
>
<
Table
variant=
"simple"
minWidth=
"950px"
size=
"sm"
>
<
Table
variant=
"simple"
minWidth=
"950px"
size=
"sm"
>
<
Thead
>
<
Thead
>
<
Tr
>
<
Tr
>
...
@@ -51,6 +57,16 @@ const TxInternals = () => {
...
@@ -51,6 +57,16 @@ const TxInternals = () => {
</
Tbody
>
</
Tbody
>
</
Table
>
</
Table
>
</
TableContainer
>
</
TableContainer
>
);
})();
return
(
<
Box
>
<
Flex
mb=
{
6
}
>
<
TxInternalsFilter
onFilterChange=
{
handleFilterChange
}
defaultFilters=
{
filters
}
appliedFiltersNum=
{
filters
.
length
}
/>
<
FilterInput
onChange=
{
setSearchTerm
}
maxW=
"360px"
ml=
{
3
}
size=
"xs"
placeholder=
"Search by addresses, hash, method..."
/>
</
Flex
>
{
content
}
</
Box
>
</
Box
>
);
);
};
};
...
...
ui/tx/internals/TxInternalsFilter.tsx
View file @
516dbb45
...
@@ -38,4 +38,4 @@ const TxInternalsFilter = ({ onFilterChange, defaultFilters, appliedFiltersNum }
...
@@ -38,4 +38,4 @@ const TxInternalsFilter = ({ onFilterChange, defaultFilters, appliedFiltersNum }
);
);
};
};
export
default
TxInternalsFilter
;
export
default
React
.
memo
(
TxInternalsFilter
)
;
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