mirror of
https://github.com/strapi/strapi.git
synced 2025-10-27 16:10:08 +00:00
clean numberOfVisibleItems prop
Signed-off-by: Virginie Ky <virginie.ky@gmail.com>
This commit is contained in:
parent
8d52924783
commit
59c567aa3c
@ -9,7 +9,7 @@ import LeftMenuHeader from '../LeftMenuHeader';
|
||||
import List from './List';
|
||||
import Wrapper from './Wrapper';
|
||||
|
||||
function LeftMenuList({ customLink, links, title, searchable, numberOfVisibleItems }) {
|
||||
function LeftMenuList({ customLink, links, title, searchable }) {
|
||||
const [search, setSearch] = useState('');
|
||||
const { formatMessage } = useGlobalContext();
|
||||
|
||||
@ -100,9 +100,7 @@ function LeftMenuList({ customLink, links, title, searchable, numberOfVisibleIte
|
||||
<LeftMenuHeader {...headerProps} />
|
||||
</div>
|
||||
<div>
|
||||
<List numberOfVisibleItems={numberOfVisibleItems}>
|
||||
{getList().map((link, i) => renderCompo(link, i))}
|
||||
</List>
|
||||
<List>{getList().map((link, i) => renderCompo(link, i))}</List>
|
||||
{Component && isValidElement(<Component />) && <Component {...componentProps} />}
|
||||
</div>
|
||||
</Wrapper>
|
||||
@ -114,7 +112,6 @@ LeftMenuList.defaultProps = {
|
||||
links: [],
|
||||
title: null,
|
||||
searchable: false,
|
||||
numberOfVisibleItems: null,
|
||||
};
|
||||
|
||||
LeftMenuList.propTypes = {
|
||||
@ -130,7 +127,6 @@ LeftMenuList.propTypes = {
|
||||
id: PropTypes.string,
|
||||
}),
|
||||
searchable: PropTypes.bool,
|
||||
numberOfVisibleItems: PropTypes.number,
|
||||
};
|
||||
|
||||
export default LeftMenuList;
|
||||
|
||||
@ -76,12 +76,8 @@ function LeftMenu({ wait }) {
|
||||
|
||||
const canOpenModalCreateCTorComponent = () => {
|
||||
return (
|
||||
!Object.keys(contentTypes).some(
|
||||
ct => contentTypes[ct].isTemporary === true
|
||||
) &&
|
||||
!Object.keys(components).some(
|
||||
component => components[component].isTemporary === true
|
||||
)
|
||||
!Object.keys(contentTypes).some(ct => contentTypes[ct].isTemporary === true) &&
|
||||
!Object.keys(components).some(component => components[component].isTemporary === true)
|
||||
);
|
||||
};
|
||||
|
||||
@ -128,9 +124,7 @@ function LeftMenu({ wait }) {
|
||||
},
|
||||
}
|
||||
: null,
|
||||
links: sortedContentTypesList.filter(
|
||||
contentType => contentType.kind === 'collectionType'
|
||||
),
|
||||
links: sortedContentTypesList.filter(contentType => contentType.kind === 'collectionType'),
|
||||
},
|
||||
{
|
||||
name: 'singleTypes',
|
||||
@ -149,9 +143,7 @@ function LeftMenu({ wait }) {
|
||||
},
|
||||
}
|
||||
: null,
|
||||
links: sortedContentTypesList.filter(
|
||||
singleType => singleType.kind === 'singleType'
|
||||
),
|
||||
links: sortedContentTypesList.filter(singleType => singleType.kind === 'singleType'),
|
||||
},
|
||||
{
|
||||
name: 'components',
|
||||
@ -177,9 +169,7 @@ function LeftMenu({ wait }) {
|
||||
return (
|
||||
<Wrapper className="col-md-3">
|
||||
{data.map(list => {
|
||||
return (
|
||||
<LeftMenuList numberOfVisibleItems={5} {...list} key={list.name} />
|
||||
);
|
||||
return <LeftMenuList {...list} key={list.name} />;
|
||||
})}
|
||||
</Wrapper>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user