From 63659fe61673dbfc4bd5279accc36f7e3309754c Mon Sep 17 00:00:00 2001 From: jimengdie Date: Fri, 7 Apr 2023 16:46:51 +0800 Subject: [PATCH] hide mobile submitkey --- app/components/settings.tsx | 38 +++++++++++++++++++------------------ app/locales/cn.ts | 11 ++++++++--- app/locales/en.ts | 11 ++++++++--- app/locales/es.ts | 11 ++++++++--- app/locales/it.ts | 11 ++++++++--- app/locales/tw.ts | 11 ++++++++--- 6 files changed, 60 insertions(+), 33 deletions(-) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index d1d217ead..da83da76a 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -26,7 +26,7 @@ import { import { Avatar } from "./chat"; import Locale, { AllLangs, changeLang, getLang } from "../locales"; -import { getCurrentVersion, getEmojiUrl } from "../utils"; +import { getCurrentVersion, getEmojiUrl, isMobileScreen } from "../utils"; import Link from "next/link"; import { UPDATE_URL } from "../constant"; import { SearchService, usePromptStore } from "../store/prompt"; @@ -231,23 +231,25 @@ export function Settings(props: { closeSettings: () => void }) { )} - - - + {isMobileScreen() ? null : ( + + + + )}
diff --git a/app/locales/cn.ts b/app/locales/cn.ts index e21272a12..938970ca8 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -1,4 +1,5 @@ import { SubmitKey } from "../store/app"; +import { isMobileScreen } from "../utils"; const cn = { WIP: "该功能仍在开发中……", @@ -21,9 +22,13 @@ const cn = { Rename: "重命名对话", Typing: "正在输入…", Input: (submitKey: string) => { - var inputHints = `输入消息,${submitKey} 发送`; - if (submitKey === String(SubmitKey.Enter)) { - inputHints += ",Shift + Enter 换行"; + if (!isMobileScreen()) { + var inputHints = `输入消息,${submitKey} 发送`; + if (submitKey === String(SubmitKey.Enter)) { + inputHints += ",Shift + Enter 换行"; + } + } else { + var inputHints = "输入消息"; } return inputHints; }, diff --git a/app/locales/en.ts b/app/locales/en.ts index 61d20b60f..3fcd88d39 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -1,5 +1,6 @@ import { SubmitKey } from "../store/app"; import type { LocaleType } from "./index"; +import { isMobileScreen } from "../utils"; const en: LocaleType = { WIP: "WIP...", @@ -23,9 +24,13 @@ const en: LocaleType = { Rename: "Rename Chat", Typing: "Typing…", Input: (submitKey: string) => { - var inputHints = `Type something and press ${submitKey} to send`; - if (submitKey === String(SubmitKey.Enter)) { - inputHints += ", press Shift + Enter to newline"; + if (!isMobileScreen()) { + var inputHints = `Type something and press ${submitKey} to send`; + if (submitKey === String(SubmitKey.Enter)) { + inputHints += ", press Shift + Enter to newline"; + } + } else { + var inputHints = "Type something"; } return inputHints; }, diff --git a/app/locales/es.ts b/app/locales/es.ts index 5a83cb55c..578986f2c 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -1,5 +1,6 @@ import { SubmitKey } from "../store/app"; import type { LocaleType } from "./index"; +import { isMobileScreen } from "../utils"; const es: LocaleType = { WIP: "En construcción...", @@ -23,9 +24,13 @@ const es: LocaleType = { Rename: "Renombrar chat", Typing: "Escribiendo...", Input: (submitKey: string) => { - var inputHints = `Escribe algo y presiona ${submitKey} para enviar`; - if (submitKey === String(SubmitKey.Enter)) { - inputHints += ", presiona Shift + Enter para nueva línea"; + if (!isMobileScreen()) { + var inputHints = `Escribe algo y presiona ${submitKey} para enviar`; + if (submitKey === String(SubmitKey.Enter)) { + inputHints += ", presiona Shift + Enter para nueva línea"; + } + } else { + var inputHints = "Escribe algo"; } return inputHints; }, diff --git a/app/locales/it.ts b/app/locales/it.ts index 7108090eb..9e1c722ad 100644 --- a/app/locales/it.ts +++ b/app/locales/it.ts @@ -1,5 +1,6 @@ import { SubmitKey } from "../store/app"; import type { LocaleType } from "./index"; +import { isMobileScreen } from "../utils"; const it: LocaleType = { WIP: "Work in progress...", @@ -23,9 +24,13 @@ const it: LocaleType = { Rename: "Rinomina Chat", Typing: "Typing…", Input: (submitKey: string) => { - var inputHints = `Scrivi qualcosa e premi ${submitKey} per inviare`; - if (submitKey === String(SubmitKey.Enter)) { - inputHints += ", premi Shift + Enter per andare a capo"; + if (!isMobileScreen()) { + var inputHints = `Scrivi qualcosa e premi ${submitKey} per inviare`; + if (submitKey === String(SubmitKey.Enter)) { + inputHints += ", premi Shift + Enter per andare a capo"; + } + } else { + var inputHints = "Scrivi qualcosa"; } return inputHints; }, diff --git a/app/locales/tw.ts b/app/locales/tw.ts index ff1794b55..d3eb707c6 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -1,5 +1,6 @@ import { SubmitKey } from "../store/app"; import type { LocaleType } from "./index"; +import { isMobileScreen } from "../utils"; const tw: LocaleType = { WIP: "該功能仍在開發中……", @@ -22,9 +23,13 @@ const tw: LocaleType = { Rename: "重命名對話", Typing: "正在輸入…", Input: (submitKey: string) => { - var inputHints = `輸入訊息後,按下 ${submitKey} 鍵即可發送`; - if (submitKey === String(SubmitKey.Enter)) { - inputHints += ",Shift + Enter 鍵換行"; + if (!isMobileScreen()) { + var inputHints = `輸入訊息後,按下 ${submitKey} 鍵即可發送`; + if (submitKey === String(SubmitKey.Enter)) { + inputHints += ",Shift + Enter 鍵換行"; + } + } else { + var inputHints = "輸入訊息"; } return inputHints; },