Skip to content

Commit 3af5c51

Browse files
committed
Add external links to provider cards
1 parent 5df2332 commit 3af5c51

File tree

2 files changed

+16
-28
lines changed

2 files changed

+16
-28
lines changed

src/app/components/ExternalLinksCard.tsx

+12-20
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,6 @@ import azure_logo from '@app/bgimages/azure_clear.png';
1919
import google_logo from '@app/bgimages/google_clear.png';
2020
import { ArrowRightIcon } from '@patternfly/react-icons';
2121

22-
const providerInfos = [
23-
{
24-
name: 'aws',
25-
text: 'Launch in AWS ->',
26-
url: 'https://aws.amazon.com/marketplace/pp/prodview-kv5mi3ksb2mma?sr=0-1&ref_=beagle&applicationId=AWSMPContessa',
27-
},
28-
{
29-
name: 'google',
30-
text: 'Launch in Google Cloud ->',
31-
url: 'https://console.cloud.google.com/marketplace/product/rhel-cloud/rhel-9?project=cockpituous',
32-
},
33-
{
34-
name: 'azure',
35-
text: 'Launch in Azure ->',
36-
url: 'https://azuremarketplace.microsoft.com/en-us/marketplace/apps/redhat.rhel-20190605?tab=Overview',
37-
},
38-
];
39-
4022
const loadImage = (name: Provider) => {
4123
switch (name) {
4224
case Provider.aws:
@@ -59,6 +41,16 @@ const displayText = (name: Provider) => {
5941
}
6042
};
6143

44+
const getURL = (name: Provider) => {
45+
switch (name) {
46+
case Provider.aws:
47+
return 'https://aws.amazon.com/marketplace/pp/prodview-kv5mi3ksb2mma?sr=0-1&ref_=beagle&applicationId=AWSMPContessa';
48+
case Provider.azure:
49+
return 'https://console.cloud.google.com/marketplace/product/rhel-cloud/rhel-9?project=cockpituous';
50+
case Provider.google:
51+
return 'https://azuremarketplace.microsoft.com/en-us/marketplace/apps/redhat.rhel-20190605?tab=Overview';
52+
}
53+
};
6254
enum Provider {
6355
'aws',
6456
'azure',
@@ -74,12 +66,12 @@ const ProviderCard = ({ provider }: ProviderCardProps) => {
7466
<Stack>
7567
<StackItem>
7668
<Bullseye>
77-
<img style={{ height: 100, width: 100 }} src={loadImage(provider)} />
69+
<img style={{ height: 100, width: 100 }} src={loadImage(provider)} alt="External provider" />
7870
</Bullseye>
7971
</StackItem>
8072
<StackItem>
8173
<Bullseye>
82-
<Button variant="link" isLarge>
74+
<Button component="a" href={getURL(provider)} target="_blank" variant="link" isLarge>
8375
{displayText(provider)} <ArrowRightIcon />
8476
</Button>
8577
</Bullseye>

src/app/components/InternalLinkCard.tsx

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { Button, Card, CardBody, CardFooter, CardTitle, Stack, StackItem } from
44
import redhat_logo from '@app/bgimages/redhat_clear.png';
55
import { ArrowRightIcon } from '@patternfly/react-icons';
66

7-
const providerInfo = {
8-
name: 'redhat',
7+
const redhatProviderInfo = {
98
title: 'Build your own RHEL cloud image',
109
description:
1110
"With Red Hat's image builder, you can create customizable and repeatable operating system images and server images",
@@ -27,16 +26,13 @@ const InternalLinksCard: React.FunctionComponent = () => {
2726
/>
2827
</StackItem>
2928
<StackItem>
30-
<p>Build your own RHEL cloud image</p>
29+
<p>{redhatProviderInfo.title}</p>
3130
</StackItem>
3231
</Stack>
3332
</CardTitle>
34-
<CardBody>
35-
With Red Hat's Image Builder, you can create customizable and repeatable operating system images and server
36-
images.
37-
</CardBody>
33+
<CardBody>{redhatProviderInfo.description}</CardBody>
3834
<CardFooter>
39-
<Button variant="link" isLarge>
35+
<Button component="a" href={redhatProviderInfo.url} target="_blank" variant="link" isLarge>
4036
Build an image <ArrowRightIcon />
4137
</Button>
4238
</CardFooter>

0 commit comments

Comments
 (0)