Commit 33767212 authored by Robert Knight's avatar Robert Knight

Fix handling of `ctaBackgroundColor` on annotation post button

Fix the `ctaBackgroundColor` theme property not being applied properly
to the drop-down arrow on the right-hand side of the "Post to <group>"
button.
parent 20cd514a
...@@ -58,9 +58,6 @@ function AnnotationPublishControl({ ...@@ -58,9 +58,6 @@ function AnnotationPublishControl({
const publishDestination = isPrivate ? 'Only Me' : group.name; const publishDestination = isPrivate ? 'Only Me' : group.name;
/** @type {ThemeProperty[]} */
const themeProps = ['ctaTextColor', 'ctaBackgroundColor'];
// Revert changes to this annotation // Revert changes to this annotation
const onCancel = () => { const onCancel = () => {
removeDraft(annotation); removeDraft(annotation);
...@@ -77,11 +74,13 @@ function AnnotationPublishControl({ ...@@ -77,11 +74,13 @@ function AnnotationPublishControl({
} }
}; };
const buttonStyle = applyTheme(
['ctaTextColor', 'ctaBackgroundColor'],
settings
);
const menuLabel = ( const menuLabel = (
<div <div className="annotation-publish-button__menu-label" style={buttonStyle}>
className="annotation-publish-button__menu-label"
style={applyTheme(themeProps, settings)}
>
<SvgIcon name="expand-menu" className="u-icon--small" /> <SvgIcon name="expand-menu" className="u-icon--small" />
</div> </div>
); );
...@@ -91,7 +90,7 @@ function AnnotationPublishControl({ ...@@ -91,7 +90,7 @@ function AnnotationPublishControl({
<div className="annotation-publish-button"> <div className="annotation-publish-button">
<Button <Button
className="annotation-publish-button__primary" className="annotation-publish-button__primary"
style={applyTheme(themeProps, settings)} style={buttonStyle}
onClick={onSave} onClick={onSave}
disabled={isDisabled} disabled={isDisabled}
title={`Publish this annotation to ${publishDestination}`} title={`Publish this annotation to ${publishDestination}`}
...@@ -99,7 +98,10 @@ function AnnotationPublishControl({ ...@@ -99,7 +98,10 @@ function AnnotationPublishControl({
/> />
{/* This wrapper div is necessary because of peculiarities with {/* This wrapper div is necessary because of peculiarities with
Safari: see https://github.com/hypothesis/client/issues/2302 */} Safari: see https://github.com/hypothesis/client/issues/2302 */}
<div className="annotation-publish-button__menu-wrapper"> <div
className="annotation-publish-button__menu-wrapper"
style={buttonStyle}
>
<Menu <Menu
arrowClass="annotation-publish-button__menu-arrow" arrowClass="annotation-publish-button__menu-arrow"
containerPositioned={false} containerPositioned={false}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment