Skip to content

Commit bb78e75

Browse files
authored
feat: add notifications center feature flag (#1995)
1 parent 0903080 commit bb78e75

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import React, { useState } from 'react';
22
import { NotificationsBell } from './NotificationsBell';
3-
3+
import { usePostHogClientContext } from '@providers/PostHogClientProvider';
4+
import { ExperimentName } from '@lib/scripts/types/feature-flags';
45
export interface NotificationsCenterContainerProps {
56
popupView?: boolean;
67
}
78

89
// eslint-disable-next-line @typescript-eslint/no-unused-vars
910
export const NotificationsBellContainer = ({ popupView }: NotificationsCenterContainerProps): React.ReactElement => {
11+
const posthog = usePostHogClientContext();
12+
1013
// TODO Connect with notifications center
1114
const [notificationsCount, setNotificationsCount] = useState(0);
1215

@@ -16,5 +19,9 @@ export const NotificationsBellContainer = ({ popupView }: NotificationsCenterCon
1619
setNotificationsCount(notificationsCount === 11 ? 0 : notificationsCount + 1);
1720
};
1821

19-
return <NotificationsBell notificationsCount={notificationsCount} onClick={handleClick} popupView={popupView} />;
22+
return (
23+
posthog?.isFeatureFlagEnabled(ExperimentName.NOTIFICATIONS_CENTER) && (
24+
<NotificationsBell notificationsCount={notificationsCount} onClick={handleClick} popupView={popupView} />
25+
)
26+
);
2027
};

apps/browser-extension-wallet/src/components/NotificationsCenter/NotificationsCenter.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
position: absolute;
66
top: size_unit(-2);
77
right: size_unit(-2);
8-
background: purple;
8+
background: #7f5af0;
99
color: white;
1010
border-radius: 50%;
1111
padding: 2px 2px;

apps/browser-extension-wallet/src/lib/scripts/types/feature-flags.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export enum ExperimentName {
1515
BITCOIN_WALLETS = 'bitcoin-wallets',
1616
NFTPRINTLAB = 'nftprintlab',
1717
GLACIER_DROP = 'glacier-drop',
18-
MEMPOOLSPACE_FEE_MARKET = 'bitcoin-mempool-space-fee-market'
18+
MEMPOOLSPACE_FEE_MARKET = 'bitcoin-mempool-space-fee-market',
19+
NOTIFICATIONS_CENTER = 'notifications-center'
1920
}
2021

2122
export type FeatureFlag = `${ExperimentName}`;

apps/browser-extension-wallet/src/providers/PostHogClientProvider/client/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const defaultFeatureFlags: FeatureFlags = {
3939
[ExperimentName.BITCOIN_WALLETS]: false,
4040
[ExperimentName.NFTPRINTLAB]: false,
4141
[ExperimentName.GLACIER_DROP]: false,
42-
[ExperimentName.MEMPOOLSPACE_FEE_MARKET]: false
42+
[ExperimentName.MEMPOOLSPACE_FEE_MARKET]: false,
43+
[ExperimentName.NOTIFICATIONS_CENTER]: false
4344
};
4445

4546
export const featureFlagsByNetworkInitialValue: FeatureFlagsByNetwork = {

0 commit comments

Comments
 (0)