From 02ad43bd776ae9f604cf1a3602c08d8c7ef04329 Mon Sep 17 00:00:00 2001 From: "julia.kirschenheuter" Date: Tue, 25 Mar 2025 15:07:25 +0100 Subject: [PATCH] fix(files): Add RegEx to check if user uses mobile device and add Emoji Picker button inside a toolbar only in this case Signed-off-by: julia.kirschenheuter --- src/components/Menu/entries.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/Menu/entries.js b/src/components/Menu/entries.js index f44cbf3a229..4b90f1abd43 100644 --- a/src/components/Menu/entries.js +++ b/src/components/Menu/entries.js @@ -70,6 +70,8 @@ export const ReadOnlyDoneEntries = [{ click: ({ $readOnlyActions }) => $readOnlyActions.toggle(), }] +const isMobileDevice = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent) + export const MenuEntries = [ { key: 'undo', @@ -412,7 +414,11 @@ export const MenuEntries = [ component: ActionAttachmentUpload, priority: 5, }, - { + +] + +if (!isMobileDevice) { + MenuEntries.push({ key: 'emoji-picker', label: t('text', 'Insert emoji'), icon: Emoticon, @@ -421,5 +427,5 @@ export const MenuEntries = [ return command.emoji(emojiObject) }, priority: 6, - }, -] + }) +}