Skip to content

Add discord button to nav bar and version in settings drop down #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/web/src/app/navigationMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import { Button } from "@/components/ui/button";
import { NavigationMenu as NavigationMenuBase, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, navigationMenuTriggerStyle } from "@/components/ui/navigation-menu";
import Link from "next/link";
import { GitHubLogoIcon } from "@radix-ui/react-icons";
import { GitHubLogoIcon, DiscordLogoIcon } from "@radix-ui/react-icons";
import { SettingsDropdown } from "./settingsDropdown";
import { Separator } from "@/components/ui/separator";
import Image from "next/image";
import logoDark from "../../public/sb_logo_dark_small.png";
import logoLight from "../../public/sb_logo_light_small.png";
import { useRouter } from "next/navigation";

const SOURCEBOT_DISCORD_URL = "https://discord.gg/6Fhp27x7Pb";
const SOURCEBOT_GITHUB_URL = "https://github.com/sourcebot-dev/sourcebot";

export const NavigationMenu = () => {
Expand Down Expand Up @@ -61,6 +62,15 @@ export const NavigationMenu = () => {
</div>

<div className="flex flex-row items-center gap-2">
<Button
variant="outline"
size="icon"
onClick={() => {
window.open(SOURCEBOT_DISCORD_URL, "_blank");
}}
>
<DiscordLogoIcon className="w-4 h-4" />
</Button>
<Button
variant="outline"
size="icon"
Expand Down
5 changes: 5 additions & 0 deletions packages/web/src/app/settingsDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { useMemo } from "react"
import { KeymapType } from "@/lib/types"
import { cn } from "@/lib/utils"
import { useKeymapType } from "@/hooks/useKeymapType"
import { NEXT_PUBLIC_SOURCEBOT_VERSION } from "@/lib/environment.client";

interface SettingsDropdownProps {
menuButtonClassName?: string;
Expand Down Expand Up @@ -104,6 +105,10 @@ export const SettingsDropdown = ({
</DropdownMenuSubContent>
</DropdownMenuPortal>
</DropdownMenuSub>
<DropdownMenuSeparator />
<div className="px-2 py-1 text-sm text-muted-foreground">
version: {NEXT_PUBLIC_SOURCEBOT_VERSION}
</div>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
Expand Down