/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import "./welcome.scss"; import React from "react"; import { observer } from "mobx-react"; import type { IComputedValue } from "mobx"; import Carousel from "react-material-ui-carousel"; import { Icon } from "../icon"; import { productName, slackUrl } from "../../../common/vars"; import { withInjectables } from "@ogre-tools/injectable-react"; import welcomeMenuItemsInjectable from "./welcome-menu-items/welcome-menu-items.injectable"; import type { WelcomeMenuRegistration } from "./welcome-menu-items/welcome-menu-registration"; import welcomeBannerItemsInjectable from "./welcome-banner-items/welcome-banner-items.injectable"; import type { WelcomeBannerRegistration } from "./welcome-banner-items/welcome-banner-registration"; export const defaultWidth = 320; interface Dependencies { welcomeMenuItems: IComputedValue welcomeBannerItems: IComputedValue } const NonInjectedWelcome: React.FC = ({ welcomeMenuItems, welcomeBannerItems }) => { const welcomeBanners = welcomeBannerItems.get(); // if there is banner with specified width, use it to calculate the width of the container const maxWidth = welcomeBanners.reduce((acc, curr) => { const currWidth = curr.width ?? 0; if (acc > currWidth) { return acc; } return currWidth; }, defaultWidth); return (
{welcomeBanners.length > 0 ? ( 1} autoPlay={true} navButtonsAlwaysInvisible={true} indicatorIconButtonProps={{ style: { color: "var(--iconActiveBackground)", }, }} activeIndicatorIconButtonProps={{ style: { color: "var(--iconActiveColor)", }, }} interval={8000} > {welcomeBanners.map((item, index) => ( ))} ) : ( )}

Welcome to {productName} 5!

To get you started we have auto-detected your clusters in your kubeconfig file and added them to the catalog, your centralized view for managing all your cloud-native resources.

If you have any questions or feedback, please join our{" "} Lens Community slack channel .

); }; export const Welcome = withInjectables( observer(NonInjectedWelcome), { getProps: (di) => ({ welcomeMenuItems: di.inject(welcomeMenuItemsInjectable), welcomeBannerItems: di.inject(welcomeBannerItemsInjectable), }), }, );