Skip to content

Commit 74a24af

Browse files
committed
Merge branch 'feature/oct-1584-allow-unlock-for-admin'
2 parents a6204e1 + b5e0225 commit 74a24af

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const PROJECT_ADMINS_ALLOWED_TO_LOCK_UNLOCK_GLMS = [
2+
'0x0194325BF525Be0D4fBB0856894cEd74Da3B8356',
3+
];

client/src/views/EarnView/EarnView.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import cx from 'classnames';
22
import React, { ReactElement, useState, useEffect } from 'react';
33
import { useTranslation } from 'react-i18next';
4+
import { useAccount } from 'wagmi';
45

56
import EarnBoxGlmLock from 'components/Earn/EarnBoxGlmLock';
67
import EarnBoxPersonalAllocation from 'components/Earn/EarnBoxPersonalAllocation';
@@ -9,6 +10,7 @@ import EarnTipTiles from 'components/Earn/EarnTipTiles';
910
import Layout from 'components/shared/Layout';
1011
import TimeCounter from 'components/shared/TimeCounter';
1112
import BoxRounded from 'components/ui/BoxRounded';
13+
import { PROJECT_ADMINS_ALLOWED_TO_LOCK_UNLOCK_GLMS } from 'constants/projectAdmins';
1214
import useIsProjectAdminMode from 'hooks/helpers/useIsProjectAdminMode';
1315
import useCurrentEpoch from 'hooks/queries/useCurrentEpoch';
1416
import getIsPreLaunch from 'utils/getIsPreLaunch';
@@ -19,6 +21,7 @@ const EarnView = (): ReactElement => {
1921
const { t } = useTranslation('translation', {
2022
keyPrefix: 'views.earn',
2123
});
24+
const { address } = useAccount();
2225
const [isPollingForCurrentEpoch, setIsPollingForCurrentEpoch] = useState<boolean>(false);
2326
const { data: currentEpoch } = useCurrentEpoch({
2427
refetchInterval: isPollingForCurrentEpoch ? 5000 : false,
@@ -39,6 +42,9 @@ const EarnView = (): ReactElement => {
3942
const preLaunchEndTimestamp = Date.UTC(2023, 7, 8, 16, 0, 0, 0); // 08.08.2023 18:00 CEST
4043
const duration = preLaunchEndTimestamp - preLaunchStartTimestamp;
4144

45+
const isProjectAdminAllowedToLockUnlock =
46+
address && PROJECT_ADMINS_ALLOWED_TO_LOCK_UNLOCK_GLMS.includes(address);
47+
4248
return (
4349
<Layout dataTest="EarnView">
4450
<EarnTipTiles />
@@ -54,7 +60,9 @@ const EarnView = (): ReactElement => {
5460
/>
5561
</BoxRounded>
5662
)}
57-
{!isProjectAdminMode && <EarnBoxGlmLock classNameBox={styles.box} />}
63+
{(!isProjectAdminMode || isProjectAdminAllowedToLockUnlock) && (
64+
<EarnBoxGlmLock classNameBox={styles.box} />
65+
)}
5866
<EarnBoxPersonalAllocation className={styles.box} />
5967
</div>
6068
<EarnHistory className={styles.column} />

0 commit comments

Comments
 (0)