|
|
@@ -7,10 +7,11 @@ import { vscode } from "@src/utils/vscode"
|
|
|
|
|
|
type AccountViewProps = {
|
|
|
userInfo: CloudUserInfo | null
|
|
|
+ isAuthenticated: boolean
|
|
|
onDone: () => void
|
|
|
}
|
|
|
|
|
|
-export const AccountView = ({ userInfo, onDone }: AccountViewProps) => {
|
|
|
+export const AccountView = ({ userInfo, isAuthenticated, onDone }: AccountViewProps) => {
|
|
|
const { t } = useAppTranslation()
|
|
|
|
|
|
const rooLogoUri = (window as any).IMAGES_BASE_URI + "/roo-logo.svg"
|
|
|
@@ -23,27 +24,29 @@ export const AccountView = ({ userInfo, onDone }: AccountViewProps) => {
|
|
|
{t("settings:common.done")}
|
|
|
</VSCodeButton>
|
|
|
</div>
|
|
|
- {userInfo ? (
|
|
|
+ {isAuthenticated ? (
|
|
|
<>
|
|
|
- <div className="flex flex-col items-center mb-6">
|
|
|
- <div className="w-16 h-16 mb-3 rounded-full overflow-hidden">
|
|
|
- {userInfo?.picture ? (
|
|
|
- <img
|
|
|
- src={userInfo.picture}
|
|
|
- alt={t("account:profilePicture")}
|
|
|
- className="w-full h-full object-cover"
|
|
|
- />
|
|
|
- ) : (
|
|
|
- <div className="w-full h-full flex items-center justify-center bg-vscode-button-background text-vscode-button-foreground text-xl">
|
|
|
- {userInfo?.name?.charAt(0) || userInfo?.email?.charAt(0) || "?"}
|
|
|
- </div>
|
|
|
- )}
|
|
|
+ {userInfo && (
|
|
|
+ <div className="flex flex-col items-center mb-6">
|
|
|
+ <div className="w-16 h-16 mb-3 rounded-full overflow-hidden">
|
|
|
+ {userInfo?.picture ? (
|
|
|
+ <img
|
|
|
+ src={userInfo.picture}
|
|
|
+ alt={t("account:profilePicture")}
|
|
|
+ className="w-full h-full object-cover"
|
|
|
+ />
|
|
|
+ ) : (
|
|
|
+ <div className="w-full h-full flex items-center justify-center bg-vscode-button-background text-vscode-button-foreground text-xl">
|
|
|
+ {userInfo?.name?.charAt(0) || userInfo?.email?.charAt(0) || "?"}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ <h2 className="text-lg font-medium text-vscode-foreground mb-1">
|
|
|
+ {userInfo?.name || t("account:unknownUser")}
|
|
|
+ </h2>
|
|
|
+ <p className="text-sm text-vscode-descriptionForeground">{userInfo?.email || ""}</p>
|
|
|
</div>
|
|
|
- <h2 className="text-lg font-medium text-vscode-foreground mb-1">
|
|
|
- {userInfo?.name || t("account:unknownUser")}
|
|
|
- </h2>
|
|
|
- <p className="text-sm text-vscode-descriptionForeground">{userInfo?.email || ""}</p>
|
|
|
- </div>
|
|
|
+ )}
|
|
|
<div className="flex flex-col gap-2 mt-4">
|
|
|
<VSCodeButton
|
|
|
appearance="secondary"
|