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