Skip to content
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
4 changes: 2 additions & 2 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@
"navbar": {
"primary": {
"type": "button",
"label": "GitHub",
"href": "https://github.com/sourcebot-dev/sourcebot"
"label": "Book a Call",
"href": "https://calendly.com/michael-sourcebot/sourcebot-call?utm_source=docs"
}
},
"footer": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
} from "@/components/ui/sidebar"
import { Phone } from "lucide-react"

const BOOK_A_CALL_BASE_URL = "https://calendly.com/michael-sourcebot/sourcebot-call"

interface BookACallSidebarButtonProps {
// When the deployment is the public "ask GitHub" app, attribute bookings
// to `public-app` so they can be told apart from self-hosted instances.
isAskGhEnabled: boolean
}

export function BookACallSidebarButton({ isAskGhEnabled }: BookACallSidebarButtonProps) {
const utmSource = isAskGhEnabled ? "public-app" : "app"
const href = `${BOOK_A_CALL_BASE_URL}?utm_source=${utmSource}`

return (
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton asChild tooltip="Book a Call">
<a href={href} target="_blank" rel="noopener noreferrer">
<Phone className="h-4 w-4" />
<span>Book a Call</span>
</a>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { RepoVisitHistory } from "./repoVisitHistory";
import { getAuthContext, withAuth } from "@/middleware/withAuth";
import { sew } from "@/middleware/sew";
import { hasEntitlement, isValidLicenseActive } from "@/lib/entitlements";
import { env } from "@sourcebot/shared";

const SIDEBAR_CHAT_LIMIT = 30;
export const SIDEBAR_REPO_VISITS_LIMIT = 10;
Expand Down Expand Up @@ -57,6 +58,7 @@ export async function DefaultSidebar() {
session={session}
collapsible="icon"
isValidLicenseActive={licenseActive}
isAskGhEnabled={env.EXPERIMENT_ASK_GH_ENABLED === 'true'}
headerContent={
<Nav
isSettingsNotificationVisible={isSettingsNotificationVisible}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { SidebarBase } from "../sidebarBase";
import { Nav } from "./nav";
import { SettingsSidebarHeader } from "./header";
import { isValidLicenseActive } from "@/lib/entitlements";
import { env } from "@sourcebot/shared";

export async function SettingsSidebar() {
const session = await auth();
Expand All @@ -22,6 +23,7 @@ export async function SettingsSidebar() {
session={session}
collapsible="none"
isValidLicenseActive={licenseActive}
isAskGhEnabled={env.EXPERIMENT_ASK_GH_ENABLED === 'true'}
headerContent={<SettingsSidebarHeader />}
>
<Nav groups={sidebarNavGroups} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { KeyboardShortcutHint } from "@/app/components/keyboardShortcutHint";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { Separator } from "@/components/ui/separator";
import { WhatsNewSidebarButton } from "./whatsNewSidebarButton";
import { BookACallSidebarButton } from "./bookACallSidebarButton";
import { UpgradeButton } from "./upgradeButton";
import { useIsMobile } from "@/hooks/use-mobile";

Expand All @@ -58,9 +59,10 @@ interface SidebarBaseProps {
headerContent: ReactNode;
children: ReactNode;
isValidLicenseActive: boolean;
isAskGhEnabled: boolean;
}

export function SidebarBase({ session, collapsible = "icon", headerContent, children, isValidLicenseActive }: SidebarBaseProps) {
export function SidebarBase({ session, collapsible = "icon", headerContent, children, isValidLicenseActive, isAskGhEnabled }: SidebarBaseProps) {
const [isScrolled, setIsScrolled] = useState(false);
const contentRef = useRef<HTMLDivElement>(null);
const isMobile = useIsMobile();
Expand Down Expand Up @@ -118,6 +120,7 @@ export function SidebarBase({ session, collapsible = "icon", headerContent, chil
<CollapseSidebarButton />
}
<WhatsNewSidebarButton />
<BookACallSidebarButton isAskGhEnabled={isAskGhEnabled} />
{session ? (
<MeControlDropdownMenu session={session} />
) : (
Expand Down
Loading