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';
11
11
import PropTypes from 'lib/PropTypes' ;
12
12
import React from 'react' ;
13
13
import { Link } from 'react-router-dom' ;
14
+ import Icon from 'components/Icon/Icon.react' ;
14
15
15
16
export default class CategoryList extends React . Component {
16
17
static contextType = CurrentApp ;
@@ -128,6 +129,17 @@ export default class CategoryList extends React.Component {
128
129
< span > { count } </ span >
129
130
< span > { c . name } </ span >
130
131
</ 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
+ ) }
131
143
{ ( c . filters || [ ] ) . length !== 0 && (
132
144
< a
133
145
className = { styles . expand }
Original file line number Diff line number Diff line change 86
86
flex-grow : 1
87
87
}
88
88
}
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
+ }
89
103
}
90
104
91
105
.childLink {
Original file line number Diff line number Diff line change @@ -401,10 +401,13 @@ class Views extends TableView {
401
401
}
402
402
403
403
renderSidebar ( ) {
404
- const categories = this . state . views . map ( view => ( {
404
+ const categories = this . state . views . map ( ( view , index ) => ( {
405
405
name : view . name ,
406
406
id : view . name ,
407
407
count : this . state . counts [ view . name ] ,
408
+ onEdit : ( ) => {
409
+ this . setState ( { editView : view , editIndex : index } ) ;
410
+ } ,
408
411
} ) ) ;
409
412
const current = this . props . params . name || '' ;
410
413
return (
You can’t perform that action at this time.
0 commit comments