Web: Files: MainButton: add submenu for mobile

This commit is contained in:
Viktor Fomin 2022-07-04 07:10:07 +03:00
parent bc48d626c8
commit c6691b5de6

View File

@ -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 = [
{