1
1
import { Icon , LabeledButton } from '@hypothesis/frontend-shared' ;
2
+ import classnames from 'classnames' ;
2
3
3
4
import { useStoreProxy } from '../../store/use-store' ;
4
5
import { isNew , isReply } from '../../helpers/annotation-metadata' ;
@@ -72,16 +73,19 @@ function AnnotationPublishControl({
72
73
) ;
73
74
74
75
const menuLabel = (
75
- < div className = "annotation-publish-button__menu-label " style = { buttonStyle } >
76
+ < div className = "p-2.5 text-color-text-inverted " style = { buttonStyle } >
76
77
< Icon name = "expand-menu" />
77
78
</ div >
78
79
) ;
79
80
80
81
return (
81
- < div className = "hyp-u-layout- row hyp-u-horizontal-spacing--4 " >
82
- < div className = "annotation-publish-button " >
82
+ < div className = "flex flex- row gap-x-3 " >
83
+ < div className = "flex relative " >
83
84
< LabeledButton
84
- classes = "PublishControlButton"
85
+ classes = { classnames (
86
+ // Turn off right-side border radius to align with menu-open button
87
+ 'rounded-r-none'
88
+ ) }
85
89
data-testid = "publish-control-button"
86
90
style = { buttonStyle }
87
91
onClick = { onSave }
@@ -94,13 +98,24 @@ function AnnotationPublishControl({
94
98
{ /* This wrapper div is necessary because of peculiarities with
95
99
Safari: see https://github.com/hypothesis/client/issues/2302 */ }
96
100
< div
97
- className = "annotation-publish-button__menu-wrapper"
101
+ className = { classnames (
102
+ // Round the right side of this menu-open button only
103
+ 'flex flex-row rounded-r-sm bg-grey-7 hover:bg-grey-8'
104
+ ) }
98
105
style = { buttonStyle }
99
106
>
100
107
< Menu
101
- arrowClass = "annotation-publish-button__menu-arrow"
108
+ arrowClass = { classnames (
109
+ // Position up-pointing menu caret aligned beneath the
110
+ // down-pointing menu-open button icon
111
+ 'right-[10px]'
112
+ ) }
102
113
containerPositioned = { false }
103
- contentClass = "annotation-publish-button__menu-content"
114
+ contentClass = { classnames (
115
+ // Ensure the menu is wide enough to "reach" the right-aligned
116
+ // up-pointing menu arrow
117
+ 'min-w-full'
118
+ ) }
104
119
label = { menuLabel }
105
120
menuIndicator = { false }
106
121
title = "Change annotation sharing setting"
@@ -122,7 +137,12 @@ function AnnotationPublishControl({
122
137
</ div >
123
138
</ div >
124
139
< div >
125
- < LabeledButton icon = "cancel" onClick = { onCancel } size = "large" >
140
+ < LabeledButton
141
+ classes = "p-2.5"
142
+ icon = "cancel"
143
+ onClick = { onCancel }
144
+ size = "large"
145
+ >
126
146
Cancel
127
147
</ LabeledButton >
128
148
</ div >
0 commit comments