{canAnnotateAndDelete && (
-
+
)}
{canComment && (
-
+
)}
@@ -52,7 +52,7 @@ const HighlightControls = ({
HighlightControls.defaultProps = {
canAnnotateAndDelete: false,
- isPending: false
+ isPending: false,
};
export default HighlightControls;
diff --git a/src/components/ActionControls/HighlightControls.scss b/src/components/ActionControls/HighlightControls.scss
index 297b1135b..16f490014 100644
--- a/src/components/ActionControls/HighlightControls.scss
+++ b/src/components/ActionControls/HighlightControls.scss
@@ -1,4 +1,4 @@
-@import '../../variables';
+@import "../../variables";
.ba {
.ba-action-controls-highlight {
@@ -45,15 +45,15 @@
// MOBILE & TABLET CSS
@media #{$mobile}, #{$tablet} {
.ba-inline-popover .ba-action-controls-highlight {
- background: white;
- border-top: 1px solid $seesee;
+ position: fixed;
bottom: 0;
- box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .1);
left: 0;
+ width: 100%;
margin: 0;
padding: 15px;
- position: fixed;
- width: 100%;
+ background: white;
+ border-top: 1px solid $seesee;
+ box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .1);
}
.ba-action-controls-highlight .btn-plain,
diff --git a/src/components/ActionControls/__tests__/ActionControls-test.js b/src/components/ActionControls/__tests__/ActionControls-test.js
index 08e0d062f..1ff94ee8a 100644
--- a/src/components/ActionControls/__tests__/ActionControls-test.js
+++ b/src/components/ActionControls/__tests__/ActionControls-test.js
@@ -10,22 +10,22 @@ const onDelete = jest.fn();
const event = {
stopPropagation: jest.fn(),
- preventDefault: jest.fn()
+ preventDefault: jest.fn(),
};
describe('components/ActionControls', () => {
const render = (props = {}) =>
shallow(
+ />,
);
test('should render no controls if the type does not match a valid type', () => {
diff --git a/src/components/ActionControls/__tests__/DrawingControls-test.js b/src/components/ActionControls/__tests__/DrawingControls-test.js
index 3df58993c..e1b198427 100644
--- a/src/components/ActionControls/__tests__/DrawingControls-test.js
+++ b/src/components/ActionControls/__tests__/DrawingControls-test.js
@@ -7,12 +7,12 @@ const onDelete = jest.fn();
describe('components/ActionControls/DrawingControls', () => {
test('should correctly render pending drawing controls', () => {
- const wrapper = shallow();
+ const wrapper = shallow();
expect(wrapper).toMatchSnapshot();
});
test('should correctly render saved drawing controls', () => {
- const wrapper = shallow();
+ const wrapper = shallow();
expect(wrapper).toMatchSnapshot();
});
});
diff --git a/src/components/ActionControls/__tests__/HighlightControls-test.js b/src/components/ActionControls/__tests__/HighlightControls-test.js
index 485bc0dc6..9bfadb9cf 100644
--- a/src/components/ActionControls/__tests__/HighlightControls-test.js
+++ b/src/components/ActionControls/__tests__/HighlightControls-test.js
@@ -8,13 +8,13 @@ const onCommentClick = jest.fn();
describe('components/ActionControls/HighlightControls', () => {
const render = (props = {}) =>
- shallow();
+ shallow();
test('should correctly render pending plain highlight controls', () => {
const wrapper = render({
canAnnotateAndDelete: true,
canComment: false,
- isPending: true
+ isPending: true,
});
expect(wrapper).toMatchSnapshot();
});
@@ -23,7 +23,7 @@ describe('components/ActionControls/HighlightControls', () => {
const wrapper = render({
canAnnotateAndDelete: true,
canComment: true,
- isPending: true
+ isPending: true,
});
expect(wrapper).toMatchSnapshot();
});
@@ -31,7 +31,7 @@ describe('components/ActionControls/HighlightControls', () => {
test('should correctly render saved plain highlight controls', () => {
const wrapper = render({
canAnnotateAndDelete: true,
- canComment: false
+ canComment: false,
});
expect(wrapper).toMatchSnapshot();
expect(wrapper.find('.ba-saved-highlight').length).toEqual(1);
@@ -40,7 +40,7 @@ describe('components/ActionControls/HighlightControls', () => {
test('should correctly render saved highlight comment controls', () => {
const wrapper = render({
canAnnotateAndDelete: true,
- canComment: true
+ canComment: true,
});
expect(wrapper).toMatchSnapshot();
expect(wrapper.find('.ba-saved-highlight').length).toEqual(1);
diff --git a/src/components/AnnotationPopover/AnnotationPopover.js b/src/components/AnnotationPopover/AnnotationPopover.js
index a262d188b..c67eb0817 100644
--- a/src/components/AnnotationPopover/AnnotationPopover.js
+++ b/src/components/AnnotationPopover/AnnotationPopover.js
@@ -24,17 +24,17 @@ const CLASS_MOBILE_CLOSE_BTN = 'ba-mobile-close-btn';
const CLASS_POPOVER_OVERLAY = 'ba-popover-overlay';
type Props = {
- isMobile: boolean,
canComment: boolean,
- position: Function,
- onDelete: Function,
- onCancel: Function,
- onCreate: Function,
- onCommentClick: Function,
+ headerHeight?: number,
+ isMobile: boolean,
isPending: boolean,
language?: string,
messages?: StringMap,
- headerHeight?: number
+ onCancel: Function,
+ onCommentClick: Function,
+ onCreate: Function,
+ onDelete: Function,
+ position: Function,
} & Annotation;
class AnnotationPopover extends React.PureComponent {
@@ -47,7 +47,7 @@ class AnnotationPopover extends React.PureComponent {
onCommentClick: noop,
onDelete: noop,
onCreate: noop,
- comments: []
+ comments: [],
};
componentDidMount() {
@@ -78,7 +78,7 @@ class AnnotationPopover extends React.PureComponent {
onCommentClick,
language,
messages: intlMessages,
- headerHeight
+ headerHeight,
} = this.props;
const hasComments = comments.length > 0;
const isInline = !hasComments && (type === TYPES.highlight || type === TYPES.draw);
@@ -87,8 +87,8 @@ class AnnotationPopover extends React.PureComponent {
description: ,
key: 'esc',
handler: onCancel,
- type: 'Close'
- })
+ type: 'Close',
+ }),
];
return (
@@ -98,7 +98,7 @@ class AnnotationPopover extends React.PureComponent {
className={classNames(CLASS_ANNOTATION_POPOVER, {
[CLASS_INLINE_POPOVER]: isInline,
[CLASS_ANIMATE_POPOVER]: isMobile,
- [CLASS_CREATE_POPOVER]: isPending
+ [CLASS_CREATE_POPOVER]: isPending,
})}
>
{isMobile ? (
@@ -114,22 +114,22 @@ class AnnotationPopover extends React.PureComponent {
{hasComments ? (
) : (
-
+
)}
{canAnnotate && (
)}
diff --git a/src/components/AnnotationPopover/AnnotationPopover.scss b/src/components/AnnotationPopover/AnnotationPopover.scss
index 4bc582774..3f24b0cd0 100644
--- a/src/components/AnnotationPopover/AnnotationPopover.scss
+++ b/src/components/AnnotationPopover/AnnotationPopover.scss
@@ -1,59 +1,59 @@
-@import '../../variables';
+@import "../../variables";
.ba {
.ba-popover {
- cursor: auto; // Overrides cursor: none from annotation mode
- max-width: 282px;
position: absolute;
z-index: 3;
+ max-width: 282px;
+ cursor: auto; // Overrides cursor: none from annotation mode
}
.ba-popover-caret {
- left: 50%;
position: absolute;
+ left: 50%;
z-index: 3;
// CSS arrow for caret above container
&::after,
&::before {
- border: solid transparent;
- content: ' ';
- height: 0;
- left: 50%;
- pointer-events: none;
position: absolute;
top: 0;
- transform: rotate(-225deg);
+ left: 50%;
width: 0;
+ height: 0;
+ border: solid transparent;
+ transform: rotate(-225deg);
+ content: " ";
+ pointer-events: none;
}
&::after {
+ margin: -4px 0 0 -6px;
border-color: transparent transparent $white $white;
border-width: 6px;
- margin: -4px 0 0 -6px;
}
&::before {
+ margin: -5px 0 0 -6px;
border-color: transparent transparent $sf-fog $sf-fog;
border-width: 6px;
- margin: -5px 0 0 -6px;
}
}
.ba-popover-overlay {
- background: white;
- border: 1px solid $seesee;
- border-radius: 4px;
display: block;
+ padding: 10px;
overflow-x: hidden;
overflow-y: auto;
- padding: 10px;
white-space: normal;
+ background: white;
+ border: 1px solid $seesee;
+ border-radius: 4px;
}
.ba-inline-popover .ba-popover-overlay {
- align-items: center;
display: inline-flex;
+ align-items: center;
padding: 0;
}
@@ -95,39 +95,39 @@
@media #{$mobile}, #{$tablet} {
// SAVED ANNOTATION POPOVER CSS
.ba-popover {
+ top: 0;
display: flex;
flex-direction: column;
- height: 100%;
justify-content: flex-start;
- max-width: unset;
- top: 0;
width: 100%;
+ max-width: unset;
+ height: 100%;
}
.ba-mobile-header {
- background: white;
- border-bottom: 1px solid #ccc;
display: flex;
justify-content: flex-end;
- padding-right: 5px;
width: 100%;
+ padding-right: 5px;
+ background: white;
+ border-bottom: 1px solid #ccc;
}
.ba-popover-overlay {
- background: white;
display: flex;
flex-direction: column;
height: 100%;
+ background: white;
}
.ba-popover .ba-popover-overlay {
- border: none;
- box-shadow: unset;
display: flex;
flex-direction: column;
height: 100%;
- overflow: unset;
padding: 0;
+ overflow: unset;
+ border: none;
+ box-shadow: unset;
}
// INLINE ANNOTATION POPOVER CSS
@@ -136,19 +136,19 @@
}
.ba-inline-popover .ba-popover-overlay {
- background: transparent;
- border-bottom: 1px solid $seesee;
- box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .1);
height: auto;
margin: 0;
text-align: center;
+ background: transparent;
+ border-bottom: 1px solid $seesee;
+ box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .1);
}
.ba-inline-popover.ba-create-popover .ba-popover-overlay {
- border: none;
- box-shadow: none;
display: flex;
flex-direction: column;
+ border: none;
+ box-shadow: none;
}
.ba-inline-popover .ba-mobile-header,
@@ -158,33 +158,33 @@
.ba-create-popover .ba-popover-overlay,
.ba-inline-popover .ba-popover-overlay {
- background: transparent;
height: auto;
+ background: transparent;
}
// UNSAVED/CREATE ANNOTATION POPOVER CSS
.ba-create-popover {
+ top: auto;
bottom: 0;
height: auto;
- top: auto;
}
.ba-create-popover .ba-popover-overlay {
- background: transparent;
- border-radius: 0;
- height: auto;
justify-content: flex-end;
+ height: auto;
padding: 0;
+ background: transparent;
+ border-radius: 0;
}
}
// TABLET-SPECIFIC CSS
@media #{$tablet} {
.ba-popover {
- border-left: 1px solid $seesee;
+ right: 0;
// Max width matches the max-width of the Preview Sidebar
max-width: 341px;
- right: 0;
+ border-left: 1px solid $seesee;
}
.ba-create-popover .ba-mobile-header {
@@ -192,8 +192,8 @@
}
.ba-popover.ba-inline-popover {
- border: none;
width: 100%;
+ border: none;
}
.ba-inline-popover .ba-mobile-header {
@@ -202,14 +202,14 @@
.ba-create-popover,
.ba-create-popover .ba-popover-overlay {
- background: white;
height: 100%;
+ background: white;
}
.ba-inline-popover.ba-create-popover,
.ba-inline-popover.ba-create-popover .ba-popover-overlay {
- background: transparent;
height: auto;
+ background: transparent;
}
}
}
diff --git a/src/components/AnnotationPopover/AnnotatorLabel.js b/src/components/AnnotationPopover/AnnotatorLabel.js
index 9c6e53e81..ff05433ae 100644
--- a/src/components/AnnotationPopover/AnnotatorLabel.js
+++ b/src/components/AnnotationPopover/AnnotatorLabel.js
@@ -13,11 +13,11 @@ import './AnnotatorLabel.scss';
const CLASS_ANNOTATOR_LABEL = 'ba-annotator-label';
type Props = {
- id?: string,
- type: AnnotationType,
createdBy: ?User,
+ id?: string,
+ intl: any,
isPending: boolean,
- intl: any
+ type: AnnotationType,
};
const AnnotatorLabel = ({ id, isPending, type, createdBy, intl }: Props) => {
diff --git a/src/components/AnnotationPopover/AnnotatorLabel.scss b/src/components/AnnotationPopover/AnnotatorLabel.scss
index f95d3b49b..dea9f3230 100644
--- a/src/components/AnnotationPopover/AnnotatorLabel.scss
+++ b/src/components/AnnotationPopover/AnnotatorLabel.scss
@@ -1,24 +1,24 @@
-@import '../../variables';
+@import "../../variables";
.ba {
.ba-annotator-label {
- border-right: 1px solid $see-see;
margin: 10px 0 10px 10px;
padding-right: 10px;
+ border-right: 1px solid $see-see;
}
// MOBILE & TABLET CSS
@media #{$mobile}, #{$tablet} {
.ba-annotator-label {
- background: white;
- border-bottom: 1px solid #ccc;
- display: flex;
- justify-content: center;
- left: 0;
- padding: 20px;
position: fixed;
top: 0;
+ left: 0;
+ display: flex;
+ justify-content: center;
width: 100%;
+ padding: 20px;
+ background: white;
+ border-bottom: 1px solid #ccc;
}
}
}
diff --git a/src/components/AnnotationPopover/__tests__/AnnotationPopover-test.js b/src/components/AnnotationPopover/__tests__/AnnotationPopover-test.js
index ca3bb76d0..72beb9506 100644
--- a/src/components/AnnotationPopover/__tests__/AnnotationPopover-test.js
+++ b/src/components/AnnotationPopover/__tests__/AnnotationPopover-test.js
@@ -13,7 +13,7 @@ const USER = {
type: 'user',
id: '789ghi',
name: 'Mia Thermopolis',
- email: 'princess@genovia.gov'
+ email: 'princess@genovia.gov',
};
const comments = [
@@ -22,15 +22,15 @@ const comments = [
createdAt: TIME_STRING_SEPT_27_2017,
createdBy: USER,
message: 'test',
- permissions: {}
+ permissions: {},
},
{
id: '456',
createdAt: TIME_STRING_SEPT_27_2017,
createdBy: USER,
message: 'test',
- permissions: {}
- }
+ permissions: {},
+ },
];
describe('components/AnnotationPopover', () => {
@@ -39,12 +39,12 @@ describe('components/AnnotationPopover', () => {