Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

✨ Add calendar page behind feature flag

Luke Vellae6748fdf0afd
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/calendar/calendar-page.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/calendar/calendar-page.tsx
new file mode 100644
index 000000000..9c071cab3
--- /dev/null
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/calendar/calendar-page.tsx
@@ -0,0 +1,25 @@
+"use client";
+
+import {
+ PageContainer,
+ PageContent,
+ PageHeader,
+ PageHeaderContent,
+ PageTitle,
+} from "@/app/components/page-layout";
+import { Trans } from "@/i18n/client";
+
+export function CalendarPage() {
+ return (
+ <PageContainer>
+ <PageHeader>
+ <PageHeaderContent>
+ <PageTitle>
+ <Trans i18nKey="calendar" defaults="Calendar" />
+ </PageTitle>
+ </PageHeaderContent>
+ </PageHeader>
+ <PageContent />
+ </PageContainer>
+ );
+}
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/calendar/page.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/calendar/page.tsx
new file mode 100644
index 000000000..0ecacaa46
--- /dev/null
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/calendar/page.tsx
@@ -0,0 +1,22 @@
+import type { Metadata } from "next";
+import { notFound } from "next/navigation";
+import { getTranslation } from "@/i18n/server";
+import { isFeatureEnabled } from "@/lib/feature-flags/server";
+import { CalendarPage } from "./calendar-page";
+
+export default async function Page() {
+ if (!isFeatureEnabled("calendars")) {
+ notFound();
+ }
+
+ return <CalendarPage />;
+}
+
+export async function generateMetadata(): Promise<Metadata> {
+ const { t } = await getTranslation();
+ return {
+ title: t("calendar", {
+ defaultValue: "Calendar",
+ }),
+ };
+}
diff --git a/apps/web/src/features/navigation/config.tsx b/apps/web/src/features/navigation/config.tsx
index 494d69b72..57b12c55e 100644
--- a/apps/web/src/features/navigation/config.tsx
+++ b/apps/web/src/features/navigation/config.tsx
@@ -1,10 +1,16 @@
"use client";
import type { LucideIcon } from "lucide-react";
-import { BarChart2Icon, CalendarIcon, HomeIcon } from "lucide-react";
+import {
+ BarChart2Icon,
+ CalendarDaysIcon,
+ CalendarIcon,
+ HomeIcon,
+} from "lucide-react";
import { usePathname } from "next/navigation";
import React from "react";
import { useTranslation } from "@/i18n/client";
+import { useFeatureFlag } from "@/lib/feature-flags/client";
export interface NavigationItem {
id: string;
@@ -30,6 +36,7 @@ export interface NavigationConfig {
export const useSpaceMenu = () => {
const { t } = useTranslation();
const pathname = usePathname();
+ const isCalendarsEnabled = useFeatureFlag("calendars");
const config = React.useMemo<NavigationConfig>(
() => ({
sections: [
@@ -63,11 +70,22 @@ export const useSpaceMenu = () => {
icon: CalendarIcon,
isActive: pathname === "/events",
},
+ ...(isCalendarsEnabled
+ ? [
+ {
+ id: "calendar",
+ label: t("calendar", { defaultValue: "Calendar" }),
+ href: "/calendar",
+ icon: CalendarDaysIcon,
+ isActive: pathname === "/calendar",
+ },
+ ]
+ : []),
],
},
],
}),
- [pathname, t],
+ [pathname, t, isCalendarsEnabled],
);
return React.useMemo(