hide icon if selection more than one session

This commit is contained in:
Elyor Djalilov 2024-01-15 18:34:15 +05:00
parent 03eedd78b9
commit dd7224be49
2 changed files with 8 additions and 0 deletions

View File

@ -302,6 +302,7 @@ const SectionHeaderContent = (props) => {
isPeopleHeaderVisible,
isPeopleHeaderChecked,
selection,
isVisible,
} = props;
const { header, isCategoryOrHeader, isNeedPaidIcon } = state;
const arrayOfParams = getArrayOfParams();
@ -345,6 +346,7 @@ const SectionHeaderContent = (props) => {
id: "sessions",
key: "Sessions",
label: t("Common:Sessions"),
disabled: isVisible,
onClick: () => console.log("Sessions"),
iconUrl: HistoryFinalizedReactSvgUrl,
},
@ -466,6 +468,7 @@ export default inject(({ auth, setup, common, peopleStore }) => {
isHeaderChecked: isPeopleHeaderChecked,
isHeaderVisible: isPeopleHeaderVisible,
setSelected: peopleSetSelected,
isVisible,
} = peopleStore.selectionStore;
const { admins, selectorIsOpen } = setup.security.accessRight;
@ -492,6 +495,7 @@ export default inject(({ auth, setup, common, peopleStore }) => {
isPeopleHeaderIndeterminate,
isPeopleHeaderChecked,
isPeopleHeaderVisible,
isVisible,
};
})(
withLoading(

View File

@ -329,6 +329,10 @@ class SelectionStore {
return users.map((u) => u.id);
}
get isVisible() {
return this.selection.length > 1;
}
get isHeaderVisible() {
return this.selection.length > 0;
}