Skip to content
GitLab
Explore
Sign in
Register
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
fe30ce9d
Commit
fe30ce9d
authored
5 months ago
by
Lukas
Browse files
Options
Downloads
Patches
Plain Diff
Update DateTimePicker componet start date based on end date
parent
75311596
No related branches found
No related tags found
2 merge requests
!481
bring recent develop changes to mater to match the backend
,
!477
Lbudginas/#374 calendar dates selection bug
Pipeline
#109499
canceled
5 months ago
Stage: build
Stage: test
Stage: test-report-aggregate
Stage: cleanup
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/Witnesses/VotesHistoryDialog.tsx
+30
-16
30 additions, 16 deletions
components/Witnesses/VotesHistoryDialog.tsx
components/searchRanges/SearchRanges.tsx
+12
-1
12 additions, 1 deletion
components/searchRanges/SearchRanges.tsx
with
42 additions
and
17 deletions
components/Witnesses/VotesHistoryDialog.tsx
+
30
−
16
View file @
fe30ce9d
...
...
@@ -102,27 +102,41 @@ const VotesHistoryDialog: React.FC<VotersDialogProps> = ({
useEffect
(()
=>
{
const
fetchDynamicGlobalProperties
=
async
()
=>
{
const
dynamicGlobalProperties
=
await
fetchingService
.
getDynamicGlobalProperties
();
const
_totalVestingfundHive
=
dynamicGlobalProperties
.
total_vesting_fund_hive
;
const
_totalVestingShares
=
dynamicGlobalProperties
.
total_vesting_shares
;
const
dynamicGlobalProperties
=
await
fetchingService
.
getDynamicGlobalProperties
();
const
_totalVestingfundHive
=
dynamicGlobalProperties
.
total_vesting_fund_hive
;
const
_totalVestingShares
=
dynamicGlobalProperties
.
total_vesting_shares
;
setTotalVestingFundHive
(
_totalVestingfundHive
);
setTotalVestingShares
(
_totalVestingShares
);
}
setTotalVestingFundHive
(
_totalVestingfundHive
);
setTotalVestingShares
(
_totalVestingShares
);
};
fetchDynamicGlobalProperties
();
},
[]);
},
[]);
const
fetchHivePower
=
(
value
:
string
,
isHP
:
boolean
):
string
=>
{
if
(
isHP
)
{
if
(
!
hiveChain
)
return
""
;
return
convertVestsToHP
(
hiveChain
,
value
,
totalVestingFundHive
,
totalVestingShares
);
const
fetchHivePower
=
(
value
:
string
,
isHP
:
boolean
):
string
=>
{
if
(
isHP
)
{
if
(
!
hiveChain
)
return
""
;
return
convertVestsToHP
(
hiveChain
,
value
,
totalVestingFundHive
,
totalVestingShares
);
}
return
formatNumber
(
parseInt
(
value
),
true
,
false
)
+
"
Vests
"
;
// Return raw vests if not toggled to HP
return
formatNumber
(
parseInt
(
value
),
true
,
false
)
+
"
Vests
"
;
// Return raw vests if not toggled to HP
};
useEffect
(()
=>
{
if
(
fromDate
>=
toDate
)
{
const
date
=
new
Date
(
toDate
);
date
.
setHours
(
date
.
getHours
()
-
1
);
setFromDate
(
date
);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
},
[
fromDate
,
toDate
]);
return
(
<
Dialog
open
=
{
isVotesHistoryOpen
}
...
...
@@ -163,7 +177,7 @@ const VotesHistoryDialog: React.FC<VotersDialogProps> = ({
/>
<
label
>
HP
</
label
>
</
div
>
</
div
>
</
div
>
<
div
className
=
"flex justify-around items-center bg-explorer-bg-start rounded text-text p-2"
>
<
div
>
<
p
>
From:
</
p
>
...
...
@@ -171,7 +185,7 @@ const VotesHistoryDialog: React.FC<VotersDialogProps> = ({
date
=
{
fromDate
}
setDate
=
{
setFromDate
}
side
=
"bottom"
disableFuture
Date
s
=
{
t
ru
e
}
end
Date
=
{
t
oDat
e
}
/>
</
div
>
<
div
>
...
...
This diff is collapsed.
Click to expand it.
components/searchRanges/SearchRanges.tsx
+
12
−
1
View file @
fe30ce9d
import
React
from
"
react
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
SearchRangesResult
}
from
"
../../hooks/common/useSearchRanges
"
;
import
{
Select
,
SelectContent
,
SelectTrigger
,
SelectItem
}
from
"
../ui/select
"
;
...
...
@@ -43,6 +43,16 @@ const SearchRanges: React.FC<SearchRangesProps> = ({
}
};
useEffect
(()
=>
{
if
(
!
startDate
||
!
endDate
)
return
;
if
(
startDate
>=
endDate
)
{
const
date
=
new
Date
(
endDate
);
date
.
setHours
(
date
.
getHours
()
-
1
);
setStartDate
(
date
);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
},
[
startDate
,
endDate
]);
return
(
<
div
className
=
"py-2 flex flex-col gap-y-2"
>
<
Select
...
...
@@ -165,6 +175,7 @@ const SearchRanges: React.FC<SearchRangesProps> = ({
<
DateTimePicker
date
=
{
startDate
||
new
Date
()
}
setDate
=
{
setStartDate
}
endDate
=
{
endDate
}
/>
</
div
>
<
div
className
=
"flex flex-col w-full"
>
...
...
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