File tree Expand file tree Collapse file tree 6 files changed +23
-23
lines changed
packages/ra-ui-materialui/src/list Expand file tree Collapse file tree 6 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -144,8 +144,8 @@ const ContactsIterator = () => {
144144 < RecordContextProvider key = { contact . id } value = { contact } >
145145 < ListItem
146146 disablePadding
147- { ... ( contact . last_seen && {
148- secondaryAction : (
147+ secondaryAction = {
148+ contact . last_seen ? (
149149 < Typography
150150 variant = "body2"
151151 color = "textSecondary"
@@ -155,8 +155,8 @@ const ContactsIterator = () => {
155155 { formatDistance ( contact . last_seen , now ) } ago{ ' ' }
156156 < Status status = { contact . status } />
157157 </ Typography >
158- ) ,
159- } ) }
158+ ) : null
159+ }
160160 >
161161 < ListItemButton
162162 component = { RouterLink }
Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ export const ContactListContent = () => {
5151 < RecordContextProvider key = { contact . id } value = { contact } >
5252 < ListItem
5353 disablePadding
54- { ... ( contact . last_seen && {
55- secondaryAction : (
54+ secondaryAction = {
55+ contact . last_seen ? (
5656 < Typography
5757 variant = "body2"
5858 color = "textSecondary"
@@ -69,8 +69,8 @@ export const ContactListContent = () => {
6969 ) } { ' ' }
7070 < Status status = { contact . status } />
7171 </ Typography >
72- ) ,
73- } ) }
72+ ) : null
73+ }
7474 >
7575 < ListItemButton
7676 component = { Link }
Original file line number Diff line number Diff line change @@ -124,8 +124,8 @@ export const SimpleList = <RecordType extends RaRecord = any>(
124124 rowSx = { rowSx }
125125 rowStyle = { rowStyle }
126126 resource = { resource }
127- { ... ( ( rightAvatar || rightIcon ) && {
128- secondaryAction : (
127+ secondaryAction = {
128+ rightAvatar || rightIcon ? (
129129 < >
130130 { rightAvatar && (
131131 < Avatar >
@@ -144,8 +144,8 @@ export const SimpleList = <RecordType extends RaRecord = any>(
144144 </ ListItemIcon >
145145 ) }
146146 </ >
147- ) ,
148- } ) }
147+ ) : null
148+ }
149149 >
150150 < SimpleListItemContent
151151 leftAvatar = { leftAvatar }
Original file line number Diff line number Diff line change @@ -38,9 +38,9 @@ export const SimpleListLoading = (inProps: SimpleListLoadingProps) => {
3838 { times ( nbFakeLines , key => (
3939 < ListItem
4040 key = { key }
41- { ... ( hasRightAvatarOrIcon && {
42- secondaryAction : < Avatar > </ Avatar > ,
43- } ) }
41+ secondaryAction = {
42+ hasRightAvatarOrIcon ? < Avatar > </ Avatar > : null
43+ }
4444 >
4545 { hasLeftAvatarOrIcon && (
4646 < ListItemAvatar >
Original file line number Diff line number Diff line change @@ -175,8 +175,8 @@ export const FilterListItem = memo((inProps: FilterListItemProps) => {
175175 return (
176176 < StyledListItem
177177 disablePadding
178- { ... ( isSelected && {
179- secondaryAction : (
178+ secondaryAction = {
179+ isSelected ? (
180180 < IconButton
181181 size = "small"
182182 onClick = { event => {
@@ -186,8 +186,8 @@ export const FilterListItem = memo((inProps: FilterListItemProps) => {
186186 >
187187 < CancelIcon />
188188 </ IconButton >
189- ) ,
190- } ) }
189+ ) : null
190+ }
191191 { ...rest }
192192 >
193193 < ListItemButton
Original file line number Diff line number Diff line change @@ -72,13 +72,13 @@ export const SavedQueryFilterListItem = memo(
7272 className = { className }
7373 sx = { sx }
7474 disablePadding
75- { ... ( isSelected && {
76- secondaryAction : (
75+ secondaryAction = {
76+ isSelected ? (
7777 < IconButton size = "small" onClick = { toggleFilter } >
7878 < CancelIcon />
7979 </ IconButton >
80- ) ,
81- } ) }
80+ ) : null
81+ }
8282 >
8383 < ListItemButton
8484 onClick = { toggleFilter }
You can’t perform that action at this time.
0 commit comments