File tree 2 files changed +13
-4
lines changed
dotcom-rendering/src/components
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -401,7 +401,7 @@ export const ArticleMeta = ({
401
401
{ crossword ?. creator && (
402
402
< CrosswordSetter
403
403
setter = { crossword . creator . name }
404
- profile = { crossword . creator . webUrl }
404
+ profileUrl = { crossword . creator . webUrl }
405
405
/>
406
406
) }
407
407
Original file line number Diff line number Diff line change @@ -17,17 +17,26 @@ const setterStyles = css`
17
17
}
18
18
` ;
19
19
20
+ const isValidProfileUrl = ( url : string ) : boolean => {
21
+ return url . startsWith ( 'https://www.theguardian.com/profile/' ) ;
22
+ } ;
23
+
20
24
type Props = {
21
25
setter : string ;
22
- profile : string ;
26
+ profileUrl : string ;
23
27
} ;
24
28
25
- export const CrosswordSetter = ( { setter, profile } : Props ) => (
29
+ export const CrosswordSetter = ( { setter, profileUrl } : Props ) => (
26
30
< address
27
31
css = { setterStyles }
28
32
data-component = "meta-byline"
29
33
data-link-name = "byline"
30
34
>
31
- Set by: < a href = { profile } > { setter } </ a >
35
+ Set by:{ ' ' }
36
+ { isValidProfileUrl ( profileUrl ) ? (
37
+ < a href = { profileUrl } > { setter } </ a >
38
+ ) : (
39
+ setter
40
+ ) }
32
41
</ address >
33
42
) ;
You can’t perform that action at this time.
0 commit comments