mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Update list item limitation
Signed-off-by: HichamELBSI <elabbassih@gmail.com>
This commit is contained in:
parent
bd284f0637
commit
f534ec32a9
@ -5,7 +5,8 @@ import colors from '../../assets/styles/colors';
|
||||
const List = styled.ul`
|
||||
margin-bottom: 0;
|
||||
padding-left: 0;
|
||||
max-height: 180px;
|
||||
max-height: ${props =>
|
||||
props.numberOfVisibleItems ? `${props.numberOfVisibleItems * 35}px` : null};
|
||||
overflow-y: scroll;
|
||||
li {
|
||||
position: relative;
|
||||
|
@ -9,7 +9,13 @@ import LeftMenuHeader from '../LeftMenuHeader';
|
||||
import List from './List';
|
||||
import Wrapper from './Wrapper';
|
||||
|
||||
function LeftMenuList({ customLink, links, title, searchable }) {
|
||||
function LeftMenuList({
|
||||
customLink,
|
||||
links,
|
||||
title,
|
||||
searchable,
|
||||
numberOfVisibleItems,
|
||||
}) {
|
||||
const [search, setSearch] = useState('');
|
||||
const formatTitleWithIntl = title => {
|
||||
if (isObject(title) && title.id) {
|
||||
@ -87,7 +93,9 @@ function LeftMenuList({ customLink, links, title, searchable }) {
|
||||
<LeftMenuHeader {...headerProps} />
|
||||
</div>
|
||||
<div>
|
||||
<List>{getList().map((link, i) => renderCompo(link, i))}</List>
|
||||
<List numberOfVisibleItems={numberOfVisibleItems}>
|
||||
{getList().map((link, i) => renderCompo(link, i))}
|
||||
</List>
|
||||
{Component && isValidElement(<Component />) && (
|
||||
<Component {...componentProps} />
|
||||
)}
|
||||
@ -101,6 +109,7 @@ LeftMenuList.defaultProps = {
|
||||
links: [],
|
||||
title: null,
|
||||
searchable: false,
|
||||
numberOfVisibleItems: null,
|
||||
};
|
||||
|
||||
LeftMenuList.propTypes = {
|
||||
@ -116,6 +125,7 @@ LeftMenuList.propTypes = {
|
||||
id: PropTypes.string,
|
||||
}),
|
||||
searchable: PropTypes.bool,
|
||||
numberOfVisibleItems: PropTypes.number,
|
||||
};
|
||||
|
||||
export default LeftMenuList;
|
||||
|
@ -121,7 +121,6 @@ module.exports = {
|
||||
|
||||
await service.setConfiguration(uid, input);
|
||||
const contentTypeConfigurations = await service.getConfiguration(uid);
|
||||
|
||||
const data = {
|
||||
uid,
|
||||
schema,
|
||||
|
@ -11,7 +11,7 @@ const getAttributes = (dataTarget = '', targetUid, nestedComponents) => {
|
||||
'media',
|
||||
'boolean',
|
||||
'json',
|
||||
// 'uid',
|
||||
'uid',
|
||||
'relation',
|
||||
],
|
||||
];
|
||||
|
@ -177,7 +177,9 @@ function LeftMenu({ wait }) {
|
||||
return (
|
||||
<Wrapper className="col-md-3">
|
||||
{data.map(list => {
|
||||
return <LeftMenuList {...list} key={list.name} />;
|
||||
return (
|
||||
<LeftMenuList numberOfVisibleItems={5} {...list} key={list.name} />
|
||||
);
|
||||
})}
|
||||
</Wrapper>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user