blob: 41b5bb97dcb95f0916bea68beca99d7e59002e2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
import { isSystemImage } from "../../api/models";
import { asString } from "../../foundation/json-parsing/server-data";
import { createArtworkForSystemImage } from "../content/artwork/artwork";
import * as metricsHelpersClicks from "../metrics/helpers/clicks";
import * as metricsHelpersLocation from "../metrics/helpers/location";
/**
* Creates a {@linkcode PrepareAction} that sets the link's text and icon
*/
function createWebNavigationFlowActionConfiguration(id) {
return (objectGraph, action) => {
const tab = objectGraph.bag.tabsStandard.find((t) => t.id === id);
const imageIdentifier = asString(tab, "image-identifier");
const artwork = isSystemImage(imageIdentifier)
? createArtworkForSystemImage(objectGraph, imageIdentifier)
: null;
action.title = asString(tab, "title");
action.artwork = artwork;
if (objectGraph.client.isWeb) {
metricsHelpersClicks.addClickEventToAction(objectGraph, action, {
targetType: "link",
id: id,
pageInformation: undefined,
locationTracker: metricsHelpersLocation.newLocationTracker(),
});
}
};
}
/**
* {@linkcode PrepareAction} that presents a link to the "Apps" landing page
*/
export const appLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("apps");
/**
* {@linkcode PrepareAction} that presents a link to the "Apps & Games" landing page
*/
export const appAndGamesLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("apps-and-games");
/**
* {@linkcode PrepareAction} that presents a link to the "Arcade" landing page
*/
export const arcadeLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("arcade");
/**
* {@linkcode PrepareAction} that presents a link to the "Discover" landing page
*/
export const discoverLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("discover");
/**
* {@linkcode PrepareAction} that presents a link to the "Games" landing page
*/
export const gamesLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("games");
/**
* {@linkcode PrepareAction} that presents a link to the "Create" landing page
*
* Note: `create` refers to the specific "Create" landing page, rather than this being
* a function that creates landing page presentations
*/
export const createLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("create");
/**
* {@linkcode PrepareAction} that presents a link to the "Work" landing page
*/
export const workLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("work");
/**
* {@linkcode PrepareAction} that presents a link to the "Play" landing page
*/
export const playLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("play");
/**
* {@linkcode PrepareAction} that presents a link to the "Develop" landing page
*/
export const developLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("develop");
/**
* {@linkcode PrepareAction} that presents a link to the "Categories" landing page
*/
export const categoriesLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("categories");
/**
* {@linkcode PrepareAction} that presents a link to the "Today" landing page
*/
export const todayLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("today");
/**
* {@linkcode PrepareAction} that presents a link to the "Apps & Games" landing page
*/
export const searchLandingPageFlowActionPresentation = createWebNavigationFlowActionConfiguration("search");
//# sourceMappingURL=flow-action-presentation.js.map
|