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