Skip to content

Commit 82f9d8b

Browse files
committed
hide settings in dropdown with auth isnt enabled
1 parent 23644a9 commit 82f9d8b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

packages/web/src/app/[domain]/components/navigationMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export const NavigationMenu = async ({
124124
<GitHubLogoIcon className="w-4 h-4" />
125125
</Button>
126126
</form>
127-
<SettingsDropdown />
127+
<SettingsDropdown isAuthEnabled={env.SOURCEBOT_AUTH_ENABLED === 'true'} />
128128
</div>
129129
</div>
130130
<Separator />

packages/web/src/app/[domain]/components/settingsDropdown.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ import { useDomain } from "@/hooks/useDomain";
3737

3838
interface SettingsDropdownProps {
3939
menuButtonClassName?: string;
40+
isAuthEnabled: boolean;
4041
}
4142

4243
export const SettingsDropdown = ({
4344
menuButtonClassName,
45+
isAuthEnabled,
4446
}: SettingsDropdownProps) => {
4547

4648
const { theme: _theme, setTheme } = useTheme();
@@ -148,12 +150,14 @@ export const SettingsDropdown = ({
148150
</DropdownMenuSubContent>
149151
</DropdownMenuPortal>
150152
</DropdownMenuSub>
151-
<DropdownMenuItem asChild>
152-
<a href={`/${domain}/settings`}>
153-
<Settings className="h-4 w-4 mr-2" />
154-
<span>Settings</span>
155-
</a>
156-
</DropdownMenuItem>
153+
{isAuthEnabled && (
154+
<DropdownMenuItem asChild>
155+
<a href={`/${domain}/settings`}>
156+
<Settings className="h-4 w-4 mr-2" />
157+
<span>Settings</span>
158+
</a>
159+
</DropdownMenuItem>
160+
)}
157161
</DropdownMenuGroup>
158162
<DropdownMenuSeparator />
159163
<div className="px-2 py-1 text-sm text-muted-foreground">

0 commit comments

Comments
 (0)