Commit 6d50b1b5 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Transition `WarningBanner` to tailwind; update to shared components

parent 1c76a6d4
import { SvgIcon } from '@hypothesis/frontend-shared';
import { Icon, Link } from '@hypothesis/frontend-shared';
import classnames from 'classnames';
/**
* A banner shown at the top of the PDF viewer if the PDF cannot be annotated
......@@ -6,20 +7,26 @@ import { SvgIcon } from '@hypothesis/frontend-shared';
*/
export default function WarningBanner() {
return (
<div className="WarningBanner WarningBanner--notice">
<div className="WarningBanner__type">
<SvgIcon name="caution" className="WarningBanner__icon" />
</div>
<div className="WarningBanner__message">
<strong>This PDF does not contain selectable text:</strong>{' '}
<a
target="_blank"
rel="noreferrer"
href="https://web.hypothes.is/help/how-to-ocr-optimize-pdfs/"
>
Learn how to fix this
</a>{' '}
in order to annotate with Hypothesis.
<div className="bg-white">
<div
className={classnames(
'flex items-center gap-x-2',
'border border-yellow-notice bg-yellow-notice/10 text-annotator-base'
)}
>
<div className="bg-yellow-notice text-white p-2">
<Icon name="caution" classes="text-annotator-xl" />
</div>
<div>
<strong>This PDF does not contain selectable text:</strong>{' '}
<Link
target="_blank"
href="https://web.hypothes.is/help/how-to-ocr-optimize-pdfs/"
>
Learn how to fix this
</Link>{' '}
in order to annotate with Hypothesis.
</div>
</div>
</div>
);
......
@use '../mixins/molecules';
@use '../variables' as var;
.WarningBanner {
@include molecules.banner;
font-size: var.$annotator-adder-font-size;
}
@use 'tailwindcss/components';
@use '@hypothesis/frontend-shared/styles';
// Extensions and overrides to patterns from `frontend-shared`
@use '../../frontend-shared';
// Annotator-specific components.
@use './AdderToolbar';
@use './Buckets';
@use './WarningBanner';
......@@ -52,6 +52,7 @@ export default {
// remain as pixels when sidebar converts to rems or otherwise be
// independent of sidebar font sizes
'annotator-sm': ['12px'],
'annotator-base': ['14px'],
'annotator-lg': ['16px'],
'annotator-xl': ['18px'],
},
......
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