Skip to content
GitLab
Explore
Sign in
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
3ee0cb02
Commit
3ee0cb02
authored
1 month ago
by
Dima Rifai
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#479
- Add zero change icon when balance is not changing
parent
ee45eeee
No related branches found
No related tags found
1 merge request
!587
Delrifai/#479 use aggregated balance api
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/balanceHistory/BalanceHistoryChart.tsx
+4
-2
4 additions, 2 deletions
components/balanceHistory/BalanceHistoryChart.tsx
with
4 additions
and
2 deletions
components/balanceHistory/BalanceHistoryChart.tsx
+
4
−
2
View file @
3ee0cb02
...
...
@@ -13,7 +13,8 @@ import {
import
{
formatNumber
}
from
"
@/lib/utils
"
;
import
{
cn
}
from
"
@/lib/utils
"
;
import
moment
from
"
moment
"
;
import
{
ArrowDown
,
ArrowUp
}
from
"
lucide-react
"
;
import
{
ArrowDown
,
ArrowUp
,
Minus
}
from
"
lucide-react
"
;
interface
BalanceHistoryChartProps
{
hiveBalanceHistoryData
?:
{
...
...
@@ -117,6 +118,7 @@ const BalanceHistoryChart: React.FC<BalanceHistoryChartProps> = ({
const
balanceChange
=
payload
[
0
]?.
payload
.
balance_change
??
0
;
const
isPositiveChange
=
balanceChange
>
0
;
const
isZeroChange
=
balanceChange
==
0
;
return
(
<
div
className
=
"bg-theme dark:bg-theme p-2 rounded border border-explorer-light-gray"
>
...
...
@@ -127,7 +129,7 @@ const BalanceHistoryChart: React.FC<BalanceHistoryChartProps> = ({
{
isPositiveChange
?
(
<
ArrowUp
className
=
"bg-green-400 p-[1.2px]"
size
=
{
16
}
/>
)
:
(
)
:
isZeroChange
?
<
Minus
className
=
"bg-black p-[1.2px] mr-1"
color
=
{
"
white
"
}
size
=
{
16
}
/>
:
(
<
ArrowDown
className
=
"bg-red-400 p-[1.2px]"
size
=
{
16
}
/>
)
}
{
`
${
formatNumber
(
...
...
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