Commit b8551fbc authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Extract `LoadingSpinner`

Unmock in `ShareDialog` tests for the moment as this is a very simple
component.
parent d09ca722
import { Spinner } from '@hypothesis/frontend-shared';
/**
* Render a consistently sized and positioned loading spinner for dialog or
* tab content
*/
export default function LoadingSpinner() {
return (
<div
className="flex flex-row items-center justify-center"
data-testid="loading-spinner"
>
<Spinner size="md" />
</div>
);
}
......@@ -9,7 +9,6 @@ import {
Input,
InputGroup,
LockIcon,
Spinner,
TabList,
Tab,
} from '@hypothesis/frontend-shared';
......@@ -24,17 +23,7 @@ import { useSidebarStore } from '../../store';
import { copyText } from '../../util/copy-to-clipboard';
import ShareLinks from '../ShareLinks';
import SidebarPanel from '../SidebarPanel';
function LoadingSpinner() {
return (
<div
className="flex flex-row items-center justify-center"
data-testid="loading-spinner"
>
<Spinner size="md" />
</div>
);
}
import LoadingSpinner from './LoadingSpinner';
/**
* Render a header to go above a Card, with contents in a TabList
......
......@@ -45,6 +45,8 @@ describe('ShareDialog', () => {
};
$imports.$mock(mockImportedComponents());
// Don't mock this very simple component
$imports.$restore({ './LoadingSpinner': true });
$imports.$mock({
'../../store': { useSidebarStore: () => fakeStore },
'../../helpers/annotation-sharing': {
......
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