File tree Expand file tree Collapse file tree 3 files changed +25
-24
lines changed Expand file tree Collapse file tree 3 files changed +25
-24
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import { Grommet } from "grommet";
4
4
import type * as React from "react" ;
5
5
import "./layout.css" ;
6
6
import {
7
- Anchor ,
8
7
Box ,
9
8
Button ,
10
9
Footer ,
@@ -15,6 +14,7 @@ import {
15
14
grommet ,
16
15
} from "grommet" ;
17
16
import { Github as GithubIcon } from "grommet-icons" ;
17
+ import { ExternalLink } from "./link" ;
18
18
19
19
interface Props {
20
20
children : React . ReactNode ;
@@ -68,10 +68,8 @@ const AppHeader = () => {
68
68
/>
69
69
</ Box >
70
70
< Box align = "end" >
71
- < Anchor
71
+ < ExternalLink
72
72
href = "https://github.com/browser-actions"
73
- target = "_blank"
74
- rel = "noopener noreferrer"
75
73
label = "GitHub"
76
74
icon = { < GithubIcon /> }
77
75
/>
@@ -85,22 +83,14 @@ const AppFooter = () => {
85
83
< Footer background = "dark-1" pad = "medium" justify = "between" >
86
84
< Text >
87
85
Copyright by{ " " }
88
- < Anchor
89
- href = "https://github.com/ueokande"
90
- target = "_blank"
91
- rel = "noopener noreferrer"
92
- >
86
+ < ExternalLink href = "https://github.com/ueokande" >
93
87
@ueokande
94
- </ Anchor > { " " }
88
+ </ ExternalLink > { " " }
95
89
and all contributors
96
90
</ Text >
97
- < Anchor
98
- href = "https://github.com/browser-actions"
99
- target = "_blank"
100
- rel = "noopener noreferrer"
101
- >
91
+ < ExternalLink href = "https://github.com/browser-actions" >
102
92
GitHub
103
- </ Anchor >
93
+ </ ExternalLink >
104
94
</ Footer >
105
95
) ;
106
96
} ;
Original file line number Diff line number Diff line change
1
+ import { Anchor , type AnchorProps } from "grommet" ;
2
+
3
+ interface Props {
4
+ children ?: React . ReactNode ;
5
+ }
6
+
7
+ export const ExternalLink : React . FC < Props & AnchorProps > = ( {
8
+ children,
9
+ ...props
10
+ } ) => {
11
+ return (
12
+ < Anchor { ...props } target = "_blank" rel = "noopener noreferrer" >
13
+ { children }
14
+ </ Anchor >
15
+ ) ;
16
+ } ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
} from "grommet" ;
12
12
import { Actions as ActionsIcon , Github as GithubIcon } from "grommet-icons" ;
13
13
import { Layout } from "../components/layout" ;
14
+ import { ExternalLink } from "../components/link" ;
14
15
import { Seo } from "../components/seo" ;
15
16
import type { ActionType } from "../types" ;
16
17
@@ -30,20 +31,14 @@ const ActionPage: React.FC<PageProps & Props> = ({ pageContext }) => {
30
31
< Page kind = "narrow" margin = { { vertical : "xlarge" } } >
31
32
< PageContent >
32
33
< Box direction = "row" gap = "medium" pad = { { bottom : "medium" } } >
33
- < Anchor
34
+ < ExternalLink
34
35
href = { `https://github.com/marketplace/actions/${ name } ` }
35
- target = "_blank"
36
- rel = "noopener noreferrer"
37
- as = "a"
38
36
label = "View action on Marketplace"
39
37
icon = { < ActionsIcon /> }
40
38
size = "small"
41
39
/>
42
- < Anchor
40
+ < ExternalLink
43
41
href = { `https://github.com/browser-actions/${ name } ` }
44
- target = "_blank"
45
- rel = "noopener noreferrer"
46
- as = "a"
47
42
label = "View action on GitHub"
48
43
icon = { < GithubIcon /> }
49
44
size = "small"
You can’t perform that action at this time.
0 commit comments