Avoid hardcoding branding in user onboarding (#9206)
* Avoid hardcoding branding in user onboarding * Make spotlight test more reliable
This commit is contained in:
parent
ef0ba77f14
commit
e8eefeb937
6 changed files with 52 additions and 37 deletions
|
@ -25,14 +25,15 @@ import { _t } from "../languageHandler";
|
|||
import Modal from "../Modal";
|
||||
import { Notifier } from "../Notifier";
|
||||
import PosthogTrackers from "../PosthogTrackers";
|
||||
import SdkConfig from "../SdkConfig";
|
||||
import { UseCase } from "../settings/enums/UseCase";
|
||||
import { useSettingValue } from "./useSettings";
|
||||
import { UserOnboardingContext } from "./useUserOnboardingContext";
|
||||
|
||||
export interface UserOnboardingTask {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
title: string | (() => string);
|
||||
description: string | (() => string);
|
||||
relevant?: UseCase[];
|
||||
action?: {
|
||||
label: string;
|
||||
|
@ -95,8 +96,12 @@ const tasks: InternalUserOnboardingTask[] = [
|
|||
},
|
||||
{
|
||||
id: "download-apps",
|
||||
title: _t("Download Element"),
|
||||
description: _t("Don’t miss a thing by taking Element with you"),
|
||||
title: () => _t("Download %(brand)s", {
|
||||
brand: SdkConfig.get("brand"),
|
||||
}),
|
||||
description: () => _t("Don’t miss a thing by taking %(brand)s with you", {
|
||||
brand: SdkConfig.get("brand"),
|
||||
}),
|
||||
completed: (ctx: UserOnboardingContext) => {
|
||||
return Boolean(ctx.devices.filter(it => it.device_id !== ctx.myDevice).length);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue