Skip to content

Commit f918fca

Browse files
fix: create components
1 parent 64475b6 commit f918fca

4 files changed

Lines changed: 34 additions & 10 deletions

File tree

src/components/ui/icons/icons.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

3132
export const initializeIcons = () => {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+
};

src/routes/_private/page.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
import { 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

57
const 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+
});

0 commit comments

Comments
 (0)