Skip to content

Commit 9e745b8

Browse files
committed
fix: desc optimize
1 parent 94f4898 commit 9e745b8

File tree

5 files changed

+77
-48
lines changed

5 files changed

+77
-48
lines changed

public/static/onekey.png

4.77 KB
Loading

src/components/Firmware/V3UploadLocalFirmware.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ const V3UploadLocalFirmware: React.FC = () => {
131131
{intl.formatMessage({ id: 'TR_LOCAL_FIRMWARE_UPLOAD' }) ||
132132
'本地固件上传'}
133133
</h3>
134+
<p className="text-sm text-gray-500">
135+
{intl.formatMessage({ id: 'TR_LOCAL_FIRMWARE_DESCRIPTION' })}
136+
</p>
134137

135138
<div className="mt-5 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-2">
136139
{getAllV3ComponentTypes().map((componentType) => {

src/components/SearchDevice/index.tsx

Lines changed: 64 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -27,66 +27,82 @@ const SearchDevice: FC<SearchDeviceProps> = ({
2727
<img src={ConnectImage} className="self-center h-60" alt="" />
2828

2929
{onConnectDevice ? (
30-
<div className="relative mb-6">
31-
{/* Pulsing background effect - only show when not connecting */}
32-
{!isConnecting && (
33-
<div className="absolute -inset-1 bg-gradient-to-r from-brand-500 to-brand-600 rounded-lg blur opacity-30 animate-pulse" />
34-
)}
35-
{/* Button */}
36-
<Button
37-
type="primary"
38-
size="xl"
39-
onClick={onConnectDevice}
40-
loading={isConnecting}
41-
disabled={isConnecting}
42-
className="relative shadow-lg hover:shadow-xl transition-all duration-300 transform hover:scale-105 disabled:scale-100 disabled:opacity-60"
43-
>
44-
<span className="flex items-center gap-2 text-lg font-semibold">
45-
{!isConnecting && (
46-
<svg
47-
className="w-6 h-6"
48-
viewBox="0 0 24 24"
49-
fill="none"
50-
stroke="currentColor"
51-
strokeWidth={1.5}
52-
aria-hidden="true"
53-
>
54-
<path
55-
strokeLinecap="round"
56-
strokeLinejoin="round"
57-
d="M9.5 3v3M14.5 3v3"
58-
/>
59-
<path
60-
strokeLinecap="round"
61-
strokeLinejoin="round"
62-
d="M7 6.5h10v4.25a4.75 4.75 0 01-4.75 4.75h-.5A4.75 4.75 0 017 10.75V6.5z"
63-
/>
64-
<path
65-
strokeLinecap="round"
66-
strokeLinejoin="round"
67-
d="M12 15.5v4.5m-2.5 0h5"
68-
/>
69-
</svg>
70-
)}
71-
{isConnecting
72-
? intl.formatMessage({ id: 'TR_CONNECTING' })
73-
: intl.formatMessage({ id: 'TR_CONNECT_DEVICE' })}
74-
</span>
75-
</Button>
76-
</div>
30+
<>
31+
<p className="text-base font-medium text-gray-700 mb-6 text-center max-w-md">
32+
{intl.formatMessage({ id: 'TR_WEBUSB_REQUIRES_USER_ACTION' })}
33+
</p>
34+
<div className="relative mb-6">
35+
{/* Pulsing background effect - only show when not connecting */}
36+
{!isConnecting && (
37+
<div className="absolute -inset-1 bg-gradient-to-r from-brand-500 to-brand-600 rounded-lg blur opacity-30 animate-pulse" />
38+
)}
39+
{/* Button */}
40+
<Button
41+
type="primary"
42+
size="xl"
43+
onClick={onConnectDevice}
44+
loading={isConnecting}
45+
disabled={isConnecting}
46+
className="relative shadow-lg hover:shadow-xl transition-all duration-300 transform hover:scale-105 disabled:scale-100 disabled:opacity-60"
47+
>
48+
<span className="flex items-center gap-2 text-lg font-semibold">
49+
{!isConnecting && (
50+
<svg
51+
className="w-6 h-6"
52+
viewBox="0 0 24 24"
53+
fill="none"
54+
stroke="currentColor"
55+
strokeWidth={1.5}
56+
aria-hidden="true"
57+
>
58+
<path
59+
strokeLinecap="round"
60+
strokeLinejoin="round"
61+
d="M9.5 3v3M14.5 3v3"
62+
/>
63+
<path
64+
strokeLinecap="round"
65+
strokeLinejoin="round"
66+
d="M7 6.5h10v4.25a4.75 4.75 0 01-4.75 4.75h-.5A4.75 4.75 0 017 10.75V6.5z"
67+
/>
68+
<path
69+
strokeLinecap="round"
70+
strokeLinejoin="round"
71+
d="M12 15.5v4.5m-2.5 0h5"
72+
/>
73+
</svg>
74+
)}
75+
{isConnecting
76+
? intl.formatMessage({ id: 'TR_CONNECTING' })
77+
: intl.formatMessage({ id: 'TR_CONNECT_DEVICE' })}
78+
</span>
79+
</Button>
80+
</div>
81+
<p className="text-sm font-normal text-gray-500 mt-2 max-w-md text-center">
82+
{intl.formatMessage({ id: 'TR_WEBUSB_WILL_PROMPT_PERMISSION' })}
83+
</p>
84+
</>
7785
) : (
7886
<>
7987
<p className="text-sm font-normal text-gray-500">
8088
{intl.formatMessage({ id: 'TR_MAKE_SURE_IT_IS_WELL_CONNECTED' })}
8189
{intl.formatMessage({ id: 'TR_SEARCHING_FOR_YOUR_DEVICE' })}
8290
</p>
83-
91+
<p className="text-xs font-normal text-gray-500 py-3">
92+
{intl.formatMessage({ id: 'TR_USING_WEBUSB_MODE' })}
93+
</p>
8494
{pageStatus === 'search-timeout' ? (
8595
<>
8696
<p className="text-sm font-normal text-gray-500">
8797
{intl.formatMessage({ id: 'TR_SEARCHING_TAKES_TOO_LONG' })}
8898
</p>
8999
<div className="flex flex-col items-start justify-start">
100+
<p className="text-sm font-normal text-gray-500 pt-4 pb-1">
101+
{intl.formatMessage({ id: 'TR_CHECK_BRIDGE' })}
102+
</p>
103+
<p className="text-sm font-normal text-gray-500 pt-4 pb-1">
104+
{intl.formatMessage({ id: 'TR_ALLOW_WEBUSB_PERMISSION' })}
105+
</p>
90106
<p className="text-sm font-normal text-gray-500 py-1">
91107
{intl.formatMessage({ id: 'TR_REFRESH_INSTRUCTION' })}
92108
</p>

src/locales/en-US.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,15 @@
254254
"TR_REMOTE_FIRMWARE": "Firmware Update",
255255
"TR_LOCAL_FIRMWARE": "Local Firmware",
256256
"TR_LOCAL_FIRMWARE_UPLOAD": "Local Firmware Upload",
257+
"TR_LOCAL_FIRMWARE_DESCRIPTION": "Select local firmware files for update. Ensure files are from a trusted source.",
257258
"TR_NO_COMPONENTS_SELECTED": "Please select firmware",
258259
"TR_CONNECT_DEVICE": "Connect Device",
259260
"TR_CONNECTING": "Connecting...",
260261
"TR_RECONNECT_DEVICE": "Reconnect Device",
262+
"TR_WEBUSB_REQUIRES_USER_ACTION": "Click the button below to connect your OneKey device.",
263+
"TR_WEBUSB_WILL_PROMPT_PERMISSION": "Your browser will ask for permission to access USB devices. Please allow it to continue.",
264+
"TR_USING_WEBUSB_MODE": "Using WebUSB direct connection mode",
265+
"TR_ALLOW_WEBUSB_PERMISSION": "Allow WebUSB permission when browser prompts",
261266
"TR_BOOTLOADER_PERMISSION_REQUIRED": "Authorize bootloader device",
262267
"TR_BOOTLOADER_PERMISSION_REQUIRED_DESC": "Bootloader mode detected. Authorize the new USB device to continue.",
263268
"TR_REAUTHORIZE_DEVICE": "Authorize device"

src/locales/zh-CN.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,14 @@
255255
"TR_REMOTE_FIRMWARE": "固件更新",
256256
"TR_LOCAL_FIRMWARE": "本地固件",
257257
"TR_LOCAL_FIRMWARE_UPLOAD": "本地固件上传",
258+
"TR_LOCAL_FIRMWARE_DESCRIPTION": "选择本地固件文件进行更新。上传前请确保文件来源可靠。",
258259
"TR_CONNECT_DEVICE": "连接设备",
259260
"TR_CONNECTING": "连接中...",
260261
"TR_RECONNECT_DEVICE": "重新连接设备",
262+
"TR_WEBUSB_REQUIRES_USER_ACTION": "点击下方按钮连接您的 OneKey 设备。",
263+
"TR_WEBUSB_WILL_PROMPT_PERMISSION": "浏览器将请求访问 USB 设备的权限,请允许以继续操作。",
264+
"TR_USING_WEBUSB_MODE": "使用 WebUSB 直连模式",
265+
"TR_ALLOW_WEBUSB_PERMISSION": "浏览器弹出提示时,请允许 WebUSB 权限",
261266
"TR_BOOTLOADER_PERMISSION_REQUIRED": "需要重新授权 Bootloader 设备",
262267
"TR_BOOTLOADER_PERMISSION_REQUIRED_DESC": "设备已进入 Bootloader,需授权新的 USB 设备以继续。",
263268
"TR_REAUTHORIZE_DEVICE": "授权设备"

0 commit comments

Comments
 (0)