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