Skip to content

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

🐛 Use value from url

Luke Vellae04a162c6695
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/settings/components/settings-tabs.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/settings/components/settings-tabs.tsx
index b63b3e29e..afcb8ba76 100644
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/settings/components/settings-tabs.tsx
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/settings/components/settings-tabs.tsx
@@ -3,15 +3,14 @@
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@rallly/ui/page-tabs";
import Link from "next/link";
import { useSelectedLayoutSegments } from "next/navigation";
-import React from "react";
import { Trans } from "@/components/trans";
import { IfFeatureEnabled } from "@/lib/feature-flags/client";
export function SettingsTabs({ children }: { children: React.ReactNode }) {
const segments = useSelectedLayoutSegments();
- const [tab, setTab] = React.useState(segments[0] || "general");
+ const value = segments[0] || "general";
return (
- <Tabs value={tab} onValueChange={setTab} className="w-full">
+ <Tabs value={value} className="w-full">
<TabsList>
<TabsTrigger value="general" asChild>
<Link href="/settings/general">
@@ -31,7 +30,7 @@ export function SettingsTabs({ children }: { children: React.ReactNode }) {
</TabsTrigger>
</IfFeatureEnabled>
</TabsList>
- <TabsContent tabIndex={-1} value={tab}>
+ <TabsContent tabIndex={-1} value={value}>
{children}
</TabsContent>
</Tabs>