Skip to content
This repository was archived by the owner on Apr 30, 2023. It is now read-only.

Commit 6e838d7

Browse files
authored
Merge pull request #220 from jtomasek/about-modal
Add about modal with UI version info
2 parents dfe484a + 40f81cc commit 6e838d7

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

Diff for: src/components/AboutModal.tsx

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React from 'react';
2+
import {
3+
Button,
4+
AboutModal,
5+
TextContent,
6+
TextList,
7+
TextListItem,
8+
ButtonVariant,
9+
} from '@patternfly/react-core';
10+
import { GIT_SHA, VERSION } from '../config/standalone';
11+
import redHatLogo from '../images/Logo-Red_Hat-OpenShift_Container_Platform-B-Reverse-RGB.png';
12+
13+
export const AboutModalButton: React.FC = () => {
14+
const [isModalOpen, setIsModalOpen] = React.useState(false);
15+
const closeModal = () => setIsModalOpen(false);
16+
const handleClick = () => setIsModalOpen(true);
17+
return (
18+
<>
19+
<Button variant={ButtonVariant.plain} onClick={handleClick}>
20+
About
21+
</Button>
22+
<AboutModal
23+
isOpen={isModalOpen}
24+
onClose={closeModal}
25+
productName="OpenShift Container Platform Assisted Installer"
26+
brandImageSrc={redHatLogo}
27+
brandImageAlt="Assisted Installer Logo"
28+
>
29+
<TextContent>
30+
<TextList component="dl">
31+
<TextListItem component="dt">Assisted Installer UI version</TextListItem>
32+
<TextListItem component="dd">
33+
{VERSION} {GIT_SHA ? `(${GIT_SHA})` : ''}
34+
</TextListItem>
35+
</TextList>
36+
</TextContent>
37+
</AboutModal>
38+
</>
39+
);
40+
};
41+
42+
export default AboutModalButton;

Diff for: src/components/ui/Header.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import metal3FacetLogo from '../../images/metal3_facet-whitetext.png';
44
import redhatLogo from '../../images/Logo-Red_Hat-OpenShift_Container_Platform-B-Reverse-RGB.png';
55
import { getProductBrandingCode, FEEDBACK_FORM_LINK } from '../../config/constants';
66
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
7-
import { VERSION } from '../../config/standalone';
7+
import AboutModalButton from '../AboutModal';
88

99
const getBrandingDetails = () => {
1010
switch (getProductBrandingCode()) {
@@ -38,7 +38,7 @@ const Header: React.FC = () => {
3838
>
3939
Provide feedback <ExternalLinkAltIcon />
4040
</Button>
41-
{VERSION}
41+
<AboutModalButton />
4242
</PageHeaderTools>
4343
}
4444
// toolbar={PageToolbar}

0 commit comments

Comments
 (0)