this repo has no description
at main 28 lines 1.1 kB view raw
1import { createPlatformSelectors } from "./platform-selection"; 2import { createLandingPageLinks } from "./landing-page-links-by-platform"; 3import { makeWebSearchAction } from "../search/web-search-action"; 4/** 5 * Create a {@linkcode WebNavigation} based on the active {@linkcode Intent} 6 */ 7export function createWebNavigation(objectGraph, platform) { 8 const webNavigation = { 9 platforms: [], 10 tabs: [], 11 searchAction: makeWebSearchAction(objectGraph, platform), 12 }; 13 setActivePlatform(objectGraph, webNavigation, platform); 14 return webNavigation; 15} 16/** 17 * Updates a {@linkcode WebNavigation} to reflect: 18 * 19 * 1. the platform specified by {@linkcode platform} 20 * 2. the "active landing page" specified by {@linkcode intent} 21 */ 22export function setActivePlatform(objectGraph, shelf, platform, intent) { 23 shelf.platforms = createPlatformSelectors(objectGraph, platform); 24 const searchActionDestination = shelf.searchAction.destination; 25 shelf.tabs = createLandingPageLinks(objectGraph, platform, intent); 26 searchActionDestination.platform = platform; 27} 28//# sourceMappingURL=web-navigation.js.map