File tree Expand file tree Collapse file tree 5 files changed +46
-187
lines changed
common/Extensions/UserHub/partials
BalanceTab/partials/BalanceInfoRow
v5/common/CompletedAction/partials/StreamingPayment/partials/CreatedWithPermissionsInfo Expand file tree Collapse file tree 5 files changed +46
-187
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import Decimal from 'decimal.js' ;
2+
3+ /**
4+ * Function calculating and formatting the amount of reputation decay in the next day
5+ */
6+ export const getReputationDecayInNextDay = (
7+ currentReputation : string ,
8+ nativeTokenDecimals : number ,
9+ ) => {
10+ const convertedReputation = new Decimal ( currentReputation ) ;
11+ const nextDayDecay = convertedReputation . sub (
12+ convertedReputation . mul ( new Decimal ( 0.5 ) . pow ( 1 / 90 ) ) ,
13+ ) ;
14+ return nextDayDecay
15+ . div ( new Decimal ( 10 ) . pow ( nativeTokenDecimals ) )
16+ . round ( )
17+ . toString ( ) ;
18+ } ;
19+
20+ const REPUTATION_CYCLE_DURATION_IN_HOURS = 1 ;
21+
22+ /**
23+ * Function calculating the date of the next reputation mining cycle, based on the date of the last completed cycle
24+ */
25+ export const getNextMiningCycleDate = ( lastCompletedAt : Date ) => {
26+ const nextCycleTime = new Date ( lastCompletedAt ) ;
27+ nextCycleTime . setHours (
28+ nextCycleTime . getHours ( ) + REPUTATION_CYCLE_DURATION_IN_HOURS ,
29+ ) ;
30+ return nextCycleTime ;
31+ } ;
Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ const TotalReputation: FC<TotalReputationProps> = ({
7474 : percentageReputation || 0
7575 }
7676 suffix = " %"
77- appearance = { { size : 'small' } }
7877 />
7978 ) }
8079 </ div >
@@ -83,13 +82,7 @@ const TotalReputation: FC<TotalReputationProps> = ({
8382 {
8483 key : '2' ,
8584 label : formatText ( MSG . reputationPoints ) ,
86- value : (
87- < Numeral
88- value = { formattedReputationPoints }
89- suffix = " pts"
90- appearance = { { size : 'small' } }
91- />
92- ) ,
85+ value : < Numeral value = { formattedReputationPoints } suffix = " pts" /> ,
9386 } ,
9487 ] }
9588 />
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { formatDate } from '~utils/date.ts';
55import { formatText } from '~utils/intl.ts' ;
66import MenuWithStatusText from '~v5/shared/MenuWithStatusText/index.ts' ;
77import { StatusTypes } from '~v5/shared/StatusText/consts.ts' ;
8+ import StatusText from '~v5/shared/StatusText/StatusText.tsx' ;
89import UserPopover from '~v5/shared/UserPopover/UserPopover.tsx' ;
910
1011import { type CreatedWithPermissionsInfoProps } from './types.ts' ;
@@ -20,16 +21,19 @@ const CreatedWithPermissionsInfo: FC<CreatedWithPermissionsInfoProps> = ({
2021
2122 return (
2223 < MenuWithStatusText
23- statusTextSectionProps = { {
24- status : StatusTypes . Info ,
25- children : formatText ( {
26- id : 'action.executed.permissions.description' ,
27- } ) ,
28- textClassName : 'text-4 text-gray-900' ,
29- iconAlignment : 'top' ,
30- iconSize : 16 ,
31- iconClassName : 'text-gray-500' ,
32- } }
24+ statusText = {
25+ < StatusText
26+ status = { StatusTypes . Info }
27+ textClassName = "text-4 text-gray-900"
28+ iconAlignment = "top"
29+ iconSize = { 16 }
30+ iconClassName = "text-gray-500"
31+ >
32+ { formatText ( {
33+ id : 'action.executed.permissions.description' ,
34+ } ) }
35+ </ StatusText >
36+ }
3337 sections = { [
3438 {
3539 key : '1' ,
You can’t perform that action at this time.
0 commit comments