Commit bd5b2de0 authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Remove createElement imports and substitute Fragments

parent 369a8d5d
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { useRef } from 'preact/hooks'; import { useRef } from 'preact/hooks';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement } from 'preact';
import { useLayoutEffect, useRef } from 'preact/hooks'; import { useLayoutEffect, useRef } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { createElement, render } from 'preact'; import { render } from 'preact';
import { SvgIcon, availableIcons, registerIcons } from '../svg-icon'; import { SvgIcon, availableIcons, registerIcons } from '../svg-icon';
......
import { createElement, render } from 'preact'; import { render } from 'preact';
import AdderToolbar from './components/adder-toolbar'; import AdderToolbar from './components/adder-toolbar';
import { isTouchDevice } from '../shared/user-agent'; import { isTouchDevice } from '../shared/user-agent';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useShortcut } from '../../shared/shortcut'; import { useShortcut } from '../../shared/shortcut';
......
import { createElement } from 'preact';
import classnames from 'classnames'; import classnames from 'classnames';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import scrollIntoView from 'scroll-into-view'; import scrollIntoView from 'scroll-into-view';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { checkAccessibility } from '../../../test-util/accessibility'; import { checkAccessibility } from '../../../test-util/accessibility';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import Toolbar from '../toolbar'; import Toolbar from '../toolbar';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { createElement } from 'preact';
/** /**
* @param {Object} props * @param {Object} props
......
import Delegator from '../delegator'; import Delegator from '../delegator';
import { createElement, render } from 'preact'; import { render } from 'preact';
import Buckets from '../components/buckets'; import Buckets from '../components/buckets';
import { anchorBuckets } from '../util/buckets'; import { anchorBuckets } from '../util/buckets';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import debounce from 'lodash.debounce'; import debounce from 'lodash.debounce';
import { Fragment, createElement, render } from 'preact'; import { render } from 'preact';
import * as pdfAnchoring from '../anchoring/pdf'; import * as pdfAnchoring from '../anchoring/pdf';
import Delegator from '../delegator'; import Delegator from '../delegator';
...@@ -20,7 +20,7 @@ import PDFMetadata from './pdf-metadata'; ...@@ -20,7 +20,7 @@ import PDFMetadata from './pdf-metadata';
*/ */
function WarningBanner() { function WarningBanner() {
return ( return (
<Fragment> <>
<div className="annotator-pdf-warning-banner__type"> <div className="annotator-pdf-warning-banner__type">
<SvgIcon <SvgIcon
name="caution" name="caution"
...@@ -38,7 +38,7 @@ function WarningBanner() { ...@@ -38,7 +38,7 @@ function WarningBanner() {
</a>{' '} </a>{' '}
in order to annotate with Hypothesis. in order to annotate with Hypothesis.
</div> </div>
</Fragment> </>
); );
} }
......
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
import { createElement } from 'preact';
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { import {
......
import { createElement, render } from 'preact'; import { render } from 'preact';
import { import {
getBoundingClientRect, getBoundingClientRect,
......
import { createElement, createRef, render } from 'preact'; import { createRef, render } from 'preact';
import Toolbar from './components/toolbar'; import Toolbar from './components/toolbar';
......
import { createElement } from 'preact'; import { createElement } from 'preact';
import { setupBrowserFixes } from '../renderer-options'; import { setupBrowserFixes } from '../renderer-options';
describe('shared/renderer-options', () => { describe('shared/renderer-options', () => {
......
import { createElement, render } from 'preact'; import { render } from 'preact';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
import { matchShortcut, installShortcut, useShortcut } from '../shortcut'; import { matchShortcut, installShortcut, useShortcut } from '../shortcut';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import { createElement } from 'preact';
import { useState } from 'preact/hooks'; import { useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import * as annotationMetadata from '../helpers/annotation-metadata'; import * as annotationMetadata from '../helpers/annotation-metadata';
......
import { normalizeKeyName } from '@hypothesis/frontend-shared'; import { normalizeKeyName } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import { useState } from 'preact/hooks'; import { useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import { useMemo } from 'preact/hooks'; import { useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
/** /**
* Render information about CC licensing * Render information about CC licensing
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import AnnotationReplyToggle from './AnnotationReplyToggle'; import AnnotationReplyToggle from './AnnotationReplyToggle';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { isOrphan, quote } from '../helpers/annotation-metadata'; import { isOrphan, quote } from '../helpers/annotation-metadata';
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import Button from './Button'; import Button from './Button';
......
import { SvgIcon, useElementShouldClose } from '@hypothesis/frontend-shared'; import { SvgIcon, useElementShouldClose } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import { useEffect, useRef, useState } from 'preact/hooks'; import { useEffect, useRef, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import { createElement } from 'preact';
import { useEffect, useMemo, useState } from 'preact/hooks'; import { useEffect, useMemo, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { isThirdPartyUser, username } from '../helpers/account-id'; import { isThirdPartyUser, username } from '../helpers/account-id';
......
import { Fragment, createElement } from 'preact';
import { useEffect, useState } from 'preact/hooks'; import { useEffect, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
...@@ -82,7 +81,7 @@ function AnnotationView({ loadAnnotationsService, onLogin }) { ...@@ -82,7 +81,7 @@ function AnnotationView({ loadAnnotationsService, onLogin }) {
]); ]);
return ( return (
<Fragment> <>
{fetchError && ( {fetchError && (
// This is the same error shown if a direct-linked annotation cannot // This is the same error shown if a direct-linked annotation cannot
// be fetched in the sidebar. Fortunately the error message makes sense // be fetched in the sidebar. Fortunately the error message makes sense
...@@ -90,7 +89,7 @@ function AnnotationView({ loadAnnotationsService, onLogin }) { ...@@ -90,7 +89,7 @@ function AnnotationView({ loadAnnotationsService, onLogin }) {
<SidebarContentError errorType="annotation" onLoginRequest={onLogin} /> <SidebarContentError errorType="annotation" onLoginRequest={onLogin} />
)} )}
<ThreadList thread={rootThread} /> <ThreadList thread={rootThread} />
</Fragment> </>
); );
} }
......
import { createElement } from 'preact';
import classnames from 'classnames'; import classnames from 'classnames';
import { useMemo } from 'preact/hooks'; import { useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
/** /**
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement } from 'preact';
import { useCallback, useLayoutEffect, useRef, useState } from 'preact/hooks'; import { useCallback, useLayoutEffect, useRef, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import Menu from './Menu'; import Menu from './Menu';
......
import { createElement } from 'preact';
import { useMemo } from 'preact/hooks'; import { useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { createElement } from 'preact';
import { useMemo, useState } from 'preact/hooks'; import { useMemo, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { Fragment, createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
...@@ -105,7 +104,7 @@ function GroupListItem({ ...@@ -105,7 +104,7 @@ function GroupListItem({
onClick={isSelectable ? focusGroup : toggleSubmenu} onClick={isSelectable ? focusGroup : toggleSubmenu}
onToggleSubmenu={toggleSubmenu} onToggleSubmenu={toggleSubmenu}
submenu={ submenu={
<Fragment> <>
<ul> <ul>
{activityUrl && ( {activityUrl && (
<li> <li>
...@@ -143,7 +142,7 @@ function GroupListItem({ ...@@ -143,7 +142,7 @@ function GroupListItem({
This group is restricted to specific URLs. This group is restricted to specific URLs.
</p> </p>
)} )}
</Fragment> </>
} }
/> />
); );
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import GroupListItem from './GroupListItem'; import GroupListItem from './GroupListItem';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import { useCallback, useMemo, useState } from 'preact/hooks'; import { useCallback, useMemo, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement } from 'preact';
import { useEffect, useMemo } from 'preact/hooks'; import { useEffect, useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { withServices } from '../service-context'; import { withServices } from '../service-context';
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { SvgIcon, normalizeKeyName } from '@hypothesis/frontend-shared'; import { SvgIcon, normalizeKeyName } from '@hypothesis/frontend-shared';
import { createElement, createRef } from 'preact'; import { createRef } from 'preact';
import { useEffect, useMemo, useRef, useState } from 'preact/hooks'; import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement } from 'preact';
import { useEffect, useMemo, useRef } from 'preact/hooks'; import { useEffect, useMemo, useRef } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
...@@ -4,7 +4,6 @@ import { ...@@ -4,7 +4,6 @@ import {
normalizeKeyName, normalizeKeyName,
useElementShouldClose, useElementShouldClose,
} from '@hypothesis/frontend-shared'; } from '@hypothesis/frontend-shared';
import { Fragment, createElement } from 'preact';
import { useCallback, useEffect, useRef, useState } from 'preact/hooks'; import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
...@@ -186,7 +185,7 @@ export default function Menu({ ...@@ -186,7 +185,7 @@ export default function Menu({
</span> </span>
</button> </button>
{isOpen && ( {isOpen && (
<Fragment> <>
{menuArrow(arrowClass)} {menuArrow(arrowClass)}
<div <div
className={classnames( className={classnames(
...@@ -203,7 +202,7 @@ export default function Menu({ ...@@ -203,7 +202,7 @@ export default function Menu({
{children} {children}
</MenuKeyboardNavigation> </MenuKeyboardNavigation>
</div> </div>
</Fragment> </>
)} )}
</div> </div>
); );
......
import classnames from 'classnames'; import classnames from 'classnames';
import { SvgIcon, normalizeKeyName } from '@hypothesis/frontend-shared'; import { SvgIcon, normalizeKeyName } from '@hypothesis/frontend-shared';
import { Fragment, createElement } from 'preact';
import { useEffect, useRef } from 'preact/hooks'; import { useEffect, useRef } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
...@@ -215,7 +214,7 @@ export default function MenuItem({ ...@@ -215,7 +214,7 @@ export default function MenuItem({
); );
} }
return ( return (
<Fragment> <>
{menuItem} {menuItem}
{hasSubmenuVisible && ( {hasSubmenuVisible && (
<Slider visible={/** @type {boolean} */ (isSubmenuVisible)}> <Slider visible={/** @type {boolean} */ (isSubmenuVisible)}>
...@@ -228,7 +227,7 @@ export default function MenuItem({ ...@@ -228,7 +227,7 @@ export default function MenuItem({
</MenuKeyboardNavigation> </MenuKeyboardNavigation>
</Slider> </Slider>
)} )}
</Fragment> </>
); );
} }
......
import { normalizeKeyName } from '@hypothesis/frontend-shared'; import { normalizeKeyName } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import { useEffect, useRef } from 'preact/hooks'; import { useEffect, useRef } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { Fragment, createElement, toChildArray } from 'preact'; import { toChildArray } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
/** @typedef {import("preact").JSX.Element} JSXElement */ /** @typedef {import("preact").JSX.Element} JSXElement */
...@@ -28,14 +28,14 @@ import propTypes from 'prop-types'; ...@@ -28,14 +28,14 @@ import propTypes from 'prop-types';
*/ */
export default function MenuSection({ heading, children }) { export default function MenuSection({ heading, children }) {
return ( return (
<Fragment> <>
{heading && <h2 className="MenuSection__heading">{heading}</h2>} {heading && <h2 className="MenuSection__heading">{heading}</h2>}
<ul className="MenuSection__content"> <ul className="MenuSection__content">
{toChildArray(children).map(child => ( {toChildArray(children).map(child => (
<li key={/** @type {JSXElement} **/ (child).key}>{child}</li> <li key={/** @type {JSXElement} **/ (child).key}>{child}</li>
))} ))}
</ul> </ul>
</Fragment> </>
); );
} }
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import { createElement } from 'preact';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { useUserFilterOptions } from './hooks/use-filter-options'; import { useUserFilterOptions } from './hooks/use-filter-options';
......
import { createElement } from 'preact';
import useRootThread from './hooks/use-root-thread'; import useRootThread from './hooks/use-root-thread';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { countVisible } from '../helpers/thread'; import { countVisible } from '../helpers/thread';
......
import { createElement } from 'preact';
import { useEffect } from 'preact/hooks'; import { useEffect } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement } from 'preact';
import { useRef, useState } from 'preact/hooks'; import { useRef, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import { createElement, Fragment } from 'preact';
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
...@@ -62,7 +61,7 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) { ...@@ -62,7 +61,7 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) {
{sharingReady && ( {sharingReady && (
<div className="ShareAnnotationsPanel"> <div className="ShareAnnotationsPanel">
{shareURI ? ( {shareURI ? (
<Fragment> <>
<div className="ShareAnnotationsPanel__intro"> <div className="ShareAnnotationsPanel__intro">
{notNull(focusedGroup).type === 'private' ? ( {notNull(focusedGroup).type === 'private' ? (
<p> <p>
...@@ -111,7 +110,7 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) { ...@@ -111,7 +110,7 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) {
shareURI={shareURI} shareURI={shareURI}
analyticsEventName={analytics.events.DOCUMENT_SHARED} analyticsEventName={analytics.events.DOCUMENT_SHARED}
/> />
</Fragment> </>
) : ( ) : (
<p> <p>
These annotations cannot be shared because this document is not These annotations cannot be shared because this document is not
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { withServices } from '../service-context'; import { withServices } from '../service-context';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import classnames from 'classnames'; import classnames from 'classnames';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import { useEffect, useRef } from 'preact/hooks'; import { useEffect, useRef } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import scrollIntoView from 'scroll-into-view'; import scrollIntoView from 'scroll-into-view';
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useEffect, useRef } from 'preact/hooks'; import { useEffect, useRef } from 'preact/hooks';
......
import { createElement } from 'preact';
import { useCallback, useEffect, useRef, useState } from 'preact/hooks'; import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import { createElement } from 'preact';
/** /**
* Loading indicator. * Loading indicator.
*/ */
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import { createElement } from 'preact';
import { useCallback, useEffect } from 'preact/hooks'; import { useCallback, useEffect } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
...@@ -3,7 +3,6 @@ import { ...@@ -3,7 +3,6 @@ import {
normalizeKeyName, normalizeKeyName,
useElementShouldClose, useElementShouldClose,
} from '@hypothesis/frontend-shared'; } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import { useRef, useState } from 'preact/hooks'; import { useRef, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { createElement } from 'preact';
import { useMemo } from 'preact/hooks'; import { useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { createElement, Fragment } from 'preact';
import { useCallback, useMemo } from 'preact/hooks'; import { useCallback, useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
...@@ -64,7 +63,7 @@ function Thread({ showDocumentInfo = false, thread, threadsService }) { ...@@ -64,7 +63,7 @@ function Thread({ showDocumentInfo = false, thread, threadsService }) {
const annotationContent = useMemo(() => { const annotationContent = useMemo(() => {
if (showAnnotation) { if (showAnnotation) {
return ( return (
<Fragment> <>
<ModerationBanner annotation={thread.annotation} /> <ModerationBanner annotation={thread.annotation} />
<Annotation <Annotation
annotation={thread.annotation} annotation={thread.annotation}
...@@ -75,7 +74,7 @@ function Thread({ showDocumentInfo = false, thread, threadsService }) { ...@@ -75,7 +74,7 @@ function Thread({ showDocumentInfo = false, thread, threadsService }) {
showDocumentInfo={showDocumentInfo} showDocumentInfo={showDocumentInfo}
threadIsCollapsed={thread.collapsed} threadIsCollapsed={thread.collapsed}
/> />
</Fragment> </>
); );
} else if (showMissingAnnotation) { } else if (showMissingAnnotation) {
return ( return (
......
import classnames from 'classnames'; import classnames from 'classnames';
import debounce from 'lodash.debounce'; import debounce from 'lodash.debounce';
import { createElement } from 'preact';
import { useCallback, useMemo } from 'preact/hooks'; import { useCallback, useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
......
import { createElement } from 'preact';
import { useEffect, useLayoutEffect, useMemo, useState } from 'preact/hooks'; import { useEffect, useLayoutEffect, useMemo, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import debounce from 'lodash.debounce'; import debounce from 'lodash.debounce';
......
import classnames from 'classnames'; import classnames from 'classnames';
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
......
import { Fragment, createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import bridgeEvents from '../../shared/bridge-events'; import bridgeEvents from '../../shared/bridge-events';
...@@ -79,7 +78,7 @@ function TopBar({ ...@@ -79,7 +78,7 @@ function TopBar({
}; };
const loginControl = ( const loginControl = (
<Fragment> <>
{auth.status === 'unknown' && ( {auth.status === 'unknown' && (
<span className="TopBar__login-links"></span> <span className="TopBar__login-links"></span>
)} )}
...@@ -103,7 +102,7 @@ function TopBar({ ...@@ -103,7 +102,7 @@ function TopBar({
{auth.status === 'logged-in' && ( {auth.status === 'logged-in' && (
<UserMenu auth={auth} onLogout={onLogout} /> <UserMenu auth={auth} onLogout={onLogout} />
)} )}
</Fragment> </>
); );
return ( return (
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import isThirdPartyService from '../helpers/is-third-party-service'; import isThirdPartyService from '../helpers/is-third-party-service';
......
import { SvgIcon } from '@hypothesis/frontend-shared'; import { SvgIcon } from '@hypothesis/frontend-shared';
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import bridgeEvents from '../../shared/bridge-events'; import bridgeEvents from '../../shared/bridge-events';
......
import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { copyText } from '../util/copy-to-clipboard'; import { copyText } from '../util/copy-to-clipboard';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { useUserFilterOptions } from '../use-filter-options'; import { useUserFilterOptions } from '../use-filter-options';
import { $imports } from '../use-filter-options'; import { $imports } from '../use-filter-options';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import useRootThread from '../use-root-thread'; import useRootThread from '../use-root-thread';
import { $imports } from '../use-root-thread'; import { $imports } from '../use-root-thread';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import * as fixtures from '../../test/annotation-fixtures'; import * as fixtures from '../../test/annotation-fixtures';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
import AnnotationActionBar from '../AnnotationActionBar'; import AnnotationActionBar from '../AnnotationActionBar';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
import * as fixtures from '../../test/annotation-fixtures'; import * as fixtures from '../../test/annotation-fixtures';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import * as fixtures from '../../test/annotation-fixtures'; import * as fixtures from '../../test/annotation-fixtures';
import AnnotationDocumentInfo from '../AnnotationDocumentInfo'; import AnnotationDocumentInfo from '../AnnotationDocumentInfo';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
import * as fixtures from '../../test/annotation-fixtures'; import * as fixtures from '../../test/annotation-fixtures';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import * as fixtures from '../../test/annotation-fixtures'; import * as fixtures from '../../test/annotation-fixtures';
import AnnotationHeader from '../AnnotationHeader'; import AnnotationHeader from '../AnnotationHeader';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import AnnotationMissing, { $imports } from '../AnnotationMissing'; import AnnotationMissing, { $imports } from '../AnnotationMissing';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import * as fixtures from '../../test/annotation-fixtures'; import * as fixtures from '../../test/annotation-fixtures';
import AnnotationPublishControl from '../AnnotationPublishControl'; import AnnotationPublishControl from '../AnnotationPublishControl';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import AnnotationQuote from '../AnnotationQuote'; import AnnotationQuote from '../AnnotationQuote';
import { $imports } from '../AnnotationQuote'; import { $imports } from '../AnnotationQuote';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
import AnnotationReplyToggle from '../AnnotationReplyToggle'; import AnnotationReplyToggle from '../AnnotationReplyToggle';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
import AnnotationShareControl from '../AnnotationShareControl'; import AnnotationShareControl from '../AnnotationShareControl';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import * as fixtures from '../../test/annotation-fixtures'; import * as fixtures from '../../test/annotation-fixtures';
import AnnotationShareInfo from '../AnnotationShareInfo'; import AnnotationShareInfo from '../AnnotationShareInfo';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import * as fixtures from '../../test/annotation-fixtures'; import * as fixtures from '../../test/annotation-fixtures';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import AnnotationUser from '../AnnotationUser'; import AnnotationUser from '../AnnotationUser';
import { $imports } from '../AnnotationUser'; import { $imports } from '../AnnotationUser';
......
import { createElement } from 'preact';
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { waitFor } from '../../../test-util/wait'; import { waitFor } from '../../../test-util/wait';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import AutocompleteList from '../AutocompleteList'; import AutocompleteList from '../AutocompleteList';
import { $imports } from '../AutocompleteList'; import { $imports } from '../AutocompleteList';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import Button from '../Button'; import Button from '../Button';
import { $imports } from '../Button'; import { $imports } from '../Button';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
import Excerpt from '../Excerpt'; import Excerpt from '../Excerpt';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import FilterSelect from '../FilterSelect'; import FilterSelect from '../FilterSelect';
import { $imports } from '../FilterSelect'; import { $imports } from '../FilterSelect';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import FilterStatus, { $imports } from '../FilterStatus'; import FilterStatus, { $imports } from '../FilterStatus';
......
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact';
import { act } from 'preact/test-utils'; import { act } from 'preact/test-utils';
import GroupList from '../GroupList'; import GroupList from '../GroupList';
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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