Allow for different content in opted in/ out experiments (#28530)

* feat: allowing for different messages in experiment when user is opted in

GitOrigin-RevId: 7b4254be6cf8147399010053d5a2a4cf9bb8f342
This commit is contained in:
Jimmy Domagala-Tang
2025-09-25 08:05:44 +00:00
committed by Copybot
parent 07166bff73
commit bfd00a8151
4 changed files with 26 additions and 5 deletions
@@ -659,6 +659,7 @@
"get_most_subscription_by_checking_overleaf": "",
"get_most_subscription_by_checking_overleaf_ai_writefull": "",
"get_real_time_track_changes": "",
"get_regular_access_to_new_versions_of_tex_live": "",
"git": "",
"git_authentication_token": "",
"git_authentication_token_create_modal_info_1": "",
@@ -1782,11 +1783,11 @@
"test": "",
"test_configuration": "",
"test_configuration_successful": "",
"test_more_recent_versions_of_texlive": "",
"tex_live_version": "",
"texgpt": "",
"thank_you": "",
"thank_you_exclamation": "",
"thank_you_for_joining_the_rolling_texlive": "",
"thank_you_for_your_feedback": "",
"thanks_for_confirming_your_email_address": "",
"thanks_for_getting_in_touch": "",
@@ -1,7 +1,7 @@
import { useCallback, useState } from 'react'
import LabsExperimentWidget from '../../shared/components/labs/labs-experiments-widget'
import { isInExperiment } from '@/utils/labs-utils'
import { useTranslation } from 'react-i18next'
import { useTranslation, Trans } from 'react-i18next'
import MaterialIcon from '@/shared/components/material-icon'
import { isSplitTestEnabled } from '@/utils/splitTestUtils'
import { postJSON } from '@/infrastructure/fetch-json'
@@ -43,9 +43,25 @@ const MonthlyTexliveLabsWidget = ({
className="rounded bg-primary-subtle"
/>
)
const optedInDescription = (
<Trans
i18nKey="thank_you_for_joining_the_rolling_texlive"
components={[
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a
href="/learn/latex/Overleaf_and_TeX_Live#How_do_I_change_a_project’s_TeX_Live_version?"
target="_blank"
key="getting-started-link"
/>,
]}
/>
)
return (
<LabsExperimentWidget
description={t('test_more_recent_versions_of_texlive')}
description={t('get_regular_access_to_new_versions_of_tex_live')}
optedInDescription={optedInDescription}
experimentName="monthly-texlive"
logo={logo}
labsEnabled={labsProgram}
@@ -9,7 +9,8 @@ import getMeta from '@/utils/meta'
type IntegrationLinkingWidgetProps = {
logo: ReactNode
title: string
description: string
description: string | ReactNode
optedInDescription?: string | ReactNode
helpPath?: string
labsEnabled?: boolean
experimentName: string
@@ -22,6 +23,7 @@ export function LabsExperimentWidget({
logo,
title,
description,
optedInDescription,
helpPath,
labsEnabled,
experimentName,
@@ -69,7 +71,7 @@ export function LabsExperimentWidget({
{optedIn && <OLBadge bg="info">{t('enabled')}</OLBadge>}
</div>
<p className="small">
{description}{' '}
{optedIn && optedInDescription ? optedInDescription : description}{' '}
{helpPath && (
<a href={helpPath} target="_blank" rel="noreferrer">
{t('learn_more')}