Merge pull request #29444 from overleaf/ds-remove-brazil-discount-banner

Removing GEO Price Banner from Brazil

GitOrigin-RevId: 85968cb546083bb3d3a526061daf8e6c1149867d
This commit is contained in:
Alf Eaton
2025-11-04 09:06:06 +00:00
committed by Copybot
parent 1d3d81e67d
commit c3881084be
10 changed files with 0 additions and 136 deletions
@@ -445,7 +445,6 @@ async function projectListPage(req, res, next) {
_.sample(['on-premise', 'FOMO', 'FOMO', 'FOMO'])
let showInrGeoBanner = false
let showBrlGeoBanner = false
let showLATAMBanner = false
let recommendedCurrency
@@ -459,7 +458,6 @@ async function projectListPage(req, res, next) {
if (countryCode === 'IN') {
showInrGeoBanner = true
}
showBrlGeoBanner = countryCode === 'BR'
showLATAMBanner = ['MX', 'CO', 'CL', 'PE'].includes(countryCode)
// LATAM Banner needs to know which currency to display
@@ -566,7 +564,6 @@ async function projectListPage(req, res, next) {
showLATAMBanner,
recommendedCurrency,
showInrGeoBanner,
showBrlGeoBanner,
projectDashboardReact: true, // used in navbar
groupSsoSetupSuccess,
joinedGroupName,
@@ -61,7 +61,6 @@ block append meta
content=groupsAndEnterpriseBannerVariant
)
meta(name='ol-showInrGeoBanner' data-type='boolean' content=showInrGeoBanner)
meta(name='ol-showBrlGeoBanner' data-type='boolean' content=showBrlGeoBanner)
meta(
name='ol-recommendedCurrency'
data-type='string'
@@ -1,124 +0,0 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import bannerImage from '../../../images/brl-banner.png'
import usePersistedState from '../../../../../shared/hooks/use-persisted-state'
import * as eventTracking from '../../../../../infrastructure/event-tracking'
import {
OLModal,
OLModalBody,
OLModalFooter,
OLModalHeader,
OLModalTitle,
} from '@/shared/components/ol/ol-modal'
import OLButton from '@/shared/components/ol/ol-button'
import { useTranslation } from 'react-i18next'
export default function BRLBanner() {
const { t } = useTranslation()
const [dismissedUntil, setDismissedUntil] = usePersistedState<
Date | undefined
>(`has_dismissed_brl_banner_until`)
const viewEventSent = useRef<boolean>(false)
const [showModal, setShowModal] = useState(true)
useEffect(() => {
if (dismissedUntil && new Date(dismissedUntil) > new Date()) {
return
}
if (!viewEventSent.current) {
eventTracking.sendMB('promo-prompt', {
location: 'dashboard-modal',
name: 'geo-pricing',
page: '/project',
content: 'modal',
country: 'BR',
})
viewEventSent.current = true
}
}, [dismissedUntil])
const handleClick = useCallback(() => {
eventTracking.sendMB('promo-click', {
location: 'dashboard-modal',
name: 'geo-pricing',
page: '/project',
content: 'modal',
country: 'BR',
type: 'click',
})
setShowModal(false)
window.open('/user/subscription/plans')
}, [])
const bannerDismissed = useCallback(() => {
eventTracking.sendMB('promo-dismiss', {
location: 'dashboard-modal',
name: 'geo-pricing',
page: '/project',
content: 'modal',
country: 'BR',
})
const until = new Date()
until.setDate(until.getDate() + 30) // 30 days
setDismissedUntil(until)
}, [setDismissedUntil])
const handleHide = useCallback(() => {
setShowModal(false)
bannerDismissed()
}, [bannerDismissed])
const handleMaybeLater = useCallback(() => {
eventTracking.sendMB('promo-click', {
location: 'dashboard-modal',
name: 'geo-pricing',
page: '/project',
content: 'modal',
country: 'BR',
type: 'pause',
})
setShowModal(false)
const until = new Date()
until.setDate(until.getDate() + 1) // 1 day
setDismissedUntil(until)
}, [setDismissedUntil])
if (dismissedUntil && new Date(dismissedUntil) > new Date()) {
return null
}
return (
<OLModal show={showModal} onHide={handleHide}>
<OLModalHeader>
<OLModalTitle>{t('latam_discount_modal_title')}</OLModalTitle>
</OLModalHeader>
<OLModalBody>
<p>
<img
alt={t('latam_discount_modal_title')}
src={bannerImage}
style={{
width: '100%',
}}
/>
</p>
<p>
{t('latam_discount_modal_info', {
discount: '50',
currencyName: 'Brazilian Reais',
})}
</p>
</OLModalBody>
<OLModalFooter>
<OLButton variant="secondary" onClick={handleMaybeLater}>
{t('maybe_later')}
</OLButton>
<OLButton variant="primary" onClick={handleClick}>
{t('get_discounted_plan')}
</OLButton>
</OLModalFooter>
</OLModal>
)
}
@@ -1,15 +1,12 @@
import getMeta from '@/utils/meta'
import BRLBanner from './ads/brl-banner'
import INRBanner from './ads/inr-banner'
import LATAMBanner from './ads/latam-banner'
function GeoBanners() {
const showInrGeoBanner = getMeta('ol-showInrGeoBanner')
const showBrlGeoBanner = getMeta('ol-showBrlGeoBanner')
const showLATAMBanner = getMeta('ol-showLATAMBanner')
return (
<>
{showBrlGeoBanner && <BRLBanner />}
{showLATAMBanner && <LATAMBanner />}
{showInrGeoBanner && <INRBanner />}
</>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

-1
View File
@@ -253,7 +253,6 @@ export interface Meta {
'ol-shouldAllowEditingDetails': boolean
'ol-shouldLoadHotjar': boolean
'ol-showAiErrorAssistant': boolean
'ol-showBrlGeoBanner': boolean
'ol-showCouponField': boolean
'ol-showGroupDiscount': boolean
'ol-showGroupsAndEnterpriseBanner': boolean
-1
View File
@@ -252,7 +252,6 @@
"bold": "Bold",
"booktabs": "Booktabs",
"breadcrumbs": "Breadcrumbs",
"brl_discount_offer_plans_page_banner": "__flag__ <b>Great news!</b> Weve applied a 50% discount to premium plans on this page for our users in Brazil. Check out the new lower prices.",
"browser": "Browser",
"built_in": "Built-In",
"bullet_list": "Bullet list",
-1
View File
@@ -170,7 +170,6 @@
"blank_project": "Proyecto vacío",
"blocked_filename": "Este nombre de archivo está bloqueado.",
"blog": "Blog",
"brl_discount_offer_plans_page_banner": "__flag__ <b>¡Grandes noticias!</b> Hemos aplicado un 50% de descuento a los planes premium de esta página para nuestros usuarios en Brasil. Echa un vistazo a los nuevos precios más bajos.",
"browser": "Navegador",
"built_in": "Integrado",
"buy_now_no_exclamation_mark": "Comprar ahora",
-1
View File
@@ -72,7 +72,6 @@
"bibliographies": "Bibliografia",
"blank_project": "Projeto Em Branco",
"blog": "Blog",
"brl_discount_offer_plans_page_banner": "__flag__ Aplicamos um desconto de 50% aos planos premium nesta página para nossos usuários no Brasil. Confira os novos preços mais baixos.",
"built_in": "Embutido",
"by": "por",
"cancel": "Cancelar",
-1
View File
@@ -231,7 +231,6 @@
"blocked_filename": "此文件名被阻止。",
"blog": "博客",
"bold": "粗体",
"brl_discount_offer_plans_page_banner": "__flag__<b>好消息</b> 我们为巴西用户在本页面上的高级计划提供了50%的折扣。看看新的低价。",
"browser": "浏览器",
"built_in": "内嵌",
"bullet_list": "项目符号列表",