|
@@ -4,6 +4,7 @@ import { sendMB } from '@/infrastructure/event-tracking'
|
|
|
import customLocalStorage from '@/infrastructure/local-storage'
|
|
import customLocalStorage from '@/infrastructure/local-storage'
|
|
|
import WritefullLogo from '@/shared/svgs/writefull-logo'
|
|
import WritefullLogo from '@/shared/svgs/writefull-logo'
|
|
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
|
|
|
|
+import getMeta from '@/utils/meta'
|
|
|
|
|
|
|
|
const eventSegmentation = {
|
|
const eventSegmentation = {
|
|
|
location: 'dashboard-banner',
|
|
location: 'dashboard-banner',
|
|
@@ -20,6 +21,11 @@ function WritefullPremiumPromoBanner({
|
|
|
setShow: (value: boolean) => void
|
|
setShow: (value: boolean) => void
|
|
|
onDismiss: () => void
|
|
onDismiss: () => void
|
|
|
}) {
|
|
}) {
|
|
|
|
|
+ // dont show the add to WF commons users since their license already includes it
|
|
|
|
|
+ const userAffiliations = getMeta('ol-userAffiliations') || []
|
|
|
|
|
+ const hasWritefullCommons = userAffiliations.some(
|
|
|
|
|
+ affil => affil.institution?.writefullCommonsAccount
|
|
|
|
|
+ )
|
|
|
const handleClose = useCallback(() => {
|
|
const handleClose = useCallback(() => {
|
|
|
customLocalStorage.setItem('has_dismissed_writefull_promo_banner', true)
|
|
customLocalStorage.setItem('has_dismissed_writefull_promo_banner', true)
|
|
|
setShow(false)
|
|
setShow(false)
|
|
@@ -27,7 +33,7 @@ function WritefullPremiumPromoBanner({
|
|
|
onDismiss()
|
|
onDismiss()
|
|
|
}, [setShow, onDismiss])
|
|
}, [setShow, onDismiss])
|
|
|
|
|
|
|
|
- if (!show) {
|
|
|
|
|
|
|
+ if (!show || hasWritefullCommons) {
|
|
|
return null
|
|
return null
|
|
|
}
|
|
}
|
|
|
|
|
|