From 0cab55e15cef3e13ce53463d54c2f298bf4e753f Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Tue, 10 Dec 2024 10:08:33 +0800 Subject: [PATCH] chore: updates --- package.json | 2 +- public/locales/en/setting.json | 6 ++++++ public/locales/zh/setting.json | 6 ++++++ src/components/ConfigTip.tsx | 11 +++++++++++ src/routes/setting/BotConfig/index.tsx | 14 +++----------- src/routes/setting/config/Agora.tsx | 2 ++ src/routes/setting/config/Firebase.tsx | 2 ++ src/routes/setting/config/SMTP.tsx | 12 +++++++++++- src/routes/setting/config/Tooltip.tsx | 8 ++++++-- 9 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 src/components/ConfigTip.tsx diff --git a/package.json b/package.json index 517d4455..06aff5c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vocechat-web", - "version": "0.8.3", + "version": "0.8.5", "homepage": "https://voce.chat", "dependencies": { "@metamask/onboarding": "^1.0.1", diff --git a/public/locales/en/setting.json b/public/locales/en/setting.json index 9cb83f57..f42b2344 100644 --- a/public/locales/en/setting.json +++ b/public/locales/en/setting.json @@ -232,6 +232,8 @@ "clear_desc": "This will remove all the messages data stored on both the server and client side." }, "firebase": { + "desc": "Message notification requires Google Firebase as the default method.", + "sub_desc": "We have provided an official configuration. Make sure google FCM is accessible from your server and device.", "disable": "Disable", "use_official": "Use Official Configuration", "custom": "Custom", @@ -242,6 +244,8 @@ "client_email": "Client Email" }, "smtp": { + "desc": "For new message Email notification (advanced feature, upgrade to <0>VoceChat Pro) and new sign-up email verification, we use SMTP. ", + "sub_desc": "Please set up your SMTP below.", "enable": "Enable", "host": "Host", "port": "Port", @@ -252,6 +256,8 @@ "send_test_email": "Send Test Email" }, "agora": { + "desc": "For video and audio calls, we use Agora API. ", + "sub_desc": "Each Agora project will enjoy 10,000 mins free API usages per month. Please create a project by yourself. Follow the instruction below to configure your Agora correctly.", "enable": "Enable", "how_to": "How to setup Agora?" }, diff --git a/public/locales/zh/setting.json b/public/locales/zh/setting.json index 3141a52f..6cc038b4 100644 --- a/public/locales/zh/setting.json +++ b/public/locales/zh/setting.json @@ -232,6 +232,8 @@ "clear_desc": "该频道内消息将在客户端和服务端彻底删除" }, "firebase": { + "desc": "消息通知需要使用 Google Firebase 作为默认方法。", + "sub_desc": "我们提供了官方配置。请确保您的服务器和设备可以访问 Google FCM。", "disable": "禁用", "use_official": "使用官方配置", "custom": "自定义", @@ -242,6 +244,8 @@ "client_email": "客户端邮箱" }, "smtp": { + "desc": "对于新消息电子邮件通知(高级功能,升级到 <0>VoceChat Pro)和新注册电子邮件验证,我们使用 SMTP。", + "sub_desc": "请在下方设置您的 SMTP。", "enable": "开启", "host": "主机", "port": "端口", @@ -252,6 +256,8 @@ "send_test_email": "发送测试邮件" }, "agora": { + "desc": "对于视频和音频通话,我们使用 Agora API。", + "sub_desc": "每个 Agora 项目每月可享受 10,000 分钟的免费 API 使用时间。请自行创建一个项目。按照以下说明正确配置您的 Agora。", "enable": "开启", "how_to": "如何配置 Agora?" }, diff --git a/src/components/ConfigTip.tsx b/src/components/ConfigTip.tsx new file mode 100644 index 00000000..8631d07c --- /dev/null +++ b/src/components/ConfigTip.tsx @@ -0,0 +1,11 @@ +import React, { ReactNode } from "react"; + +type TipProps = { title: ReactNode; desc: ReactNode }; +export const ConfigTip = ({ title, desc }: TipProps) => { + return ( +
+

{title}

+

{desc}

+
+ ); +}; diff --git a/src/routes/setting/BotConfig/index.tsx b/src/routes/setting/BotConfig/index.tsx index ec47dfae..38448da3 100644 --- a/src/routes/setting/BotConfig/index.tsx +++ b/src/routes/setting/BotConfig/index.tsx @@ -14,16 +14,8 @@ import NameEdit from "./NameEdit"; import WebhookEdit from "./WebhookEdit"; import WebhookModal from "./WebhookModal"; import { shallowEqual } from "react-redux"; +import { ConfigTip } from "@/components/ConfigTip"; -type TipProps = { title: string; desc: string }; -const Tip = ({ title, desc }: TipProps) => { - return ( -
-

{title}

-

{desc}

-
- ); -}; const tdClass = "p-6 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-100 align-top"; type WebhookParams = { webhook?: string; uid: number }; @@ -65,8 +57,8 @@ export default function BotConfig() { <>
- - + +

diff --git a/src/routes/setting/config/Agora.tsx b/src/routes/setting/config/Agora.tsx index 5b2c8c6a..fb42d2ca 100644 --- a/src/routes/setting/config/Agora.tsx +++ b/src/routes/setting/config/Agora.tsx @@ -8,6 +8,7 @@ import Label from "@/components/styled/Label"; import Toggle from "@/components/styled/Toggle"; import useConfig from "@/hooks/useConfig"; import HowToTip from "./HowToTip"; +import { ConfigTip } from "@/components/ConfigTip"; export default function ConfigAgora() { const { t } = useTranslation("setting", { keyPrefix: "agora" }); @@ -42,6 +43,7 @@ export default function ConfigAgora() { const _url = url || "https://api.agora.io"; return (
+