mirror of
https://github.com/dzeiocom/components.git
synced 2025-04-22 19:02:15 +00:00
Misc changes to Link
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
This commit is contained in:
parent
40ce098d63
commit
2bfcc6f4ad
@ -6,13 +6,18 @@ import css from './Link.module.styl'
|
|||||||
import { buildClassName } from '../Util'
|
import { buildClassName } from '../Util'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>
|
||||||
href: string
|
href: string
|
||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
className?: string
|
className?: string
|
||||||
/**
|
/**
|
||||||
* Override external detection system
|
* Remove styling
|
||||||
*/
|
*/
|
||||||
noStyle?: boolean
|
noStyle?: boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override external detection system
|
||||||
|
*/
|
||||||
external?: boolean
|
external?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,6 +29,7 @@ export default class Link extends React.Component<Props> {
|
|||||||
// external link
|
// external link
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
|
{...this.props.linkProps}
|
||||||
className={buildClassName(this.props.className, [css.link, !this.props.noStyle])}
|
className={buildClassName(this.props.className, [css.link, !this.props.noStyle])}
|
||||||
href={this.props.href}
|
href={this.props.href}
|
||||||
rel="noreferrer nofollow"
|
rel="noreferrer nofollow"
|
||||||
@ -36,6 +42,7 @@ export default class Link extends React.Component<Props> {
|
|||||||
return (
|
return (
|
||||||
<NextLink href={this.props.href}>
|
<NextLink href={this.props.href}>
|
||||||
<a
|
<a
|
||||||
|
{...this.props.linkProps}
|
||||||
className={buildClassName(this.props.className, [css.link, !this.props.noStyle])}
|
className={buildClassName(this.props.className, [css.link, !this.props.noStyle])}
|
||||||
>{this.props.children}</a>
|
>{this.props.children}</a>
|
||||||
</NextLink>
|
</NextLink>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user