Skip to content

Commit dcb86a3

Browse files
committed
Makes the QR Code clickable
1 parent c164053 commit dcb86a3

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

webview-ui/src/components/chat/CloudTaskButton.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { HistoryItem } from "@roo-code/types"
88
import { useExtensionState } from "@/context/ExtensionStateContext"
99
import { useCopyToClipboard } from "@/utils/clipboard"
1010
import { Button, Dialog, DialogContent, DialogHeader, DialogTitle, Input, StandardTooltip } from "@/components/ui"
11+
import { vscode } from "@/utils/vscode"
1112

1213
interface CloudTaskButtonProps {
1314
item?: HistoryItem
@@ -31,8 +32,8 @@ export const CloudTaskButton = ({ item, disabled = false }: CloudTaskButtonProps
3132
qrCodeRef.current,
3233
cloudTaskUrl,
3334
{
34-
width: 150,
35-
margin: 2,
35+
width: 140,
36+
margin: 0,
3637
color: {
3738
dark: "#000000",
3839
light: "#FFFFFF",
@@ -74,11 +75,16 @@ export const CloudTaskButton = ({ item, disabled = false }: CloudTaskButtonProps
7475
</DialogHeader>
7576

7677
<div className="flex flex-col space-y-4 text-center">
77-
<div className="flex justify-center">
78-
<div className="p-[10px] w-[170px] h-[170px] bg-white rounded-lg">
79-
<canvas ref={qrCodeRef} />
78+
{qrCodeRef && (
79+
<div className="flex justify-center">
80+
<div
81+
className="w-[170px] h-[170px] bg-white rounded-lg border-border cursor-pointer hover:opacity-70 transition-opacity"
82+
onClick={() => vscode.postMessage({ type: "openExternal", url: cloudTaskUrl })}
83+
title={t("chat:task.openInCloud")}>
84+
<canvas ref={qrCodeRef} className="m-[15px]" />
85+
</div>
8086
</div>
81-
</div>
87+
)}
8288

8389
<div className="flex items-center space-x-2">
8490
<Input value={cloudTaskUrl} disabled className="flex-1 font-mono text-sm" readOnly />

0 commit comments

Comments
 (0)