Skip to content

Commit 4a35262

Browse files
committed
use browser logos
1 parent d69a18c commit 4a35262

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

src/components/toolList.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface ToolListProps {
88

99
export const ToolList: React.FC<ToolListProps> = ({ children }) => {
1010
return (
11-
<Box direction="row" fill="horizontal">
11+
<Box direction="row" align="center" justify="center" fill="horizontal">
1212
{children}
1313
</Box>
1414
);
@@ -29,7 +29,9 @@ export const ToolListItem: React.FC<ToolListItemProps> = ({
2929
return (
3030
<Box align="center" justify="center" margin="medium">
3131
<Button as={Link} {...{ to: linkTo }}>
32-
<Box margin="medium">{logo}</Box>
32+
<Box margin="medium" align="center">
33+
{logo}
34+
</Box>
3335
<Heading level="3" textAlign="center" size="small" margin="none">
3436
{title}
3537
</Heading>

src/pages/index.tsx

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
import { type HeadFC, Link, type PageProps, graphql } from "gatsby";
2-
import { StaticImage } from "gatsby-plugin-image";
1+
import type { HeadFC, PageProps } from "gatsby";
32
import { Box, Heading, Page, PageContent, Paragraph } from "grommet";
3+
import {
4+
Chrome as ChromeIcon,
5+
Edge as EdgeIcon,
6+
Firefox as FirefoxIcon,
7+
} from "grommet-icons";
48
import type * as React from "react";
59
import { Layout } from "../components/layout";
610
import { ToolList, ToolListItem } from "../components/toolList";
711

8-
const setupActions = [
12+
type SetupActionName = "setup-chrome" | "setup-firefox" | "setup-edge";
13+
type ExtensionActionName = "release-chrome-extension" | "release-firefox-addon";
14+
15+
const setupActions: { title: SetupActionName; link: string }[] = [
916
{
1017
title: "setup-chrome",
1118
link: "setup-chrome",
@@ -20,27 +27,25 @@ const setupActions = [
2027
},
2128
];
2229

23-
const extensionActions = [
30+
const extensionActions: { title: ExtensionActionName; link: string }[] = [
2431
{
2532
title: "release-chrome-extension",
2633
link: "release-chrome-extension",
2734
},
2835
{
29-
title: "release-firefox-extension",
30-
link: "release-firefox-extension",
36+
title: "release-firefox-addon",
37+
link: "release-firefox-addon",
3138
},
3239
];
3340

3441
const IndexPage: React.FC<PageProps> = () => {
35-
const logo = (
36-
<StaticImage
37-
src="https://picsum.photos/128"
38-
alt="Lolem ipsum"
39-
width={128}
40-
height={128}
41-
objectFit="none"
42-
/>
43-
);
42+
const logos = {
43+
"setup-chrome": <ChromeIcon color="plain" size="xlarge" />,
44+
"setup-firefox": <FirefoxIcon color="plain" size="xlarge" />,
45+
"setup-edge": <EdgeIcon color="plain" size="xlarge" />,
46+
"release-chrome-extension": <ChromeIcon color="plain" size="xlarge" />,
47+
"release-firefox-addon": <FirefoxIcon color="plain" size="xlarge" />,
48+
};
4449

4550
return (
4651
<Layout>
@@ -53,7 +58,7 @@ const IndexPage: React.FC<PageProps> = () => {
5358
<Heading level="1" margin="none" fill>
5459
GitHub Actions for browsers
5560
</Heading>
56-
<Paragraph fill>
61+
<Paragraph textAlign="center" fill>
5762
Browser development tools for GitHub Actions workflows.
5863
</Paragraph>
5964
</Box>
@@ -62,34 +67,34 @@ const IndexPage: React.FC<PageProps> = () => {
6267
<Heading level="2" textAlign="center" size="xlarge">
6368
Setup browser
6469
</Heading>
65-
<Paragraph fill>
70+
<Paragraph textAlign="center" size="large" fill>
6671
GitHub Actions for setting up browsers in the workflow.
6772
</Paragraph>
6873
<ToolList>
69-
{setupActions.map((action) => (
74+
{setupActions.map(({ title, link }) => (
7075
<ToolListItem
71-
key={action.title}
72-
title={action.title}
73-
linkTo={action.link}
74-
logo={logo}
76+
key={title}
77+
title={title}
78+
linkTo={link}
79+
logo={logos[title]}
7580
/>
7681
))}
7782
</ToolList>
7883

7984
<Heading level="2" textAlign="center" size="xlarge">
8085
Release extension
8186
</Heading>
82-
<Paragraph fill>
87+
<Paragraph textAlign="center" size="large" fill>
8388
GitHub Actions for releasing Chrome extensions and Firefox add-ons
8489
in the workflow.
8590
</Paragraph>
8691
<ToolList>
87-
{extensionActions.map((action) => (
92+
{extensionActions.map(({ title, link }) => (
8893
<ToolListItem
89-
key={action.title}
90-
title={action.title}
91-
linkTo={action.link}
92-
logo={logo}
94+
key={title}
95+
title={title}
96+
linkTo={link}
97+
logo={logos[title]}
9398
/>
9499
))}
95100
</ToolList>

0 commit comments

Comments
 (0)