Commit 1326d1a9 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Finish conversion of AnnotationEditor to Tailwind

parent 5baa223b
...@@ -172,7 +172,8 @@ function AnnotationEditor({ ...@@ -172,7 +172,8 @@ function AnnotationEditor({
return ( return (
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */ /* eslint-disable-next-line jsx-a11y/no-static-element-interactions */
<div <div
className="hyp-u-vertical-spacing AnnotationEditor" data-testid="annotation-editor"
className="space-y-4"
onKeyDown={onKeyDown} onKeyDown={onKeyDown}
> >
<MarkdownEditor <MarkdownEditor
...@@ -187,18 +188,16 @@ function AnnotationEditor({ ...@@ -187,18 +188,16 @@ function AnnotationEditor({
onTagInput={setPendingTag} onTagInput={setPendingTag}
tagList={tags} tagList={tags}
/> />
<div className="hyp-u-layout-row annotation__form-actions"> {group && (
{group && ( <AnnotationPublishControl
<AnnotationPublishControl group={group}
group={group} isDisabled={isEmpty}
isDisabled={isEmpty} isPrivate={draft.isPrivate}
isPrivate={draft.isPrivate} onCancel={onCancel}
onCancel={onCancel} onSave={onSave}
onSave={onSave} onSetPrivate={onSetPrivate}
onSetPrivate={onSetPrivate} />
/> )}
)}
</div>
{shouldShowLicense && <AnnotationLicense />} {shouldShowLicense && <AnnotationLicense />}
</div> </div>
); );
......
...@@ -19,6 +19,8 @@ describe('AnnotationEditor', () => { ...@@ -19,6 +19,8 @@ describe('AnnotationEditor', () => {
let fakeStore; let fakeStore;
const editorSelector = '[data-testid="annotation-editor"]';
function createComponent(props = {}) { function createComponent(props = {}) {
return mount( return mount(
<AnnotationEditor <AnnotationEditor
...@@ -199,7 +201,7 @@ describe('AnnotationEditor', () => { ...@@ -199,7 +201,7 @@ describe('AnnotationEditor', () => {
const wrapper = createComponent({ draft }); const wrapper = createComponent({ draft });
wrapper wrapper
.find('.AnnotationEditor') .find(editorSelector)
.simulate('keydown', { key: 'Enter', ctrlKey: true }); .simulate('keydown', { key: 'Enter', ctrlKey: true });
assert.calledOnce(fakeAnnotationsService.save); assert.calledOnce(fakeAnnotationsService.save);
...@@ -216,7 +218,7 @@ describe('AnnotationEditor', () => { ...@@ -216,7 +218,7 @@ describe('AnnotationEditor', () => {
const wrapper = createComponent({ draft }); const wrapper = createComponent({ draft });
wrapper wrapper
.find('.AnnotationEditor') .find(editorSelector)
.simulate('keydown', { key: 'Enter', metaKey: true }); .simulate('keydown', { key: 'Enter', metaKey: true });
assert.calledOnce(fakeAnnotationsService.save); assert.calledOnce(fakeAnnotationsService.save);
...@@ -230,7 +232,7 @@ describe('AnnotationEditor', () => { ...@@ -230,7 +232,7 @@ describe('AnnotationEditor', () => {
const wrapper = createComponent(); const wrapper = createComponent();
wrapper wrapper
.find('.AnnotationEditor') .find(editorSelector)
.simulate('keydown', { key: 'Enter', metaKey: true }); .simulate('keydown', { key: 'Enter', metaKey: true });
assert.notCalled(fakeAnnotationsService.save); assert.notCalled(fakeAnnotationsService.save);
......
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