@@ -8,20 +8,20 @@ import alignJustifySVG from '@plone/volto/icons/align-justify.svg';
8
8
import alignCenterSVG from '@plone/volto/icons/align-center.svg' ;
9
9
import clearSVG from '@plone/volto/icons/clear.svg' ;
10
10
11
- const VALUE_MAP = [
12
- [ 'left' , alignLeftSVG ] ,
13
- [ 'right' , alignRightSVG ] ,
14
- [ 'center' , alignCenterSVG ] ,
15
- [ 'justify' , alignJustifySVG ] ,
16
- [ '' , clearSVG ] ,
11
+ export const TEXT_ALIGN_VALUE_MAP = [
12
+ [ 'left' , alignLeftSVG , 'Left align' ] ,
13
+ [ 'right' , alignRightSVG , 'Right align' ] ,
14
+ [ 'center' , alignCenterSVG , 'Center align' ] ,
15
+ [ 'justify' , alignJustifySVG , 'Justify align' ] ,
16
+ [ '' , clearSVG , 'Clear selection' ] ,
17
17
] ;
18
18
19
19
export default ( props ) => {
20
- const { value, onChange, id, actions = VALUE_MAP } = props ;
20
+ const { value, onChange, id, actions = TEXT_ALIGN_VALUE_MAP } = props ;
21
21
return (
22
22
< FormFieldWrapper { ...props } >
23
23
< div className = "align-tools" >
24
- { actions . map ( ( [ name , icon ] , index ) => (
24
+ { actions . map ( ( [ name , icon , title ] , index ) => (
25
25
< Button . Group key = { `button-group-${ name } -${ index } ` } >
26
26
< Button
27
27
icon
@@ -33,7 +33,7 @@ export default (props) => {
33
33
onChange ( id , name ) ;
34
34
} }
35
35
>
36
- < Icon name = { icon } size = "24px" />
36
+ < Icon name = { icon } title = { title || name } size = "24px" />
37
37
</ Button >
38
38
</ Button . Group >
39
39
) ) }
0 commit comments