pr review apply

This commit is contained in:
Virginie Ky 2019-12-17 00:12:50 +01:00
parent 7b28ebe3b5
commit 3d570a41f5
2 changed files with 9 additions and 6 deletions

View File

@ -5,18 +5,20 @@
*/
import React from 'react';
import { LeftMenu, LeftMenuList } from 'strapi-helper-plugin';
import { useGlobalContext, LeftMenu, LeftMenuList } from 'strapi-helper-plugin';
import Webhooks from '../Webhooks';
import Wrapper from './Wrapper';
function SettingsPage() {
const { formatMessage } = useGlobalContext();
const menuItems = [
{
title: { id: 'app.components.LeftMenuLinkContainer.general' },
links: [
{
title: 'webhooks',
title: formatMessage({ id: `Settings.webhooks.title` }),
to: '/settings/webhooks',
name: 'webhooks',
},
@ -31,7 +33,9 @@ function SettingsPage() {
<div className="col-md-3">
<LeftMenu>
{menuItems.map(item => {
return <LeftMenuList {...item} key={item.title} />;
return (
<LeftMenuList {...item} key={JSON.stringify(item.title)} />
);
})}
</LeftMenu>
</div>

View File

@ -79,7 +79,6 @@ function LeftMenuHeader({ count, search, searchable, setSearch, title }) {
LeftMenuHeader.defaultProps = {
count: 0,
title: null,
search: null,
searchable: false,
setSearch: () => {},
@ -88,8 +87,8 @@ LeftMenuHeader.defaultProps = {
LeftMenuHeader.propTypes = {
count: PropTypes.number,
title: PropTypes.shape({
id: PropTypes.string,
}),
id: PropTypes.string.isRequired,
}).isRequired,
search: PropTypes.string,
searchable: PropTypes.bool,
setSearch: PropTypes.func,