Skip to content

Commit 6e7f215

Browse files
committed
fixes after rebase
1 parent fff6b1d commit 6e7f215

File tree

5 files changed

+46
-187
lines changed

5 files changed

+46
-187
lines changed

src/components/common/Extensions/UserHub/partials/BalanceTab/partials/BalanceInfoRow/BalanceInfoRow.tsx

Lines changed: 0 additions & 159 deletions
This file was deleted.

src/components/common/Extensions/UserHub/partials/BalanceTab/partials/BalanceInfoRow/types.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
};

src/components/common/Extensions/UserHub/partials/ReputationTab/partials/TotalReputation/TotalReputation.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff 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
/>

src/components/v5/common/CompletedAction/partials/StreamingPayment/partials/CreatedWithPermissionsInfo/CreatedWithPermissionsInfo.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { formatDate } from '~utils/date.ts';
55
import { formatText } from '~utils/intl.ts';
66
import MenuWithStatusText from '~v5/shared/MenuWithStatusText/index.ts';
77
import { StatusTypes } from '~v5/shared/StatusText/consts.ts';
8+
import StatusText from '~v5/shared/StatusText/StatusText.tsx';
89
import UserPopover from '~v5/shared/UserPopover/UserPopover.tsx';
910

1011
import { 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',

0 commit comments

Comments
 (0)