- QOL in list of companies - added scrollbar;
- QOL in list of files;
This commit is contained in:
@@ -18,23 +18,13 @@ const TopBarProfileMenu = ({ menuLeftRef }) => {
|
||||
const companies = useStore().main.companies();
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId()
|
||||
const [companyItems, setCompanyItems] = useState([]);
|
||||
const renderCompanyItem = (item) => (
|
||||
<span className="topBar__menuCompanyItem"
|
||||
onClick={() => switchCompany(item.companyId)}
|
||||
data-id={item.companyId}
|
||||
data-active={chosenCompanyId === item.companyId}>
|
||||
<i className="pi pi-building-columns"></i>
|
||||
{item.label}
|
||||
</span>
|
||||
);
|
||||
const toast = useRef(null);
|
||||
let items = [
|
||||
{
|
||||
template: (item, options) => {
|
||||
template: () => {
|
||||
return (
|
||||
<div className="topBar__menuProfileItem">
|
||||
{/*<Avatar image="https://primefaces.org/cdn/primereact/images/avatar/amyelsner.png" shape="circle" />*/}
|
||||
<div className="userInfo">
|
||||
<div className="userInfo">
|
||||
<span className="userName" title={fulleName}>{fulleName}</span>
|
||||
<span className="userEmail" title={userData.email}>{userData.email}</span>
|
||||
</div>
|
||||
@@ -59,7 +49,15 @@ const TopBarProfileMenu = ({ menuLeftRef }) => {
|
||||
},
|
||||
{
|
||||
label: __('Seleziona azienda', 'gepafin'),
|
||||
items: companyItems,
|
||||
template: () => {
|
||||
return (
|
||||
<div className="p-menuitem-content" data-pc-section="content">
|
||||
<ul className="topBar__menuCompaniesList">
|
||||
{companyItems.map(o => o.component)}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
enable: companies.length
|
||||
},
|
||||
{
|
||||
@@ -104,7 +102,15 @@ const TopBarProfileMenu = ({ menuLeftRef }) => {
|
||||
const items = companies.map(o => ({
|
||||
label: o.companyName,
|
||||
companyId: o.id,
|
||||
template: renderCompanyItem
|
||||
component: <li key={o.id}>
|
||||
<span className="topBar__menuCompanyItem"
|
||||
onClick={() => switchCompany(o.id)}
|
||||
data-id={o.id}
|
||||
data-active={chosenCompanyId === o.id}>
|
||||
<i className="pi pi-building-columns"></i>
|
||||
{o.companyName}
|
||||
</span>
|
||||
</li>
|
||||
}));
|
||||
setCompanyItems(items);
|
||||
}, [companies, chosenCompanyId])
|
||||
|
||||
Reference in New Issue
Block a user