File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ const useStyles = makeStyles({
4242 } ,
4343 background : { backgroundColor : 'white' } ,
4444 highlightedItem : {
45- width : '100%' ,
4645 borderLeft : '6px solid ' + lime ,
4746 background : lightLime ,
4847 } ,
@@ -235,13 +234,6 @@ export default function FlatList({
235234 }
236235
237236 function renderItem ( item : FlatListItem , idx : number ) : JSX . Element {
238- let itemClass = ''
239- if ( ! item . highlight ) {
240- itemClass = classes . listItem
241- }
242- if ( item . disabled ) {
243- itemClass = classes . listItemDisabled
244- }
245237 let itemProps = { }
246238 if ( item . url ) {
247239 itemProps = {
@@ -256,7 +248,11 @@ export default function FlatList({
256248 scrollIntoView = { item . scrollIntoView }
257249 key = { idx }
258250 { ...itemProps }
259- className = { itemClass }
251+ className = { classnames ( {
252+ [ classes . listItem ] : true ,
253+ [ classes . highlightedItem ] : item . highlight ,
254+ [ classes . listItemDisabled ] : item . disabled ,
255+ } ) }
260256 >
261257 { item . icon && < ListItemIcon > { item . icon } </ ListItemIcon > }
262258 < ListItemText
You can’t perform that action at this time.
0 commit comments