mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 14:19:01 +02:00
590c2ab2e2
* Update hrefs * Revert link on expired subscriptions * Revert hrefs of other buttons * Use `plans-2026-phase-1` feature flag GitOrigin-RevId: 3fe489c6ec192adc2fb836b07429dc2a11f9a57f
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { useTranslation } from 'react-i18next'
|
|
import * as eventTracking from '../../../../infrastructure/event-tracking'
|
|
import OLButton from '@/shared/components/ol/ol-button'
|
|
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
|
|
|
export default function UpgradeButton({
|
|
className = '',
|
|
referrer = 'editor-header-upgrade-prompt',
|
|
source = 'code-editor',
|
|
}: {
|
|
className?: string
|
|
referrer?: string
|
|
source?: string
|
|
}) {
|
|
const { t } = useTranslation()
|
|
const plans2026 = useFeatureFlag('plans-2026-phase-1')
|
|
|
|
function handleClick() {
|
|
eventTracking.send('subscription-funnel', source, 'upgrade')
|
|
eventTracking.sendMB('upgrade-button-click', { source })
|
|
}
|
|
|
|
return (
|
|
<div className="ide-redesign-toolbar-button-container">
|
|
<OLButton
|
|
variant="premium"
|
|
size="sm"
|
|
href={
|
|
plans2026
|
|
? `/user/subscription/choose-your-plan?itm_referrer=${referrer}`
|
|
: `/user/subscription/plans?itm_referrer=${referrer}`
|
|
}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
onClick={handleClick}
|
|
className={className}
|
|
>
|
|
{t('upgrade')}
|
|
</OLButton>
|
|
</div>
|
|
)
|
|
}
|