Skip to content

Commit f999548

Browse files
authored
if rel is defined in the details.js use it for a linkback
1 parent a27a8a6 commit f999548

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/components/Links.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ class Links extends React.Component {
99
Object.values( links )
1010
.map( link => {
1111
key++;
12-
return (
12+
let link;
13+
14+
if ( link.rel !== undefined ) {
15+
link = <a href={ link.url } rel={link.rel}>{ link.name }</a>
16+
} else {
17+
link = <a href={ link.url }>{ link.name }</a>
18+
};
19+
let output = (
1320
<li key={ key } className="links--single">
1421
<span className={ `${ link.prefix } fa-${ link.icon }` }></span>
15-
<a href={ link.url }>{ link.name }</a>
22+
${ link }
1623
</li>
17-
)
24+
25+
);
26+
return output;
1827
} )
1928
)
2029
}
@@ -28,4 +37,4 @@ class Links extends React.Component {
2837
}
2938
}
3039

31-
export default Links;
40+
export default Links;

0 commit comments

Comments
 (0)