File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
packages/block-library/top-charts Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 6
6
useBlockProps ,
7
7
BlockContextProvider ,
8
8
useInnerBlocksProps ,
9
+ BlockControls ,
9
10
} from '@wordpress/block-editor' ;
10
11
import { useEntityProp } from '@wordpress/core-data' ;
11
12
import { useEffect , useState } from '@wordpress/element' ;
@@ -17,7 +18,10 @@ import {
17
18
Placeholder ,
18
19
__experimentalHStack as HStack ,
19
20
__experimentalInputControl as InputControl ,
21
+ ToolbarGroup ,
22
+ ToolbarButton ,
20
23
} from '@wordpress/components' ;
24
+ import { edit } from '@wordpress/icons' ;
21
25
22
26
const Edit = ( {
23
27
attributes : { collection } ,
@@ -105,9 +109,20 @@ const Edit = ( {
105
109
}
106
110
107
111
return (
108
- < BlockContextProvider value = { { collection : items } } >
109
- < div { ...innerBlockProps } />
110
- </ BlockContextProvider >
112
+ < >
113
+ < BlockControls >
114
+ < ToolbarGroup >
115
+ < ToolbarButton
116
+ label = { __ ( 'Change Settings' , 'profile-blocks-lastfm' ) }
117
+ icon = { edit }
118
+ onClick = { ( ) => setShowSetup ( true ) }
119
+ />
120
+ </ ToolbarGroup >
121
+ </ BlockControls >
122
+ < BlockContextProvider value = { { collection : items } } >
123
+ < div { ...innerBlockProps } />
124
+ </ BlockContextProvider >
125
+ </ >
111
126
) ;
112
127
} ;
113
128
export default Edit ;
You can’t perform that action at this time.
0 commit comments