Skip to content

Commit

Permalink
feat(external link): add target blank by default and rel rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lutangar committed Feb 5, 2019
1 parent 212f8b5 commit a7dd1b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/atoms/ExternalLink.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

export default styled.a`
export default styled.a.attrs({ target: '_blank', rel: 'noopener noreferrer' })`
color: ${props => props.theme.activeColor};
text-decoration: underline;
cursor: pointer;
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/SourceURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { SourceURLContainer, Truncated} from '../atoms';

export const SourceURL = ({ numberOfCharacters, children, ...props }) => (
<SourceURLContainer {...props} href={children} target="_blank" rel="noopener noreferrer">
<SourceURLContainer {...props} href={children}>
<Truncated numberOfCharacters={numberOfCharacters} preserveWords={false}>
{children}
</Truncated>
Expand Down

0 comments on commit a7dd1b8

Please sign in to comment.