diff --git a/products/ASC.Files/Client/src/pages/Home/Section/Header/index.js b/products/ASC.Files/Client/src/pages/Home/Section/Header/index.js index b7e3ff21c19..4e3a30670d2 100644 --- a/products/ASC.Files/Client/src/pages/Home/Section/Header/index.js +++ b/products/ASC.Files/Client/src/pages/Home/Section/Header/index.js @@ -87,6 +87,20 @@ const StyledContainer = styled.div` } } } + + .trash-button { + margin-bottom: -1px; + + @media (min-width: 1024px) { + margin-left: 8px; + } + + @media ${tablet} { + & > div:first-child { + margin-right: -8px; + } + } + } } .group-button-menu-container { @@ -352,6 +366,8 @@ class SectionHeaderContent extends React.Component { isTabletView, personal, viewAs, + isRecycleBinFolder, + isEmptyFilesList, } = this.props; const menuItems = this.getMenuItems(); @@ -449,6 +465,19 @@ class SectionHeaderContent extends React.Component { /> ) )} + {isRecycleBinFolder && !isEmptyFilesList && ( + + + + )} )} @@ -468,6 +497,7 @@ export default inject( selectedFolderStore, filesActionsStore, settingsStore, + treeFoldersStore, }) => { const { setSelected, @@ -483,6 +513,7 @@ export default inject( viewAs, cbMenuItems, getCheckboxItemLabel, + isEmptyFilesList, } = filesStore; const { setAction } = fileActionStore; const { @@ -490,8 +521,10 @@ export default inject( setMoveToPanelVisible, setCopyPanelVisible, setDeleteDialogVisible, + setEmptyTrashDialogVisible, } = dialogsStore; + const { isRecycleBinFolder } = treeFoldersStore; const { deleteAction, downloadAction, getHeaderMenu } = filesActionsStore; return { @@ -524,6 +557,10 @@ export default inject( downloadAction, getHeaderMenu, getCheckboxItemLabel, + + isRecycleBinFolder, + setEmptyTrashDialogVisible, + isEmptyFilesList, }; } )( diff --git a/products/ASC.Files/Client/src/store/FilesActionsStore.js b/products/ASC.Files/Client/src/store/FilesActionsStore.js index da21f310cba..78a99d491eb 100644 --- a/products/ASC.Files/Client/src/store/FilesActionsStore.js +++ b/products/ASC.Files/Client/src/store/FilesActionsStore.js @@ -843,11 +843,7 @@ class FilesActionStore { label: t("Translations:Restore"), onClick: () => setMoveToPanelVisible(true), }) - .set("delete", deleteOption) - .set("emptyRecycleBin", { - label: t("EmptyRecycleBin"), - onClick: () => setEmptyTrashDialogVisible(true), - }); + .set("delete", deleteOption); return this.convertToArray(itemsCollection); }; getHeaderMenu = (t) => {