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
35bc0fd7
Commit
35bc0fd7
authored
Jan 16, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new arrow styles
parent
f2ad3186
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
18 deletions
+102
-18
AddressTxsFilter.tsx
ui/address/AddressTxsFilter.tsx
+2
-2
IconSvg.tsx
ui/shared/IconSvg.tsx
+3
-3
TokenTransferFilter.tsx
ui/shared/TokenTransfer/TokenTransferFilter.tsx
+3
-3
AddressFromTo.tsx
ui/shared/address/AddressFromTo.tsx
+10
-9
AddressFromToIcon.tsx
ui/shared/address/AddressFromToIcon.tsx
+62
-0
utils.ts
ui/shared/address/utils.ts
+21
-0
AddressEntity.tsx
ui/shared/entities/address/AddressEntity.tsx
+1
-1
No files found.
ui/address/AddressTxsFilter.tsx
View file @
35bc0fd7
...
@@ -38,8 +38,8 @@ const AddressTxsFilter = ({ onFilterChange, defaultFilter, isActive, isLoading }
...
@@ -38,8 +38,8 @@ const AddressTxsFilter = ({ onFilterChange, defaultFilter, isActive, isLoading }
<
MenuList
zIndex=
{
2
}
>
<
MenuList
zIndex=
{
2
}
>
<
MenuOptionGroup
defaultValue=
{
defaultFilter
||
'
all
'
}
title=
"Address"
type=
"radio"
onChange=
{
onFilterChange
}
>
<
MenuOptionGroup
defaultValue=
{
defaultFilter
||
'
all
'
}
title=
"Address"
type=
"radio"
onChange=
{
onFilterChange
}
>
<
MenuItemOption
value=
"all"
>
All
</
MenuItemOption
>
<
MenuItemOption
value=
"all"
>
All
</
MenuItemOption
>
<
MenuItemOption
value=
"from"
>
From
</
MenuItemOption
>
<
MenuItemOption
value=
"from"
>
Outgoing transactions
</
MenuItemOption
>
<
MenuItemOption
value=
"to"
>
To
</
MenuItemOption
>
<
MenuItemOption
value=
"to"
>
Incoming transactions
</
MenuItemOption
>
</
MenuOptionGroup
>
</
MenuOptionGroup
>
</
MenuList
>
</
MenuList
>
</
Menu
>
</
Menu
>
...
...
ui/shared/IconSvg.tsx
View file @
35bc0fd7
...
@@ -12,9 +12,9 @@ interface Props extends HTMLChakraProps<'div'> {
...
@@ -12,9 +12,9 @@ interface Props extends HTMLChakraProps<'div'> {
isLoading
?:
boolean
;
isLoading
?:
boolean
;
}
}
const
IconSvg
=
({
name
,
isLoading
,
...
props
}:
Props
)
=>
{
const
IconSvg
=
({
name
,
isLoading
,
...
props
}:
Props
,
ref
:
React
.
ForwardedRef
<
HTMLDivElement
>
)
=>
{
return
(
return
(
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
{
...
props
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
{
...
props
}
ref=
{
ref
}
>
<
chakra
.
svg
w=
"100%"
h=
"100%"
>
<
chakra
.
svg
w=
"100%"
h=
"100%"
>
<
use
href=
{
`${ href }#${ name }`
}
/>
<
use
href=
{
`${ href }#${ name }`
}
/>
</
chakra
.
svg
>
</
chakra
.
svg
>
...
@@ -22,4 +22,4 @@ const IconSvg = ({ name, isLoading, ...props }: Props) => {
...
@@ -22,4 +22,4 @@ const IconSvg = ({ name, isLoading, ...props }: Props) => {
);
);
};
};
export
default
IconSvg
;
export
default
React
.
forwardRef
(
IconSvg
)
;
ui/shared/TokenTransfer/TokenTransferFilter.tsx
View file @
35bc0fd7
...
@@ -35,7 +35,7 @@ const TokenTransferFilter = ({
...
@@ -35,7 +35,7 @@ const TokenTransferFilter = ({
const
isInitialLoading
=
useIsInitialLoading
(
isLoading
);
const
isInitialLoading
=
useIsInitialLoading
(
isLoading
);
return
(
return
(
<
PopoverFilter
appliedFiltersNum=
{
appliedFiltersNum
}
contentProps=
{
{
w
:
'
2
0
0px
'
}
}
isLoading=
{
isInitialLoading
}
>
<
PopoverFilter
appliedFiltersNum=
{
appliedFiltersNum
}
contentProps=
{
{
w
:
'
2
2
0px
'
}
}
isLoading=
{
isInitialLoading
}
>
{
withAddressFilter
&&
(
{
withAddressFilter
&&
(
<>
<>
<
Text
variant=
"secondary"
fontWeight=
{
600
}
>
Address
</
Text
>
<
Text
variant=
"secondary"
fontWeight=
{
600
}
>
Address
</
Text
>
...
@@ -49,8 +49,8 @@ const TokenTransferFilter = ({
...
@@ -49,8 +49,8 @@ const TokenTransferFilter = ({
>
>
<
Stack
spacing=
{
4
}
>
<
Stack
spacing=
{
4
}
>
<
Radio
value=
"all"
><
Text
fontSize=
"md"
>
All
</
Text
></
Radio
>
<
Radio
value=
"all"
><
Text
fontSize=
"md"
>
All
</
Text
></
Radio
>
<
Radio
value=
"from"
><
Text
fontSize=
"md"
>
From
</
Text
></
Radio
>
<
Radio
value=
"from"
><
Text
fontSize=
"md"
>
Outgoing transfers
</
Text
></
Radio
>
<
Radio
value=
"to"
><
Text
fontSize=
"md"
>
To
</
Text
></
Radio
>
<
Radio
value=
"to"
><
Text
fontSize=
"md"
>
Incoming transfers
</
Text
></
Radio
>
</
Stack
>
</
Stack
>
</
RadioGroup
>
</
RadioGroup
>
</>
</>
...
...
ui/shared/address/AddressFromTo.tsx
View file @
35bc0fd7
import
type
{
ThemeTypings
}
from
'
@chakra-ui/react
'
;
import
type
{
ThemeTypings
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
chakra
,
useBreakpointValue
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
chakra
,
useBreakpointValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
AddressParam
}
from
'
types/api/addressParams
'
;
import
type
{
AddressParam
}
from
'
types/api/addressParams
'
;
...
@@ -7,7 +7,9 @@ import type { AddressParam } from 'types/api/addressParams';
...
@@ -7,7 +7,9 @@ import type { AddressParam } from 'types/api/addressParams';
import
type
{
EntityProps
}
from
'
ui/shared/entities/address/AddressEntity
'
;
import
type
{
EntityProps
}
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntityWithTokenFilter
from
'
ui/shared/entities/address/AddressEntityWithTokenFilter
'
;
import
AddressEntityWithTokenFilter
from
'
ui/shared/entities/address/AddressEntityWithTokenFilter
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
AddressFromToIcon
from
'
./AddressFromToIcon
'
;
import
{
getTxCourseType
}
from
'
./utils
'
;
type
Mode
=
'
compact
'
|
'
long
'
;
type
Mode
=
'
compact
'
|
'
long
'
;
...
@@ -24,7 +26,6 @@ interface Props {
...
@@ -24,7 +26,6 @@ interface Props {
}
}
const
AddressFromTo
=
({
from
,
to
,
current
,
mode
:
modeProp
,
className
,
isLoading
,
tokenHash
=
''
,
truncation
,
noIcon
}:
Props
)
=>
{
const
AddressFromTo
=
({
from
,
to
,
current
,
mode
:
modeProp
,
className
,
isLoading
,
tokenHash
=
''
,
truncation
,
noIcon
}:
Props
)
=>
{
const
iconColor
=
useColorModeValue
(
'
gray.500
'
,
'
gray.300
'
);
const
mode
=
useBreakpointValue
(
const
mode
=
useBreakpointValue
(
{
{
base
:
(
typeof
modeProp
===
'
object
'
?
modeProp
.
base
:
modeProp
),
base
:
(
typeof
modeProp
===
'
object
'
?
modeProp
.
base
:
modeProp
),
...
@@ -39,12 +40,9 @@ const AddressFromTo = ({ from, to, current, mode: modeProp, className, isLoading
...
@@ -39,12 +40,9 @@ const AddressFromTo = ({ from, to, current, mode: modeProp, className, isLoading
return
(
return
(
<
Flex
className=
{
className
}
flexDir=
"column"
rowGap=
{
3
}
>
<
Flex
className=
{
className
}
flexDir=
"column"
rowGap=
{
3
}
>
<
Flex
alignItems=
"center"
columnGap=
{
2
}
>
<
Flex
alignItems=
"center"
columnGap=
{
2
}
>
<
IconSvg
<
AddressFromToIcon
name=
"arrows/east"
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
color=
{
iconColor
}
type=
{
getTxCourseType
(
from
.
hash
,
to
?.
hash
,
current
)
}
boxSize=
{
5
}
flexShrink=
{
0
}
transform=
"rotate(90deg)"
transform=
"rotate(90deg)"
/>
/>
<
Entity
<
Entity
...
@@ -89,7 +87,10 @@ const AddressFromTo = ({ from, to, current, mode: modeProp, className, isLoading
...
@@ -89,7 +87,10 @@ const AddressFromTo = ({ from, to, current, mode: modeProp, className, isLoading
truncation=
{
truncation
}
truncation=
{
truncation
}
maxW=
{
truncation
===
'
constant
'
?
undefined
:
'
calc(50% - 18px)
'
}
maxW=
{
truncation
===
'
constant
'
?
undefined
:
'
calc(50% - 18px)
'
}
/>
/>
<
IconSvg
name=
"arrows/east"
color=
{
iconColor
}
boxSize=
{
5
}
flexShrink=
{
0
}
isLoading=
{
isLoading
}
/>
<
AddressFromToIcon
isLoading=
{
isLoading
}
type=
{
getTxCourseType
(
from
.
hash
,
to
?.
hash
,
current
)
}
/>
{
to
?
(
{
to
?
(
<
Entity
<
Entity
address=
{
to
}
address=
{
to
}
...
...
ui/shared/address/AddressFromToIcon.tsx
0 → 100644
View file @
35bc0fd7
import
{
Tooltip
,
chakra
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
type
{
TxCourseType
}
from
'
./utils
'
;
interface
Props
{
isLoading
?:
boolean
;
type
:
TxCourseType
;
className
?:
string
;
}
const
AddressFromToIcon
=
({
isLoading
,
type
,
className
}:
Props
)
=>
{
const
styles
=
{
'
in
'
:
{
color
:
useColorModeValue
(
'
green.500
'
,
'
green.200
'
),
bgColor
:
useColorModeValue
(
'
green.50
'
,
'
green.800
'
),
},
out
:
{
color
:
useColorModeValue
(
'
yellow.600
'
,
'
yellow.500
'
),
bgColor
:
useColorModeValue
(
'
orange.50
'
,
'
yellow.900
'
),
},
self
:
{
color
:
useColorModeValue
(
'
gray.500
'
,
'
gray.300
'
),
bgColor
:
'
transparent
'
,
},
unspecified
:
{
color
:
useColorModeValue
(
'
gray.500
'
,
'
gray.300
'
),
bgColor
:
'
transparent
'
,
},
};
const
labels
=
{
'
in
'
:
'
Incoming txn
'
,
out
:
'
Outgoing txn
'
,
self
:
'
Self txn
'
,
};
const
icon
=
(
<
IconSvg
name=
"arrows/east"
{
...
(
styles
[
type
])
}
className=
{
className
}
isLoading=
{
isLoading
}
boxSize=
{
5
}
flexShrink=
{
0
}
borderRadius=
"sm"
/>
);
if
(
type
===
'
unspecified
'
)
{
return
icon
;
}
return
(
<
Tooltip
label=
{
labels
[
type
]
}
>
{
icon
}
</
Tooltip
>
);
};
export
default
React
.
memo
(
chakra
(
AddressFromToIcon
));
ui/shared/address/utils.ts
0 → 100644
View file @
35bc0fd7
export
type
TxCourseType
=
'
in
'
|
'
out
'
|
'
self
'
|
'
unspecified
'
;
export
function
getTxCourseType
(
from
:
string
,
to
:
string
|
undefined
,
current
?:
string
):
TxCourseType
{
if
(
current
===
undefined
)
{
return
'
unspecified
'
;
}
if
(
to
&&
from
===
to
&&
from
===
current
)
{
return
'
self
'
;
}
if
(
from
===
current
)
{
return
'
out
'
;
}
if
(
to
&&
to
===
current
)
{
return
'
in
'
;
}
return
'
unspecified
'
;
}
ui/shared/entities/address/AddressEntity.tsx
View file @
35bc0fd7
...
@@ -161,7 +161,7 @@ const AddressEntry = (props: EntityProps) => {
...
@@ -161,7 +161,7 @@ const AddressEntry = (props: EntityProps) => {
content
:
`" "`
,
content
:
`" "`
,
position
:
'
absolute
'
,
position
:
'
absolute
'
,
top
:
'
-5px
'
,
top
:
'
-5px
'
,
left
:
'
-
5
px
'
,
left
:
'
-
6
px
'
,
width
:
`calc(100% + ${ props.noCopy ? 10 : 5 }px)`
,
width
:
`calc(100% + ${ props.noCopy ? 10 : 5 }px)`
,
height
:
'
calc(100% + 8px)
'
,
height
:
'
calc(100% + 8px)
'
,
borderRadius
:
'
base
'
,
borderRadius
:
'
base
'
,
...
...
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