Merge pull request #13021 from overleaf/ae-writefull-promo-chrome

Only show the Writefull promo banner to Chromium browsers

GitOrigin-RevId: 8a8765d2d55d431fd91360a821d5f9f994005ebc
This commit is contained in:
Alf Eaton 2023-05-10 12:59:16 +01:00 committed by Copybot
parent d445ddd410
commit a248da99c1

View file

@ -12,6 +12,11 @@ const eventSegmentation = {
name: 'writefull',
}
const isChromium = () =>
(window.navigator as any).userAgentData?.brands?.some(
(item: { brand: string }) => item.brand === 'Chromium'
)
function WritefullPromoBanner() {
const [show, setShow] = useState(() => {
const show =
@ -39,6 +44,10 @@ function WritefullPromoBanner() {
return null
}
if (!isChromium()) {
return null
}
return (
<Notification
bsStyle="info"