@@ -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
@@ -21,7 +19,6 @@ type IntegrationFormData = {
21
19
primary : boolean ;
22
20
environmentId : string ;
23
21
removeNovuBranding ?: boolean ;
24
- enableSnooze ?: boolean ;
25
22
} ;
26
23
27
24
type GeneralSettingsProps = {
@@ -32,56 +29,6 @@ type GeneralSettingsProps = {
32
29
isForInAppStep ?: boolean ;
33
30
} ;
34
31
35
- /**
36
- * This switch doesn't actually set any value, it serves as an indicator
37
- * informing if the feature is enabled or not.
38
- */
39
- function EnableSnoozeSwitch ( { id } : { id : string } ) {
40
- const { subscription, isLoading } = useFetchSubscription ( ) ;
41
- const navigate = useNavigate ( ) ;
42
- const isFreePlan = subscription ?. apiServiceLevel === ApiServiceLevelEnum . FREE ;
43
- const disabled = isFreePlan || isLoading ;
44
- const checked = disabled ? false : true ; // Always checked for paid plans
45
-
46
- return (
47
- < div className = "flex items-center" >
48
- { isFreePlan ? (
49
- < Popover modal >
50
- < PopoverTrigger asChild >
51
- < Switch id = { id } checked = { checked } />
52
- </ PopoverTrigger >
53
- < PopoverContent className = "w-72" align = "end" sideOffset = { 4 } >
54
- < div className = "flex flex-col gap-2 p-1" >
55
- < div className = "flex flex-col gap-1" >
56
- < h4 className = "text-xs font-semibold" > Premium Feature</ h4 >
57
- < p className = "text-muted-foreground text-xs" >
58
- Enable "Remind me later" functionality by upgrading to our paid plans.
59
- </ p >
60
- </ div >
61
- < div className = "flex justify-end" >
62
- < LinkButton
63
- size = "sm"
64
- variant = "primary"
65
- onClick = { ( ) => navigate ( ROUTES . SETTINGS_BILLING + '?utm_source=enable_snooze_prompt' ) }
66
- >
67
- Upgrade Plan
68
- </ LinkButton >
69
- </ div >
70
- </ div >
71
- </ PopoverContent >
72
- </ Popover >
73
- ) : (
74
- < Tooltip >
75
- < TooltipTrigger asChild >
76
- < Switch id = { id } checked = { true } disabled = { true } />
77
- </ TooltipTrigger >
78
- < TooltipContent > This feature is automatically enabled with your plan and stays active.</ TooltipContent >
79
- </ Tooltip >
80
- ) }
81
- </ div >
82
- ) ;
83
- }
84
-
85
32
function NovuBrandingSwitch ( {
86
33
id,
87
34
value,
@@ -139,8 +86,6 @@ export function GeneralSettings({
139
86
disabledPrimary,
140
87
isForInAppStep,
141
88
} : GeneralSettingsProps ) {
142
- const isSnoozeEnabled = useFeatureFlag ( FeatureFlagsKeysEnum . IS_SNOOZE_ENABLED ) ;
143
-
144
89
return (
145
90
< 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" >
146
91
< FormField
@@ -183,28 +128,6 @@ export function GeneralSettings({
183
128
) ;
184
129
} }
185
130
/>
186
- { isSnoozeEnabled && (
187
- < FormField
188
- control = { control }
189
- name = "enableSnooze"
190
- render = { ( ) => {
191
- return (
192
- < FormItem className = "flex items-center justify-between gap-2" >
193
- < FormLabel
194
- className = "text-xs"
195
- htmlFor = "enableSnooze"
196
- tooltip = "Enables users to postpone notifications and get reminded at a later time"
197
- >
198
- Enable "Remind me later" functionality
199
- </ FormLabel >
200
- < FormControl >
201
- < EnableSnoozeSwitch id = "enableSnooze" />
202
- </ FormControl >
203
- </ FormItem >
204
- ) ;
205
- } }
206
- />
207
- ) }
208
131
</ >
209
132
) }
210
133
0 commit comments