Make free coaching call url configurable and popup translatable (#823)

This commit is contained in:
CamilleLegeron
2024-02-07 17:53:48 +01:00
committed by GitHub
parent 6b0ef41255
commit a0a968a2d8
5 changed files with 35 additions and 10 deletions

View File

@@ -7,8 +7,9 @@ import {cardPopup, cssPopupBody, cssPopupButtons, cssPopupCloseButton,
import {icon} from 'app/client/ui2018/icons';
import {getGristConfig} from 'app/common/urlUtils';
import {dom, styled} from 'grainjs';
import { makeT } from '../lib/localization';
const FREE_COACHING_CALL_URL = 'https://calendly.com/grist-team/grist-free-coaching-call';
const t = makeT('WelcomeCoachingCall');
export function shouldShowWelcomeCoachingCall(appModel: AppModel) {
const {deploymentType} = getGristConfig();
@@ -63,7 +64,6 @@ export function showWelcomeCoachingCall(triggerElement: Element, appModel: AppMo
ctl.close();
};
// TODO: i18n
return [
cssPopup.cls(''),
cssPopupHeader(
@@ -77,35 +77,39 @@ export function showWelcomeCoachingCall(triggerElement: Element, appModel: AppMo
testId('popup-close-button'),
),
),
cssPopupTitle('Free Coaching Call', testId('popup-title')),
cssPopupTitle(t('free coaching call'),
dom.style('text-transform', 'capitalize'),
testId('popup-title')
),
cssPopupBody(
cssBody(
dom('div',
'Schedule your ', cssBoldText('free coaching call'), ' with a member of our team.'
t('Schedule your {{freeCoachingCall}} with a member of our team.',
{freeCoachingCall: cssBoldText(t('free coaching call'))}
)
),
dom('div',
"On the call, we'll take the time to understand your needs and "
+ 'tailor the call to you. We can show you the Grist basics, or start '
+ 'working with your data right away to build the dashboards you need.'
t("On the call, we'll take the time to understand your needs and tailor the call to you. \
We can show you the Grist basics, or start working with your data right away to build the dashboards you need.")
),
),
testId('popup-body'),
),
cssPopupButtons(
bigPrimaryButtonLink(
'Schedule Call',
t('Schedule Call'),
dom.on('click', () => {
dismissPopup(false);
logTelemetryEvent('clickedScheduleCoachingCall');
}),
{
href: FREE_COACHING_CALL_URL,
href: getGristConfig().freeCoachingCallUrl,
target: '_blank',
},
testId('popup-primary-button'),
),
bigBasicButton(
'Maybe Later',
t('Maybe Later'),
dom.on('click', () => dismissPopup(true)),
testId('popup-basic-button'),
),