1
0
mirror of synced 2025-12-22 19:34:15 -05:00
Files
docs/components/article/ArticleTitle.tsx
Mike Surowiec e0d9a061a3 React category / sub-landing page (#19635)
Re-work routes to use GlobalPage, implements TocLanding, bundle of minor cleanup / fixes
2021-06-02 16:28:39 +00:00

32 lines
826 B
TypeScript

import { Tooltip, Link } from '@primer/components'
import { PrinterIcon } from './PrinterIcon'
type Props = {
children: React.ReactNode
}
export const ArticleTitle = ({ children }: Props) => {
return (
<div className="d-flex flex-items-baseline flex-justify-between">
<h1 className="my-4">{children}</h1>
<div className="d-none d-lg-block ml-2">
<Tooltip aria-label="Print this article" noDelay direction="n">
<Link
as="button"
underline={false}
muted
onClick={() => {
try {
document.execCommand('print', false)
} catch (e) {
window.print()
}
}}
>
<PrinterIcon />
</Link>
</Tooltip>
</div>
</div>
)
}