@@ -99,24 +99,21 @@ export class SimpleList extends React.Component<SimpleListProps, SimpleListState
9999 const { onEdit, onRemove, onReorder } = this . props ;
100100 const { draggedItem, dropIndex } = this . state ;
101101
102- const svgize = ( iconName : string ) => iconName ? < SvgIcon svg = { require ( `../../icons/${ iconName } .svg` ) } /> : null ;
103-
104102 return rows . map ( ( row , i ) => {
105103 let { title, description, icon} = row ;
106104
107105 let dragHandle = < div className = "drag-handle" >
108106 < SvgIcon svg = { require ( '../../icons/dragger.svg' ) } />
109107 </ div > ;
110108
111- let svg = svgize ( icon ) ;
112109 let text = < div className = "text" >
113110 < div className = "title" > { title } </ div >
114111 < div className = "description" > { description } </ div >
115112 </ div > ;
116113
117114 let actions = < div className = "actions" >
118- < button onClick = { onEdit . bind ( this , i ) } > { svgize ( ' full-edit' ) } </ button >
119- < button onClick = { onRemove . bind ( this , i ) } > { svgize ( ' full-remove' ) } </ button >
115+ < button onClick = { onEdit . bind ( this , i ) } > < SvgIcon svg = { require ( `../../icons/ full-edit.svg` ) } /> </ button >
116+ < button onClick = { onRemove . bind ( this , i ) } > < SvgIcon svg = { require ( `../../icons/ full-remove.svg` ) } /> </ button >
120117 </ div > ;
121118
122119 const isBeingDragged = draggedItem === row ;
@@ -141,7 +138,7 @@ export class SimpleList extends React.Component<SimpleListProps, SimpleListState
141138 onDragStart = { this . dragStart . bind ( this , row ) }
142139 >
143140 { onReorder ? dragHandle : null }
144- { svg }
141+ { icon ? < SvgIcon svg = { icon } /> : null }
145142 { text }
146143 { actions }
147144 </ div > ;
0 commit comments