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
2ca15261
Commit
2ca15261
authored
Dec 06, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small fixes
parent
aa81d368
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
Button.ts
theme/components/Button.ts
+3
-0
TokenSelectButton.tsx
ui/address/tokenSelect/TokenSelectButton.tsx
+1
-1
TokenSelectMenu.tsx
ui/address/tokenSelect/TokenSelectMenu.tsx
+4
-3
utils.ts
ui/address/tokenSelect/utils.ts
+0
-1
No files found.
theme/components/Button.ts
View file @
2ca15261
...
...
@@ -77,6 +77,9 @@ const variantOutline = defineStyle((props) => {
bg
:
props
.
isActive
?
activeBg
:
'
transparent
'
,
borderColor
:
props
.
isActive
?
activeBg
:
'
blue.400
'
,
color
:
props
.
isActive
?
activeColor
:
'
blue.400
'
,
p
:
{
color
:
'
blue.400
'
,
},
},
_disabled
:
{
color
,
...
...
ui/address/tokenSelect/TokenSelectButton.tsx
View file @
2ca15261
...
...
@@ -28,7 +28,7 @@ const TokenSelectButton = ({ isOpen, onClick, data }: Props, ref: React.Forwarde
<
Icon
as=
{
tokensIcon
}
boxSize=
{
4
}
mr=
{
2
}
/>
<
Text
fontWeight=
{
600
}
>
{
data
.
length
}
</
Text
>
<
Text
whiteSpace=
"pre"
variant=
"secondary"
fontWeight=
{
400
}
>
($
{
totalBn
.
toFormat
(
2
)
}
)
</
Text
>
<
Icon
as=
{
arrowIcon
}
transform=
{
isOpen
?
'
rotate(90deg)
'
:
'
rotate(-90deg)
'
}
transitionDuration=
"
normal
"
boxSize=
{
5
}
ml=
{
3
}
/>
<
Icon
as=
{
arrowIcon
}
transform=
{
isOpen
?
'
rotate(90deg)
'
:
'
rotate(-90deg)
'
}
transitionDuration=
"
faster
"
boxSize=
{
5
}
ml=
{
3
}
/>
</
Button
>
);
};
...
...
ui/address/tokenSelect/TokenSelectMenu.tsx
View file @
2ca15261
...
...
@@ -10,7 +10,7 @@ import searchIcon from 'icons/search.svg';
import
TokenSelectItem
from
'
./TokenSelectItem
'
;
import
type
{
Sort
,
EnhancedData
}
from
'
./utils
'
;
import
{
SORTABLE_TOKENS
,
sortTokenGroups
,
sortingFns
}
from
'
./utils
'
;
import
{
sortTokenGroups
,
sortingFns
}
from
'
./utils
'
;
interface
Props
{
searchTerm
:
string
;
...
...
@@ -56,14 +56,15 @@ const TokenSelectMenu = ({ erc20sort, erc1155sort, modifiedData, groupedData, on
return
'
desc
'
;
}
})();
const
hasSort
=
type
===
'
ERC-1155
'
||
(
type
===
'
ERC-20
'
&&
tokenInfo
.
some
(({
usd
})
=>
usd
));
return
(
<
Box
key=
{
type
}
>
<
Flex
justifyContent=
"space-between"
>
<
Text
mb=
{
3
}
color=
"gray.500"
fontWeight=
{
600
}
fontSize=
"sm"
>
{
type
}
tokens (
{
tokenInfo
.
length
}
)
</
Text
>
{
SORTABLE_TOKENS
.
includes
(
type
)
&&
(
{
hasSort
&&
(
<
Link
data
-
type=
{
type
}
onClick=
{
onSortClick
}
>
<
Icon
as=
{
arrowIcon
}
boxSize=
{
5
}
transform=
{
arrowTransform
}
transitionDuration=
"fast"
/>
<
Icon
as=
{
arrowIcon
}
boxSize=
{
5
}
transform=
{
arrowTransform
}
transitionDuration=
"fast
er
"
/>
</
Link
>
)
}
</
Flex
>
...
...
ui/address/tokenSelect/utils.ts
View file @
2ca15261
...
...
@@ -8,7 +8,6 @@ export type EnhancedData = AddressTokenBalance & {
}
export
type
Sort
=
'
desc
'
|
'
asc
'
;
export
const
SORTABLE_TOKENS
:
Array
<
TokenType
>
=
[
'
ERC-20
'
,
'
ERC-1155
'
];
const
TOKEN_GROUPS_ORDER
:
Array
<
TokenType
>
=
[
'
ERC-20
'
,
'
ERC-721
'
,
'
ERC-1155
'
];
type
TokenGroup
=
[
string
,
Array
<
AddressTokenBalance
>
];
...
...
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