Skip to content

Commit

Permalink
Rename and change copy
Browse files Browse the repository at this point in the history
  • Loading branch information
lmuntaner committed Dec 20, 2024
1 parent feeb430 commit 1cdb051
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
9 changes: 9 additions & 0 deletions src/frontend/src/flows/addDevice/addCurrentDevice.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"en": {
"title": "Add Current Device",
"paragraph": "Please add the current device to your identity to improve the user experience with Internet Identity.",
"skip": "Skip",
"replace_origin": "Add",
"label_icon": "Recommended Action"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { infoScreenTemplate } from "$src/components/infoScreen";
import { I18n } from "$src/i18n";
import { renderPage } from "$src/utils/lit-html";
import { TemplateResult } from "lit-html";
import copyJson from "./replaceCurrentDeviceOrigin.json";
import copyJson from "./addCurrentDevice.json";

const replaceCurrentDeviceOriginTemplate = ({
const addCurrentDeviceTemplate = ({
replace,
skip,
i18n,
Expand All @@ -29,19 +29,17 @@ const replaceCurrentDeviceOriginTemplate = ({
});
};

export const replaceCurrentDeviceOriginPage = renderPage(
replaceCurrentDeviceOriginTemplate
);
export const addCurrentDevicePage = renderPage(addCurrentDeviceTemplate);

// Prompt the user to change the origin of the current device.
// Changing the origin improves the UX of the user when logging in with a different device.
export const replaceCurrentDeviceOrigin = (): Promise<{
action: "skip" | "replace-origin-device";
// Prompt the user to add the current device (with the current origin).
// Adding the current device to the current origin improves the UX of the user when they come back to this origin.
export const addCurrentDevice = (): Promise<{
action: "skip" | "add-current-device";
}> => {
return new Promise((resolve) =>
replaceCurrentDeviceOriginPage({
addCurrentDevicePage({
i18n: new I18n(),
replace: () => resolve({ action: "replace-origin-device" }),
replace: () => resolve({ action: "add-current-device" }),
skip: () => resolve({ action: "skip" }),
})
);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import Screen from "../layouts/Screen.astro";
<script>
import { toast } from "$src/components/toast";
import { i18n } from "../i18n";
import { replaceCurrentDeviceOriginPage } from "$src/flows/addDevice/replaceCurrentDeviceOrigin";
import { addCurrentDevicePage } from "$src/flows/addDevice/addCurrentDevice";

replaceCurrentDeviceOriginPage({
addCurrentDevicePage({
replace: () => toast.info("Replace device's origin"),
skip: () => toast.info("Skip"),
i18n,
Expand Down

0 comments on commit 1cdb051

Please sign in to comment.