From 1363fc11f6740cb3e1a3acdbd6a53662f4890338 Mon Sep 17 00:00:00 2001 From: asvarcas Date: Tue, 3 Mar 2020 11:59:07 -0300 Subject: [PATCH 1/2] Fix `link` style provided to classes prop is not implemented. --- packages/ra-ui-materialui/src/list/SimpleList.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/ra-ui-materialui/src/list/SimpleList.js b/packages/ra-ui-materialui/src/list/SimpleList.js index 282e15595d4..c41daa0e267 100644 --- a/packages/ra-ui-materialui/src/list/SimpleList.js +++ b/packages/ra-ui-materialui/src/list/SimpleList.js @@ -70,11 +70,12 @@ const SimpleList = ({ ...rest }) => { const classes = useStyles({ classes: classesOverride }); + const { link, ...restClasses } = classes; if (loaded === false) { return ( Date: Tue, 3 Mar 2020 14:43:01 -0300 Subject: [PATCH 2/2] Created useLinkOrNotStyles for use with LinkOrNot component and useStyles for SimpleList. --- packages/ra-ui-materialui/src/list/SimpleList.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/ra-ui-materialui/src/list/SimpleList.js b/packages/ra-ui-materialui/src/list/SimpleList.js index c41daa0e267..2f4d4e92aec 100644 --- a/packages/ra-ui-materialui/src/list/SimpleList.js +++ b/packages/ra-ui-materialui/src/list/SimpleList.js @@ -13,14 +13,20 @@ import { linkToRecord, sanitizeListRestProps } from 'ra-core'; import SimpleListLoading from './SimpleListLoading'; const useStyles = makeStyles( + { + tertiary: { float: 'right', opacity: 0.541176 }, + }, + { name: 'RaSimpleList' } +); + +const useLinkOrNotStyles = makeStyles( { link: { textDecoration: 'none', color: 'inherit', }, - tertiary: { float: 'right', opacity: 0.541176 }, }, - { name: 'RaSimpleList' } + { name: 'RaLinkOrNot' } ); const LinkOrNot = ({ @@ -30,7 +36,7 @@ const LinkOrNot = ({ id, children, }) => { - const classes = useStyles({ classes: classesOverride }); + const classes = useLinkOrNotStyles({ classes: classesOverride }); return linkType === 'edit' || linkType === true ? ( {children} @@ -70,12 +76,11 @@ const SimpleList = ({ ...rest }) => { const classes = useStyles({ classes: classesOverride }); - const { link, ...restClasses } = classes; if (loaded === false) { return (