diff --git a/src/Components/LandingPage/LandingPage.js b/src/Components/LandingPage/LandingPage.js index 4fe0f204..d6e9d82a 100644 --- a/src/Components/LandingPage/LandingPage.js +++ b/src/Components/LandingPage/LandingPage.js @@ -1,6 +1,13 @@ -import React, { Component } from 'react'; +import React, { useState } from 'react'; -import { Button, Popover, Text, TextContent } from '@patternfly/react-core'; +import { + Alert, + AlertActionCloseButton, + Button, + Popover, + Text, + TextContent, +} from '@patternfly/react-core'; import { HelpIcon, CodeBranchIcon, @@ -13,81 +20,107 @@ import { } from '@redhat-cloud-services/frontend-components'; import { Outlet } from 'react-router-dom'; +import isBeta from '../../Utilities/isBeta'; import ImagesTable from '../ImagesTable/ImagesTable'; import './LandingPage.scss'; import DocumentationButton from '../sharedComponents/DocumentationButton'; -class LandingPage extends Component { - constructor(props) { - super(props); - } +export const LandingPage = () => { + const [showBetaAlert, setShowBetaAlert] = useState(true); - render() { - return ( - - - - - - Image Builder is a service that allows you to create RHEL - images and push them to cloud environments. - - - + return ( + + + + + + Image Builder is a service that allows you to create RHEL images + and push them to cloud environments. + + + + } + > + + + + + This service is open source, so all of its code is inspectable. + Explore repositories to view and contribute to the source code. + + + + } + > + + + +
+ {!isBeta() && showBetaAlert && ( + setShowBetaAlert(false)} /> + } + actionLinks={ + } > - - - - - This service is open source, so all of its code is - inspectable. Explore repositories to view and contribute to - the source code. - - - - } - > - - - -
- -
- - - ); - } -} +

+ Launch Amazon Web Services or Microsoft Azure hosts to the cloud + from the console. +

+

+ Link custom repositories and build any supported image with custom + content. +

+
+ )} + +
+ +
+ ); +}; export default LandingPage; diff --git a/src/test/Components/LandingPage/LandingPage.test.js b/src/test/Components/LandingPage/LandingPage.test.js index deea2359..5dc12457 100644 --- a/src/test/Components/LandingPage/LandingPage.test.js +++ b/src/test/Components/LandingPage/LandingPage.test.js @@ -13,6 +13,22 @@ jest.mock('../../../store/actions/actions', () => { }; }); +beforeAll(() => { + global.insights = { + chrome: { + isBeta: () => { + return false; + }, + isProd: () => { + return true; + }, + getEnvironment: () => { + return 'prod'; + }, + }, + }; +}); + describe('Landing Page', () => { test('renders page heading', async () => { renderWithReduxRouter();