mohammed-ahad

Untitled

May 12th, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 10.04 KB | None | 0 0
  1. import { NavigationSchema2 } from "../types";
  2.  
  3. import {
  4.   MdOutlineHome,
  5.   MdOutlineGroup,
  6.   MdOutlineCampaign,
  7.   MdOutlineBusiness,
  8.   MdOutlineHealthAndSafety,
  9.   MdOutlineCloud,
  10.   MdOutlineHomeWork,
  11.   MdOutlineTextSnippet,
  12.   MdOutlineCameraAlt,
  13.   MdOutlineRemoveRedEye,
  14.   MdOutlineLock,
  15.   MdOutlineSearch,
  16.   MdOutlineHandyman,
  17.   MdOutlineFavoriteBorder,
  18.   MdOutlineMail,
  19.   MdHomeFilled,
  20.   MdOutlineEmojiEmotions,
  21.   MdOutlineDesktopMac,
  22.   MdOutlineStickyNote2,
  23.   MdOutlineCases,
  24.   MdOutlineDirectionsRun,
  25.   MdOutlineStarOutline,
  26.   MdOutlineQuestionAnswer,
  27.   MdOutlineCalendarMonth,
  28.   MdOutlineVideoCameraFront,
  29.   MdOutlineWarehouse
  30. }
  31. from "react-icons/md";
  32.  
  33. import {
  34.   HiOutlineGlobe,
  35.   HiOutlineGlobeAlt,
  36. } from "react-icons/hi";
  37.  
  38. const navigation2: NavigationSchema2[] = [
  39.   {
  40.     id: "1",
  41.     title: "Home",
  42.     iconBefore: MdOutlineHome,
  43.     path:"/",
  44.   },
  45.   {
  46.     id: "2",
  47.     title: "Who We Are",
  48.     iconBefore: MdOutlineGroup,
  49.     items: [
  50.       {
  51.         id: "sky",
  52.         title: "Sky",
  53.         path: "/sky",
  54.         iconBefore: MdOutlineCloud,
  55.       },
  56.       {
  57.         id: "gott",
  58.         title: "Global OTT Technology",
  59.         path: "/gott",
  60.         iconBefore: HiOutlineGlobe,
  61.       },
  62.       {
  63.         id: "global-reliability",
  64.         title: "Global Reliability Engineering",
  65.         path: "/global-reliability",
  66.         iconBefore: HiOutlineGlobeAlt,
  67.       },
  68.       {
  69.         id: "operations-observability",
  70.         title: "Operations & Observability",
  71.         path: "/operations-observability",
  72.         iconBefore: MdOutlineSearch,
  73.         items: [
  74.           {
  75.             id: "oo-overview",
  76.             title: 'Overview',
  77.             path: '/operations-observability',
  78.           },
  79.           {
  80.             id: "ai-engineering",
  81.             title: "Automation & Insight Engineering",
  82.             path: "/teams/aiengineering",
  83.           },
  84.           {
  85.             id: "emerging-sres",
  86.             title: "Emerging SREs",
  87.             path: "/teams/emergingSREs",
  88.           },
  89.           {
  90.             id: "observability-operations",
  91.             title: "Observability Operations",
  92.             path: "/teams/operations",
  93.           },
  94.         ],
  95.       },
  96.       {
  97.         id: "platform-governance",
  98.         title: "Platform Governance",
  99.         path: "/platform-governance",
  100.         iconBefore: MdOutlineRemoveRedEye,
  101.         items: [
  102.           {
  103.             id: "platform-governance-overview",
  104.             title: 'Overview',
  105.             path: '/platform-governance',
  106.           },
  107.           {
  108.             id: "platform-performance",
  109.             title: "Platform Performance",
  110.             path: "/teams/platformPerformance",
  111.           },
  112.           {
  113.             id: "platform-data-engineering",
  114.             title: "Platform and Data Engineering",
  115.             path: "/teams/platformDataEngineering",
  116.           },
  117.           {
  118.             id: "platform-assurance",
  119.             title: "Platform Assurance",
  120.             path: "/teams/platformAssurance",
  121.           },
  122.           {
  123.             id: "platform-governance-sre",
  124.             title: "Platform Governance SRE",
  125.             path: "/teams/platformGovernanceSRE",
  126.           },
  127.         ],
  128.       },
  129.       {
  130.         id: "site-reliability-engineering",
  131.         title: "Site Reliability Engineering",
  132.         path: "/sre",        
  133.         iconBefore: MdOutlineHandyman,
  134.         items: [
  135.           {
  136.             id: "sre-overview",
  137.             title: 'Overview',
  138.             path: '/sre',
  139.           },
  140.           {
  141.             id: "cloud-engineering-platform",
  142.             title: "Cloud Engineering Platform",
  143.             path: "/teams/cloudEngineeringPlatform",
  144.           },
  145.           {
  146.             id: "cloud-engineering-central-services",
  147.             title: "Cloud Engineering Central Services",
  148.             path: "/teams/cloudEngineeringCentralServices",
  149.           },
  150.           {
  151.             id: "content-supply-sre",
  152.             title: "Content Supply SRE",
  153.             path: "/teams/contentSupply",
  154.           },
  155.           {
  156.             id: "data-platforms-reliability",
  157.             title: "Data Platforms Reliability",
  158.             path: "/teams/dataPlatformsReliability",
  159.           },
  160.           {
  161.             id: "discovery-reliability",
  162.             title: "Discovery Reliability",
  163.             path: "/teams/discoveryReliability",
  164.           },
  165.           {
  166.             id: "top-sre",
  167.             title: "TOP SRE",
  168.             path: "/teams/TOP",
  169.           },
  170.           {
  171.             id: "ovp-sre",
  172.             title: "OVP SRE",
  173.             path: "/teams/ovp",
  174.           },
  175.           {
  176.             id: "paylite-sre",
  177.             title: "Paylite SRE",
  178.             path: "/teams/paylite",
  179.           },
  180.           {
  181.             id: "platform-engineering",
  182.             title: "Platform Engineering",
  183.             path: "/teams/platformEngineering",
  184.           },
  185.           {
  186.             id: "strategic-kafka-sre",
  187.             title: "Strategic Kafka SRE",
  188.             path: "/teams/strategicKafka",
  189.           },
  190.           {
  191.             id: "streaming-sds-sre",
  192.             title: "Streaming (SDS) SRE",
  193.             path: "/teams/streaming",
  194.           },
  195.           {
  196.             id: "streaming-platform-capabilities-sre",
  197.             title: "Streaming and Platform Capabilities (SPC) SRE",
  198.             path: "/teams/streamingPlatformCapabilities",
  199.           },
  200.         ],
  201.       },
  202.       {
  203.         id: "global-ott-security",
  204.         title: "Global OTT Security",
  205.         path: "/security",
  206.         iconBefore: MdOutlineLock,
  207.         items: [
  208.           {
  209.             id: "global-ott-overview",
  210.             title: 'Overview',
  211.             path: '/security',
  212.           },
  213.           {
  214.             id: "penetration-testing",
  215.             title: "Penetration Testing",
  216.             path: "/teams/penetrationTesting",
  217.           },
  218.           {
  219.             id: "security-consultancy",
  220.             title: "Security Consultancy",
  221.             path: "/teams/securityConsulting",
  222.           },
  223.           {
  224.             id: "security-engineering",
  225.             title: "Security Engineering",
  226.             path: "/teams/securityEngineering",
  227.           },
  228.           {
  229.             id: "security-operations",
  230.             title: "Security Operations",
  231.             path: "/teams/securityOperations",
  232.           },
  233.         ],
  234.       },
  235.       {
  236.         id: "reliability-portfolio",
  237.         title: "Reliability Portfolio",
  238.         path: "/portfolio",
  239.         iconBefore: MdOutlineCases,
  240.         items: [
  241.           {
  242.             id: "reliability-portfolio-overview",
  243.             title: 'Overview',
  244.             path: '/portfolio',
  245.           },
  246.           {
  247.             id: "finops",
  248.             title: "FinOps",
  249.             path: "/teams/finOps",
  250.           },
  251.           {
  252.             id: "portfolio-delivery",
  253.             title: "Portfolio Delivery",
  254.             path: "/teams/portfolioDelivery",
  255.           },
  256.           {
  257.             id: "portfolio-analysis",
  258.             title: "Portfolio Analysis",
  259.             path: "/teams/portfolioAnalysis",
  260.           },
  261.         ],
  262.       },
  263.     ],
  264.   },
  265.   {
  266.     id: "3",
  267.     title: "About Us",
  268.     iconBefore: MdOutlineCampaign,
  269.     items: [
  270.       {
  271.         id: "events",
  272.         title: "Events",
  273.         path: "/events",
  274.         iconBefore: MdOutlineCalendarMonth,
  275.       },
  276.       {
  277.         id: "culture",
  278.         title: "Our Culture",
  279.         path: "/culture",
  280.         iconBefore: MdOutlineEmojiEmotions,
  281.       },
  282.       {
  283.         id: "career",
  284.         title: "Career",
  285.         path: "/career",
  286.         iconBefore: MdOutlineDirectionsRun,
  287.       },
  288.       {
  289.         id: "recognition",
  290.         title: "Recognition",
  291.         path: "/recognition",
  292.         iconBefore: MdOutlineStarOutline,
  293.       },
  294.       {
  295.         id: "blog",
  296.         title: "Blog",
  297.         path: "/blog",
  298.         iconBefore: MdOutlineTextSnippet,
  299.       },
  300.       ]
  301.   },
  302.   {
  303.     id: "4",
  304.     title: "Life At Sky",
  305.     iconBefore: MdOutlineBusiness,
  306.     items: [
  307.       {
  308.         id: "getting-setup",
  309.         title: "Getting Setup",
  310.         path: "/getting-setup",
  311.         iconBefore: MdOutlineDesktopMac,
  312.       },
  313.       {
  314.         id: "campus-life",
  315.         title: "Campus Life",
  316.         path: "/campus-life",
  317.         iconBefore: MdOutlineWarehouse,
  318.       },
  319.       {
  320.         id: "remote-life",
  321.         title: "Remote Life",
  322.         path: "/remote-life",
  323.         iconBefore: MdHomeFilled,
  324.       },
  325.       {
  326.         id: "hybrid-working",
  327.         title: "Hybrid Working",
  328.         path: "/hybrid-working",
  329.         iconBefore: MdOutlineHomeWork,
  330.       },
  331.       {
  332.         id: "admin",
  333.         title: "Admin",
  334.         path: "/admin",
  335.         iconBefore: MdOutlineStickyNote2,
  336.       },
  337.       {
  338.         id: "wellbeing",
  339.         title: "Wellbeing",
  340.         path: "/wellbeing",
  341.         iconBefore: MdOutlineFavoriteBorder,
  342.       },
  343.       {
  344.         id: "unplugged",
  345.         title: "Unplugged",
  346.         path: "/unplugged",
  347.         iconBefore: MdOutlineVideoCameraFront,
  348.       },
  349.       {
  350.         id: "photo-gallery",
  351.         title: "Photo Gallery",
  352.         path: "/photo-gallery",
  353.         iconBefore: MdOutlineCameraAlt,
  354.       },
  355.     ]
  356.   },
  357.   {
  358.     id: "5",
  359.     title: "Support",
  360.     iconBefore: MdOutlineHealthAndSafety,
  361.     items: [
  362.       {
  363.         id: "contact",
  364.         title: "Contact",
  365.         path: "/contact",
  366.         iconBefore: MdOutlineMail,
  367.       },
  368.       {
  369.         id: "help",
  370.         title: "Help",
  371.         path: "/help",
  372.         iconBefore: MdOutlineQuestionAnswer,
  373.       },
  374.     ]
  375.   },
  376. ]
  377.  
  378. export function checkActiveParentLink(parent: string, child: string): boolean {
  379.   // Find parent in navigation
  380.   const navParent = navigation2.filter(
  381.     (nav) => nav.title.toLowerCase() === parent
  382.   );
  383.  
  384.   if (navParent && navParent.length > 0 && child) {
  385.     const activeChild = navParent[0].items?.find(
  386.       (navchild: NavigationSchema2) => navchild.path?.slice(1) === child
  387.     );
  388.     return child === activeChild?.path?.slice(1);
  389.   }
  390.  
  391.   return false;
  392. }
  393.  
  394. export default navigation2;
  395.  
Advertisement
Add Comment
Please, Sign In to add comment