mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
fix sort CM LeftMenu
This commit is contained in:
parent
a744346bd2
commit
835b47f433
@ -8,6 +8,7 @@ import React, { useMemo, useState } from 'react';
|
||||
import { useSelector, shallowEqual } from 'react-redux';
|
||||
import { useIntl } from 'react-intl';
|
||||
import matchSorter from 'match-sorter';
|
||||
import sortBy from 'lodash/sortBy';
|
||||
import toLower from 'lodash/toLower';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import {
|
||||
@ -21,7 +22,9 @@ import getTrad from '../../../utils/getTrad';
|
||||
import { makeSelectModelLinks } from '../selectors';
|
||||
|
||||
const matchByTitle = (links, search) =>
|
||||
search ? matchSorter(links, toLower(search), { keys: [(item) => toLower(item.title)] }) : links;
|
||||
search
|
||||
? matchSorter(links, toLower(search), { keys: [(item) => toLower(item.title)] })
|
||||
: sortBy(links, (object) => object.title.toLowerCase());
|
||||
|
||||
const LeftMenu = () => {
|
||||
const [search, setSearch] = useState('');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user