@@ -4,11 +4,9 @@ import { Input } from '@/components/primitives/input';
4
4
import { Popover , PopoverContent , PopoverTrigger } from '@/components/primitives/popover' ;
5
5
import { Separator } from '@/components/primitives/separator' ;
6
6
import { Switch } from '@/components/primitives/switch' ;
7
- import { Tooltip , TooltipContent , TooltipTrigger } from '@/components/primitives/tooltip' ;
8
- import { useFeatureFlag } from '@/hooks/use-feature-flag' ;
9
7
import { useFetchSubscription } from '@/hooks/use-fetch-subscription' ;
10
8
import { ROUTES } from '@/utils/routes' ;
11
- import { ApiServiceLevelEnum , FeatureFlagsKeysEnum } from '@novu/shared' ;
9
+ import { ApiServiceLevelEnum } from '@novu/shared' ;
12
10
import { Control } from 'react-hook-form' ;
13
11
import { useNavigate } from 'react-router-dom' ;
14
12
import { IS_SELF_HOSTED , SELF_HOSTED_UPGRADE_REDIRECT_URL } from '../../../config' ;
@@ -23,7 +21,6 @@ type IntegrationFormData = {
23
21
primary : boolean ;
24
22
environmentId : string ;
25
23
removeNovuBranding ?: boolean ;
26
- enableSnooze ?: boolean ;
27
24
} ;
28
25
29
26
type GeneralSettingsProps = {
@@ -34,62 +31,6 @@ type GeneralSettingsProps = {
34
31
isForInAppStep ?: boolean ;
35
32
} ;
36
33
37
- /**
38
- * This switch doesn't actually set any value, it serves as an indicator
39
- * informing if the feature is enabled or not.
40
- */
41
- function EnableSnoozeSwitch ( { id } : { id : string } ) {
42
- const { subscription, isLoading } = useFetchSubscription ( ) ;
43
- const navigate = useNavigate ( ) ;
44
- const isFreePlan = subscription ?. apiServiceLevel === ApiServiceLevelEnum . FREE ;
45
- const disabled = isFreePlan || IS_SELF_HOSTED || isLoading ;
46
- const checked = disabled ? false : true ; // Always checked for paid plans
47
-
48
- const popoverContent = IS_SELF_HOSTED
49
- ? 'Enable "Remind me later" functionality by upgrading to Cloud plans'
50
- : 'Enable "Remind me later" functionality by upgrading to our paid plans' ;
51
-
52
- const handleLinkClick = ( ) => {
53
- if ( IS_SELF_HOSTED ) {
54
- openInNewTab ( SELF_HOSTED_UPGRADE_REDIRECT_URL + '?utm_campaign=enable_snooze_prompt' ) ;
55
- } else {
56
- navigate ( ROUTES . SETTINGS_BILLING + '?utm_source=enable_snooze_prompt' ) ;
57
- }
58
- } ;
59
-
60
- return (
61
- < div className = "flex items-center" >
62
- { isFreePlan || IS_SELF_HOSTED ? (
63
- < Popover modal >
64
- < PopoverTrigger asChild >
65
- < Switch id = { id } checked = { checked } />
66
- </ PopoverTrigger >
67
- < PopoverContent className = "w-72" align = "end" sideOffset = { 4 } >
68
- < div className = "flex flex-col gap-2 p-1" >
69
- < div className = "flex flex-col gap-1" >
70
- < h4 className = "text-xs font-semibold" > Premium Feature</ h4 >
71
- < p className = "text-muted-foreground text-xs" > { popoverContent } </ p >
72
- </ div >
73
- < div className = "flex justify-end" >
74
- < LinkButton size = "sm" variant = "primary" onClick = { handleLinkClick } >
75
- Upgrade Plan
76
- </ LinkButton >
77
- </ div >
78
- </ div >
79
- </ PopoverContent >
80
- </ Popover >
81
- ) : (
82
- < Tooltip >
83
- < TooltipTrigger asChild >
84
- < Switch id = { id } checked = { true } disabled = { true } />
85
- </ TooltipTrigger >
86
- < TooltipContent > This feature is automatically enabled with your plan and stays active.</ TooltipContent >
87
- </ Tooltip >
88
- ) }
89
- </ div >
90
- ) ;
91
- }
92
-
93
34
function NovuBrandingSwitch ( {
94
35
id,
95
36
value,
@@ -153,8 +94,6 @@ export function GeneralSettings({
153
94
disabledPrimary,
154
95
isForInAppStep,
155
96
} : GeneralSettingsProps ) {
156
- const isSnoozeEnabled = useFeatureFlag ( FeatureFlagsKeysEnum . IS_SNOOZE_ENABLED ) ;
157
-
158
97
return (
159
98
< div className = "border-neutral-alpha-200 bg-background text-foreground-600 mx-0 mt-0 flex flex-col gap-2 rounded-lg border p-3" >
160
99
< FormField
@@ -197,28 +136,6 @@ export function GeneralSettings({
197
136
) ;
198
137
} }
199
138
/>
200
- { isSnoozeEnabled && (
201
- < FormField
202
- control = { control }
203
- name = "enableSnooze"
204
- render = { ( ) => {
205
- return (
206
- < FormItem className = "flex items-center justify-between gap-2" >
207
- < FormLabel
208
- className = "text-xs"
209
- htmlFor = "enableSnooze"
210
- tooltip = "Enables users to postpone notifications and get reminded at a later time"
211
- >
212
- Enable "Remind me later" functionality
213
- </ FormLabel >
214
- < FormControl >
215
- < EnableSnoozeSwitch id = "enableSnooze" />
216
- </ FormControl >
217
- </ FormItem >
218
- ) ;
219
- } }
220
- />
221
- ) }
222
139
</ >
223
140
) }
224
141
0 commit comments