File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import generatePath from 'lib/generatePath';
1111import PropTypes from 'lib/PropTypes' ;
1212import React from 'react' ;
1313import { Link } from 'react-router-dom' ;
14+ import Icon from 'components/Icon/Icon.react' ;
1415
1516export default class CategoryList extends React . Component {
1617 static contextType = CurrentApp ;
@@ -128,6 +129,17 @@ export default class CategoryList extends React.Component {
128129 < span > { count } </ span >
129130 < span > { c . name } </ span >
130131 </ Link >
132+ { c . onEdit && (
133+ < a
134+ className = { styles . edit }
135+ onClick = { e => {
136+ e . preventDefault ( ) ;
137+ c . onEdit ( ) ;
138+ } }
139+ >
140+ < Icon name = "edit-solid" width = { 14 } height = { 14 } />
141+ </ a >
142+ ) }
131143 { ( c . filters || [ ] ) . length !== 0 && (
132144 < a
133145 className = { styles . expand }
Original file line number Diff line number Diff line change 8686 flex-grow : 1
8787 }
8888 }
89+ .edit {
90+ display : flex ;
91+ align-items : center ;
92+ margin-right : 6px ;
93+ cursor : pointer ;
94+ svg {
95+ fill : #8fb9cf ;
96+ }
97+ & :hover {
98+ svg {
99+ fill : white ;
100+ }
101+ }
102+ }
89103}
90104
91105.childLink {
Original file line number Diff line number Diff line change @@ -401,10 +401,13 @@ class Views extends TableView {
401401 }
402402
403403 renderSidebar ( ) {
404- const categories = this . state . views . map ( view => ( {
404+ const categories = this . state . views . map ( ( view , index ) => ( {
405405 name : view . name ,
406406 id : view . name ,
407407 count : this . state . counts [ view . name ] ,
408+ onEdit : ( ) => {
409+ this . setState ( { editView : view , editIndex : index } ) ;
410+ } ,
408411 } ) ) ;
409412 const current = this . props . params . name || '' ;
410413 return (
You can’t perform that action at this time.
0 commit comments