fixed info panel gallery view interaction with tile context menu

This commit is contained in:
Mushka Nikita 2023-02-17 02:11:37 +03:00
parent 10c637e822
commit f7ae136452
3 changed files with 11 additions and 7 deletions

View File

@ -100,9 +100,8 @@ class Tile extends React.PureComponent {
};
onShowTemplateInfo = () => {
if (!this.props.isInfoPanelVisible) {
this.props.setIsInfoPanelVisible(true);
}
this.onSelectForm();
if (!this.props.isInfoPanelVisible) this.props.setIsInfoPanelVisible(true);
};
getOptions = () => ["create", "template-info"];

View File

@ -5,11 +5,11 @@ import { ReactSVG } from "react-svg";
import { Text } from "@docspace/components";
import { StyledTitle } from "../../styles/common";
const GalleryItemTitle = ({ selection, getIcon }) => {
const GalleryItemTitle = ({ gallerySelected, getIcon }) => {
return (
<StyledTitle>
<ReactSVG className="icon" src={getIcon(32, ".docxf")} />
<Text className="text">{selection?.attributes?.name_form}</Text>
<Text className="text">{gallerySelected?.attributes?.name_form}</Text>
</StyledTitle>
);
};

View File

@ -7,6 +7,7 @@ import GalleryItemTitle from "./GalleryItemTitle";
const ItemTitle = ({
selection,
gallerySelected,
isRooms,
isAccounts,
isGallery,
@ -30,7 +31,9 @@ const ItemTitle = ({
);
if (isGallery)
return <GalleryItemTitle selection={selection} getIcon={getIcon} />;
return (
<GalleryItemTitle gallerySelected={gallerySelected} getIcon={getIcon} />
);
const filesItemSelection =
isRooms &&
@ -51,12 +54,14 @@ const ItemTitle = ({
);
};
export default inject(({ auth, settingsStore, peopleStore }) => {
export default inject(({ auth, settingsStore, peopleStore, oformsStore }) => {
const { selectionParentRoom, roomsView } = auth.infoPanelStore;
const { getIcon } = settingsStore;
const { getUserContextOptions } = peopleStore.contextOptionsStore;
const { gallerySelected } = oformsStore;
return {
gallerySelected,
getUserContextOptions,
selectionParentRoom,
roomsView,