mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-10 11:05:47 +00:00
26619e28cc
* working version of test custom rule config * setting no imports to false so tests will pass * adding anchor blank noopener rule, rule currently off to allow tests to pass * removing copied code from tslint-microsoft-contrib * adding tslint-microsoft-contrib to dev deps * extending tslint for external http rule * locking tslint-microsoft-contrib version and turning on target blank noopener rule * final fixes for pull #663 * add noopener noreferrer as needed * fixing false positives for a tags without href * really fix linting errors * fix imports * remove accidently(?) added LedgerNano duplicate file
45 lines
954 B
TypeScript
45 lines
954 B
TypeScript
import React from 'react';
|
|
|
|
interface AAttributes {
|
|
charset?: string;
|
|
className?: string;
|
|
coords?: string;
|
|
download?: string;
|
|
href: string;
|
|
hreflang?: string;
|
|
media?: string;
|
|
name?: string;
|
|
rel?:
|
|
| 'alternate'
|
|
| 'author'
|
|
| 'bookmark'
|
|
| 'external'
|
|
| 'help'
|
|
| 'license'
|
|
| 'next'
|
|
| 'nofollow'
|
|
| 'noreferrer'
|
|
| 'noopener'
|
|
| 'prev'
|
|
| 'search'
|
|
| 'tag';
|
|
rev?: string;
|
|
shape?: 'default' | 'rect' | 'circle' | 'poly';
|
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
type?: string;
|
|
onClick?(ev: React.MouseEvent<HTMLAnchorElement>): void;
|
|
}
|
|
|
|
interface NewTabLinkProps extends AAttributes {
|
|
content?: React.ReactElement<any> | string;
|
|
children?: React.ReactElement<any> | string;
|
|
}
|
|
|
|
const NewTabLink = ({ content, children, ...rest }: NewTabLinkProps) => (
|
|
<a target="_blank" rel="noopener noreferrer" {...rest}>
|
|
{content || children}
|
|
</a>
|
|
);
|
|
|
|
export default NewTabLink;
|