diff --git a/vscode/webviews/CodyPanel.tsx b/vscode/webviews/CodyPanel.tsx index 0e304c025811..4775178bf21c 100644 --- a/vscode/webviews/CodyPanel.tsx +++ b/vscode/webviews/CodyPanel.tsx @@ -120,6 +120,7 @@ export const CodyPanel: FunctionComponent = ({ currentView={view} setView={setView} endpointHistory={config.endpointHistory ?? []} + isTeamsUpgradeCtaEnabled={isTeamsUpgradeCtaEnabled} /> )} {errorMessages && } diff --git a/vscode/webviews/components/UserMenu.tsx b/vscode/webviews/components/UserMenu.tsx index 6a541a3199c5..26d5e5644806 100644 --- a/vscode/webviews/components/UserMenu.tsx +++ b/vscode/webviews/components/UserMenu.tsx @@ -15,6 +15,7 @@ import { import { useCallback, useState } from 'react' import { URI } from 'vscode-uri' import { ACCOUNT_USAGE_URL, isSourcegraphToken } from '../../src/chat/protocol' +import { SourcegraphLogo } from '../icons/SourcegraphLogo' import { getVSCodeAPI } from '../utils/VSCodeApi' import { useTelemetryRecorder } from '../utils/telemetry' import { UserAvatar } from './UserAvatar' @@ -34,6 +35,8 @@ interface UserMenuProps { onCloseByEscape?: () => void allowEndpointChange: boolean __storybook__open?: boolean + // Whether to show the Sourcegraph Teams upgrade CTA or not. + isTeamsUpgradeCtaEnabled?: boolean } type MenuView = 'main' | 'switch' | 'add' | 'remove' @@ -46,6 +49,7 @@ export const UserMenu: React.FunctionComponent = ({ onCloseByEscape, allowEndpointChange, __storybook__open, + isTeamsUpgradeCtaEnabled, }) => { const telemetryRecorder = useTelemetryRecorder() const { displayName, username, primaryEmail, endpoint } = authStatus @@ -306,6 +310,47 @@ export const UserMenu: React.FunctionComponent = ({ Add another account + + {isTeamsUpgradeCtaEnabled && ( + + +
+ {/* TODO: Replace with new logo */} + + + Enterprise Starter + +
+
+ Unlock the Sourcegraph platform +
+
+ Create a workspace and connect GitHub repositories to unlock + Code Search, AI chat, autocompletes, inline edits and more + for your team. +
+ +
+
+ )} ) : ( @@ -429,7 +474,7 @@ export const UserMenu: React.FunctionComponent = ({ )} popoverRootProps={{ onOpenChange }} popoverContentProps={{ - className: '!tw-p-2', + className: '!tw-p-2 tw-mr-6', onKeyDown: onKeyDown, onCloseAutoFocus: event => { event.preventDefault() diff --git a/vscode/webviews/tabs/TabsBar.tsx b/vscode/webviews/tabs/TabsBar.tsx index 85263da0827c..7ae32244cbae 100644 --- a/vscode/webviews/tabs/TabsBar.tsx +++ b/vscode/webviews/tabs/TabsBar.tsx @@ -34,6 +34,8 @@ interface TabsBarProps { currentView: View setView: (view: View) => void endpointHistory: string[] + // Whether to show the Sourcegraph Teams upgrade CTA or not. + isTeamsUpgradeCtaEnabled?: boolean } type IconComponent = React.ForwardRefExoticComponent< @@ -157,6 +159,7 @@ export const TabsBar = memo(props => { endpointHistory={endpointHistory} allowEndpointChange={allowEndpointChange} className="!tw-opacity-100 tw-h-full" + isTeamsUpgradeCtaEnabled={props.isTeamsUpgradeCtaEnabled} /> )}