File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const AVAILABLE_ICONIFY_ICONS = {
2626 Eye : "eye" ,
2727 EyeOff : "eye-off" ,
2828 Lock : "lock" ,
29+ Ban : "ban" ,
2930} ;
3031
3132export const initializeIcons = ( ) => {
Original file line number Diff line number Diff line change 1+ /* eslint-disable i18next/no-literal-string */
2+ import { Icons } from "@/components/ui" ;
3+
4+ export const FeatureNotAvailable = ( ) => {
5+ return (
6+ < div className = "flex min-h-screen w-full flex-col items-center justify-center text-center" >
7+ < Icons . Ban className = "text-muted-foreground h-14 w-14" />
8+
9+ < h2 className = "mb-2 text-xl font-semibold" > Feature not available</ h2 >
10+ </ div >
11+ ) ;
12+ } ;
Original file line number Diff line number Diff line change 1+ /* eslint-disable i18next/no-literal-string */
2+ export const WelcomeMessage = ( ) => {
3+ return (
4+ < div className = "flex min-h-screen w-full flex-col items-center justify-center text-center" >
5+ < h2 className = "mb-2 text-2xl font-semibold" > Welcome to the app, beta tester!</ h2 >
6+ </ div >
7+ ) ;
8+ } ;
Original file line number Diff line number Diff line change 11import { createFileRoute } from "@tanstack/react-router" ;
2- import { useFeatureFlagEnabled } from "posthog-js/react" ;
3- import { usePostHog } from "posthog-js/react" ;
2+ import { useFeatureFlagEnabled , usePostHog } from "posthog-js/react" ;
3+
4+ import { FeatureNotAvailable } from "./-components/feature-not-available" ;
5+ import { WelcomeMessage } from "./-components/welcome-message" ;
46
57const HomePage = ( ) => {
68 const posthog = usePostHog ( ) ;
79 const showWelcomeMessage = useFeatureFlagEnabled ( "feature-a" ) ;
10+
811 posthog ?. identify ( "daniela@test.com" , {
912 is_beta_tester : false ,
1013 } ) ;
1114
12- return (
13- < div className = "flex flex-col gap-4" >
14- < h3 className = "text-lg font-medium" >
15- { showWelcomeMessage ? "Welcome to the app!" : "Feature not available" }
16- </ h3 >
17- </ div >
18- ) ;
15+ if ( ! showWelcomeMessage ) {
16+ return < FeatureNotAvailable /> ;
17+ }
18+
19+ return < WelcomeMessage /> ;
1920} ;
2021
21- export const Route = createFileRoute ( "/_private/" ) ( { component : HomePage } ) ;
22+ export const Route = createFileRoute ( "/_private/" ) ( {
23+ component : HomePage ,
24+ } ) ;
You can’t perform that action at this time.
0 commit comments