From c6691b5de6bea75b2784352e026e79bc3bdcbdf7 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Mon, 4 Jul 2022 07:10:07 +0300 Subject: [PATCH] Web: Files: MainButton: add submenu for mobile --- .../components/Article/MainButton/index.js | 97 +++++++------------ 1 file changed, 33 insertions(+), 64 deletions(-) diff --git a/products/ASC.Files/Client/src/components/Article/MainButton/index.js b/products/ASC.Files/Client/src/components/Article/MainButton/index.js index 9fe0110fe4..09d9ed5388 100644 --- a/products/ASC.Files/Client/src/components/Article/MainButton/index.js +++ b/products/ASC.Files/Client/src/components/Article/MainButton/index.js @@ -124,71 +124,40 @@ const ArticleMainButtonContent = (props) => { ] : []; - const formActions = - !isMobile && !isTablet - ? [ - { - className: "main-button_drop-down", - icon: "images/form.react.svg", - label: t("Translations:NewForm"), - key: "new-form", - items: [ - { - className: "main-button_drop-down_sub", - icon: "images/form.react.svg", - label: t("Translations:SubNewForm"), - onClick: onCreate, - action: "docxf", - key: "docxf", - }, - { - className: "main-button_drop-down_sub", - icon: "images/form.file.react.svg", - label: t("Translations:SubNewFormFile"), - onClick: onShowSelectFileDialog, - disabled: isPrivacy, - key: "form-file", - }, - { - className: "main-button_drop-down_sub", - icon: "images/form.react.svg", - label: t("Common:OFORMsGallery"), - onClick: onShowGallery, - disabled: isPrivacy, - key: "form-gallery", - }, - ], - }, - ] - : [ - { - className: "main-button_drop-down_sub", - icon: "images/form.react.svg", - label: t("Translations:NewForm"), - onClick: onCreate, - action: "docxf", - key: "docxf", - }, - { - className: "main-button_drop-down_sub", - icon: "images/form.file.react.svg", - label: t("Translations:NewFormFile"), - onClick: onShowSelectFileDialog, - disabled: isPrivacy, - key: "form-file", - }, - ]; - - if (isMobile || isTablet) { - formActions.push({ - className: "main-button_drop-down_sub", + const formActions = [ + { + className: "main-button_drop-down", icon: "images/form.react.svg", - label: t("Common:OFORMsGallery"), - onClick: onShowGallery, - disabled: isPrivacy, - key: "form-gallery", - }); - } + label: t("Translations:NewForm"), + key: "new-form", + items: [ + { + className: "main-button_drop-down_sub", + icon: !isMobile && "images/form.react.svg", + label: t("Translations:SubNewForm"), + onClick: onCreate, + action: "docxf", + key: "docxf", + }, + { + className: "main-button_drop-down_sub", + icon: !isMobile && "images/form.file.react.svg", + label: t("Translations:SubNewFormFile"), + onClick: onShowSelectFileDialog, + disabled: isPrivacy, + key: "form-file", + }, + { + className: "main-button_drop-down_sub", + icon: !isMobile && "images/form.react.svg", + label: t("Common:OFORMsGallery"), + onClick: onShowGallery, + disabled: isPrivacy, + key: "form-gallery", + }, + ], + }, + ]; const actions = [ {