Commit 241a3053 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Convert `ShareAnnotationsPanel` to tailwind

This component needed some adjustment after a CSS reset was applied, so
it has been converted to Tailwind.
parent d20cb855
...@@ -56,15 +56,18 @@ function ShareAnnotationsPanel({ toastMessenger }) { ...@@ -56,15 +56,18 @@ function ShareAnnotationsPanel({ toastMessenger }) {
return ( return (
<SidebarPanel title={panelTitle} panelName="shareGroupAnnotations"> <SidebarPanel title={panelTitle} panelName="shareGroupAnnotations">
{!sharingReady && ( {!sharingReady && (
<div className="hyp-u-layout-row--center"> <div className="flex flex-row items-center justify-center">
<Spinner /> <Spinner />
</div> </div>
)} )}
{sharingReady && ( {sharingReady && (
<div className="ShareAnnotationsPanel"> <div className="text-color-text-light space-y-3">
{shareURI ? ( {shareURI ? (
<> <>
<div className="ShareAnnotationsPanel__intro"> <div
className="text-color-text font-medium"
data-testid="sharing-intro"
>
{notNull(focusedGroup).type === 'private' ? ( {notNull(focusedGroup).type === 'private' ? (
<p> <p>
Use this link to share these annotations with other group Use this link to share these annotations with other group
...@@ -74,7 +77,7 @@ function ShareAnnotationsPanel({ toastMessenger }) { ...@@ -74,7 +77,7 @@ function ShareAnnotationsPanel({ toastMessenger }) {
<p>Use this link to share these annotations with anyone:</p> <p>Use this link to share these annotations with anyone:</p>
)} )}
</div> </div>
<div className="hyp-u-layout-row"> <div>
<TextInputWithButton> <TextInputWithButton>
<TextInput <TextInput
aria-label="Use this URL to share these annotations" aria-label="Use this URL to share these annotations"
...@@ -90,7 +93,7 @@ function ShareAnnotationsPanel({ toastMessenger }) { ...@@ -90,7 +93,7 @@ function ShareAnnotationsPanel({ toastMessenger }) {
/> />
</TextInputWithButton> </TextInputWithButton>
</div> </div>
<p> <p data-testid="sharing-details">
{notNull(focusedGroup).type === 'private' ? ( {notNull(focusedGroup).type === 'private' ? (
<span> <span>
Annotations in the private group{' '} Annotations in the private group{' '}
...@@ -105,14 +108,14 @@ function ShareAnnotationsPanel({ toastMessenger }) { ...@@ -105,14 +108,14 @@ function ShareAnnotationsPanel({ toastMessenger }) {
)}{' '} )}{' '}
<span> <span>
Private ( Private (
<Icon name="lock" classes="u-inline" /> <em>Only Me</em>) <Icon name="lock" classes="inline" /> <em>Only Me</em>)
annotations are only visible to you. annotations are only visible to you.
</span> </span>
</p> </p>
<ShareLinks shareURI={shareURI} /> <ShareLinks shareURI={shareURI} />
</> </>
) : ( ) : (
<p> <p data-testid="no-sharing">
These annotations cannot be shared because this document is not These annotations cannot be shared because this document is not
available on the web. available on the web.
</p> </p>
......
...@@ -95,7 +95,6 @@ describe('ShareAnnotationsPanel', () => { ...@@ -95,7 +95,6 @@ describe('ShareAnnotationsPanel', () => {
it('renders panel content if needed info available', () => { it('renders panel content if needed info available', () => {
const wrapper = createShareAnnotationsPanel(); const wrapper = createShareAnnotationsPanel();
assert.isTrue(wrapper.exists('.ShareAnnotationsPanel'));
assert.isFalse(wrapper.find('Spinner').exists()); assert.isFalse(wrapper.find('Spinner').exists());
}); });
}); });
...@@ -130,12 +129,12 @@ describe('ShareAnnotationsPanel', () => { ...@@ -130,12 +129,12 @@ describe('ShareAnnotationsPanel', () => {
const wrapper = createShareAnnotationsPanel(); const wrapper = createShareAnnotationsPanel();
assert.match( assert.match(
wrapper.find('.ShareAnnotationsPanel__intro').text(), wrapper.find('[data-testid="sharing-intro"]').text(),
testCase.introPattern testCase.introPattern
); );
assert.match( assert.match(
wrapper.find('.ShareAnnotationsPanel').text(), wrapper.find('[data-testid="sharing-details"]').text(),
testCase.visibilityPattern testCase.visibilityPattern
); );
}); });
...@@ -146,7 +145,7 @@ describe('ShareAnnotationsPanel', () => { ...@@ -146,7 +145,7 @@ describe('ShareAnnotationsPanel', () => {
const wrapper = createShareAnnotationsPanel(); const wrapper = createShareAnnotationsPanel();
const panelEl = wrapper.find('.ShareAnnotationsPanel'); const panelEl = wrapper.find('[data-testid="no-sharing"]');
assert.include(panelEl.text(), 'These annotations cannot be shared'); assert.include(panelEl.text(), 'These annotations cannot be shared');
}); });
}); });
......
@use '../../variables' as var;
@use '../../mixins/buttons';
@use '../../mixins/forms';
@use '../../mixins/molecules';
@use '../../mixins/utils';
.ShareAnnotationsPanel {
color: var.$color-text--light;
&__intro {
color: var.$color-text;
font-weight: 500;
}
}
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
@use './components/NotebookResultCount'; @use './components/NotebookResultCount';
@use './components/PaginationNavigation'; @use './components/PaginationNavigation';
@use './components/SelectionTabs'; @use './components/SelectionTabs';
@use './components/ShareAnnotationsPanel';
@use './components/SearchInput'; @use './components/SearchInput';
@use './components/ShareLinks'; @use './components/ShareLinks';
@use './components/TagEditor'; @use './components/TagEditor';
......
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