Skip to content

Commit f324593

Browse files
authored
Merge pull request #982 from logonoff/externallinkbutton
chore(externallinkbutton): migrate to rhui
2 parents 3a6401f + 243d36b commit f324593

2 files changed

Lines changed: 18 additions & 66 deletions

File tree

packages/module/src/ExternalLinkButton/ExternalLinkButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Button, ButtonProps } from '@patternfly/react-core';
2-
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
2+
import { RhUiExternalLinkIcon } from '@patternfly/react-icons';
33
import type { SVGIconProps } from '@patternfly/react-icons/dist/esm/createIcon';
44
import { forwardRef, Ref } from 'react';
55

@@ -12,7 +12,7 @@ export interface ExternalLinkButtonProps extends ButtonProps {
1212
export const ExternalLinkButton = forwardRef(({ iconProps, ...props }: ExternalLinkButtonProps, ref: Ref<HTMLAnchorElement>) => (
1313
<Button
1414
component="a"
15-
icon={<ExternalLinkAltIcon {...iconProps} />}
15+
icon={<RhUiExternalLinkIcon {...iconProps} />}
1616
iconPosition="right"
1717
ouiaId="ExternalLinkButton"
1818
ref={ref}

packages/module/src/ExternalLinkButton/__snapshots__/ExternalLinkButton.test.tsx.snap

Lines changed: 16 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,17 @@ exports[`ExternalLinkButton component should accept IconProps 1`] = `
2222
fill="currentColor"
2323
height="1em"
2424
role="img"
25+
viewBox="0 0 32 32"
2526
width="1em"
2627
>
2728
<title
2829
id="icon-title-1"
2930
>
3031
(Opens in new tab)
3132
</title>
32-
<svg
33-
class="pf-v6-icon-default"
34-
viewBox="0 0 512 512"
35-
>
36-
<path
37-
d="M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"
38-
/>
39-
</svg>
40-
<svg
41-
class="pf-v6-icon-rh-ui"
42-
viewBox="0 0 32 32"
43-
>
44-
<path
45-
d="M28.5 2h-25C2.673 2 2 2.673 2 3.5v25c0 .827.673 1.5 1.5 1.5h25c.827 0 1.5-.673 1.5-1.5v-25c0-.827-.673-1.5-1.5-1.5Zm-3.375 17a1.125 1.125 0 0 1-2.25 0v-8.284L11.796 21.795a1.122 1.122 0 0 1-1.592 0 1.127 1.127 0 0 1 0-1.591l11.08-11.08H13a1.125 1.125 0 0 1 0-2.25h10.5c.896 0 1.625.729 1.625 1.625v10.5Z"
46-
/>
47-
</svg>
33+
<path
34+
d="M30 21v7.5c0 .827-.673 1.5-1.5 1.5h-25c-.827 0-1.5-.673-1.5-1.5v-25C2 2.673 2.673 2 3.5 2H11a1 1 0 1 1 0 2H4v24h24v-7a1 1 0 1 1 2 0ZM28.5 2H18a1 1 0 1 0 0 2h8.586L13.293 17.293a.999.999 0 1 0 1.414 1.414L28 5.414V14a1 1 0 1 0 2 0V3.5c0-.827-.673-1.5-1.5-1.5Z"
35+
/>
4836
</svg>
4937
</span>
5038
</a>
@@ -68,29 +56,17 @@ exports[`ExternalLinkButton component should accept IconProps 1`] = `
6856
fill="currentColor"
6957
height="1em"
7058
role="img"
59+
viewBox="0 0 32 32"
7160
width="1em"
7261
>
7362
<title
7463
id="icon-title-1"
7564
>
7665
(Opens in new tab)
7766
</title>
78-
<svg
79-
class="pf-v6-icon-default"
80-
viewBox="0 0 512 512"
81-
>
82-
<path
83-
d="M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"
84-
/>
85-
</svg>
86-
<svg
87-
class="pf-v6-icon-rh-ui"
88-
viewBox="0 0 32 32"
89-
>
90-
<path
91-
d="M28.5 2h-25C2.673 2 2 2.673 2 3.5v25c0 .827.673 1.5 1.5 1.5h25c.827 0 1.5-.673 1.5-1.5v-25c0-.827-.673-1.5-1.5-1.5Zm-3.375 17a1.125 1.125 0 0 1-2.25 0v-8.284L11.796 21.795a1.122 1.122 0 0 1-1.592 0 1.127 1.127 0 0 1 0-1.591l11.08-11.08H13a1.125 1.125 0 0 1 0-2.25h10.5c.896 0 1.625.729 1.625 1.625v10.5Z"
92-
/>
93-
</svg>
67+
<path
68+
d="M30 21v7.5c0 .827-.673 1.5-1.5 1.5h-25c-.827 0-1.5-.673-1.5-1.5v-25C2 2.673 2.673 2 3.5 2H11a1 1 0 1 1 0 2H4v24h24v-7a1 1 0 1 1 2 0ZM28.5 2H18a1 1 0 1 0 0 2h8.586L13.293 17.293a.999.999 0 1 0 1.414 1.414L28 5.414V14a1 1 0 1 0 2 0V3.5c0-.827-.673-1.5-1.5-1.5Z"
69+
/>
9470
</svg>
9571
</span>
9672
</a>
@@ -171,24 +147,12 @@ exports[`ExternalLinkButton component should render 1`] = `
171147
fill="currentColor"
172148
height="1em"
173149
role="img"
150+
viewBox="0 0 32 32"
174151
width="1em"
175152
>
176-
<svg
177-
class="pf-v6-icon-default"
178-
viewBox="0 0 512 512"
179-
>
180-
<path
181-
d="M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"
182-
/>
183-
</svg>
184-
<svg
185-
class="pf-v6-icon-rh-ui"
186-
viewBox="0 0 32 32"
187-
>
188-
<path
189-
d="M28.5 2h-25C2.673 2 2 2.673 2 3.5v25c0 .827.673 1.5 1.5 1.5h25c.827 0 1.5-.673 1.5-1.5v-25c0-.827-.673-1.5-1.5-1.5Zm-3.375 17a1.125 1.125 0 0 1-2.25 0v-8.284L11.796 21.795a1.122 1.122 0 0 1-1.592 0 1.127 1.127 0 0 1 0-1.591l11.08-11.08H13a1.125 1.125 0 0 1 0-2.25h10.5c.896 0 1.625.729 1.625 1.625v10.5Z"
190-
/>
191-
</svg>
153+
<path
154+
d="M30 21v7.5c0 .827-.673 1.5-1.5 1.5h-25c-.827 0-1.5-.673-1.5-1.5v-25C2 2.673 2.673 2 3.5 2H11a1 1 0 1 1 0 2H4v24h24v-7a1 1 0 1 1 2 0ZM28.5 2H18a1 1 0 1 0 0 2h8.586L13.293 17.293a.999.999 0 1 0 1.414 1.414L28 5.414V14a1 1 0 1 0 2 0V3.5c0-.827-.673-1.5-1.5-1.5Z"
155+
/>
192156
</svg>
193157
</span>
194158
</a>
@@ -212,24 +176,12 @@ exports[`ExternalLinkButton component should render 1`] = `
212176
fill="currentColor"
213177
height="1em"
214178
role="img"
179+
viewBox="0 0 32 32"
215180
width="1em"
216181
>
217-
<svg
218-
class="pf-v6-icon-default"
219-
viewBox="0 0 512 512"
220-
>
221-
<path
222-
d="M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"
223-
/>
224-
</svg>
225-
<svg
226-
class="pf-v6-icon-rh-ui"
227-
viewBox="0 0 32 32"
228-
>
229-
<path
230-
d="M28.5 2h-25C2.673 2 2 2.673 2 3.5v25c0 .827.673 1.5 1.5 1.5h25c.827 0 1.5-.673 1.5-1.5v-25c0-.827-.673-1.5-1.5-1.5Zm-3.375 17a1.125 1.125 0 0 1-2.25 0v-8.284L11.796 21.795a1.122 1.122 0 0 1-1.592 0 1.127 1.127 0 0 1 0-1.591l11.08-11.08H13a1.125 1.125 0 0 1 0-2.25h10.5c.896 0 1.625.729 1.625 1.625v10.5Z"
231-
/>
232-
</svg>
182+
<path
183+
d="M30 21v7.5c0 .827-.673 1.5-1.5 1.5h-25c-.827 0-1.5-.673-1.5-1.5v-25C2 2.673 2.673 2 3.5 2H11a1 1 0 1 1 0 2H4v24h24v-7a1 1 0 1 1 2 0ZM28.5 2H18a1 1 0 1 0 0 2h8.586L13.293 17.293a.999.999 0 1 0 1.414 1.414L28 5.414V14a1 1 0 1 0 2 0V3.5c0-.827-.673-1.5-1.5-1.5Z"
184+
/>
233185
</svg>
234186
</span>
235187
</a>

0 commit comments

Comments
 (0)