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
04866841
Commit
04866841
authored
Sep 09, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filters
parent
38ad4c79
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
1 deletion
+78
-1
filter.svg
icons/filter.svg
+3
-0
Input.ts
theme/components/Input.ts
+12
-0
Filters.tsx
ui/shared/Filters.tsx
+60
-0
TxInternals.tsx
ui/tx/TxInternals.tsx
+3
-1
No files found.
icons/filter.svg
0 → 100644
View file @
04866841
<svg
viewBox=
"0 0 20 20"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
d=
"M8.5 14.167c0 .46.373.833.833.833H11a.833.833 0 1 0 0-1.667H9.333a.833.833 0 0 0-.833.834ZM3.5 5a.833.833 0 0 0 0 1.667h13.333a.833.833 0 0 0 0-1.667H3.5Zm1.667 5c0 .46.373.833.833.833h8.333a.833.833 0 0 0 0-1.666H6a.833.833 0 0 0-.833.833Z"
fill=
"currentColor"
/>
</svg>
theme/components/Input.ts
View file @
04866841
...
...
@@ -13,6 +13,14 @@ import getDefaultTransitionProps from '../utils/getDefaultTransitionProps';
import
getOutlinedFieldStyles
from
'
../utils/getOutlinedFieldStyles
'
;
const
size
=
{
xs
:
defineStyle
({
fontSize
:
'
md
'
,
lineHeight
:
'
24px
'
,
px
:
'
4px
'
,
py
:
'
12px
'
,
h
:
'
32px
'
,
borderRadius
:
'
base
'
,
}),
sm
:
defineStyle
({
fontSize
:
'
md
'
,
lineHeight
:
'
24px
'
,
...
...
@@ -55,6 +63,10 @@ const variantOutline = definePartsStyle((props) => {
});
const
sizes
=
{
xs
:
definePartsStyle
({
field
:
size
.
xs
,
addon
:
size
.
xs
,
}),
sm
:
definePartsStyle
({
field
:
size
.
sm
,
addon
:
size
.
sm
,
...
...
ui/shared/Filters.tsx
0 → 100644
View file @
04866841
import
{
SearchIcon
}
from
'
@chakra-ui/icons
'
;
import
{
Flex
,
Icon
,
Button
,
Circle
,
InputGroup
,
InputLeftElement
,
Input
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
import
React
from
'
react
'
;
import
filterIcon
from
'
icons/filter.svg
'
;
const
FilterIcon
=
<
Icon
as=
{
filterIcon
}
boxSize=
{
5
}
/>;
const
Filters
=
()
=>
{
const
[
isActive
,
setIsActive
]
=
React
.
useState
(
false
);
const
[
value
,
setValue
]
=
React
.
useState
(
''
);
const
handleClick
=
React
.
useCallback
(()
=>
{
setIsActive
(
flag
=>
!
flag
);
},
[]);
const
handleChange
=
React
.
useCallback
((
event
:
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setValue
(
event
.
target
.
value
);
},
[]);
const
badgeColor
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
badgeBgColor
=
useColorModeValue
(
'
blue.700
'
,
'
gray.50
'
);
const
searchIconColor
=
useColorModeValue
(
'
blackAlpha.600
'
,
'
whiteAlpha.600
'
);
const
inputBorderColor
=
useColorModeValue
(
'
blackAlpha.100
'
,
'
whiteAlpha.200
'
);
return
(
<
Flex
>
<
Button
leftIcon=
{
FilterIcon
}
rightIcon=
{
isActive
?
<
Circle
bg=
{
badgeBgColor
}
size=
{
5
}
color=
{
badgeColor
}
>
2
</
Circle
>
:
undefined
}
size=
"sm"
variant=
"outline"
colorScheme=
"gray-dark"
borderWidth=
"1px"
onClick=
{
handleClick
}
isActive=
{
isActive
}
px=
{
1.5
}
>
Filter
</
Button
>
<
InputGroup
size=
"xs"
ml=
{
3
}
maxW=
"360px"
>
<
InputLeftElement
ml=
{
1
}
>
<
SearchIcon
w=
{
5
}
h=
{
5
}
color=
{
searchIconColor
}
/>
</
InputLeftElement
>
<
Input
paddingInlineStart=
"38px"
placeholder=
"Search by addresses, hash, method..."
ml=
"1px"
onChange=
{
handleChange
}
borderColor=
{
inputBorderColor
}
value=
{
value
}
size=
"xs"
/>
</
InputGroup
>
</
Flex
>
);
};
export
default
Filters
;
ui/tx/TxInternals.tsx
View file @
04866841
...
...
@@ -2,12 +2,14 @@ import { Box, Table, Thead, Tbody, Tr, Th, TableContainer } from '@chakra-ui/rea
import
React
from
'
react
'
;
import
{
data
}
from
'
data/txInternal
'
;
import
Filters
from
'
ui/shared/Filters
'
;
import
TxInternalsTableItem
from
'
ui/tx/internals/TxInternalsTableItem
'
;
const
TxInternals
=
()
=>
{
return
(
<
Box
>
<
TableContainer
width=
"100%"
>
<
Filters
/>
<
TableContainer
width=
"100%"
mt=
{
6
}
>
<
Table
variant=
"simple"
minWidth=
"950px"
>
<
Thead
>
<
Tr
>
...
...
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