❗ DEPRECATED ❗ : Superseded by @fdmg/design-system. See: https://github.com/FDMediagroep/fd-design-system
ReactJS LinkedImage component. This component renders an image with a link.
- Run
npm i --save-dev @fdmg/ts-react-linked-image
or
- Run
yarn add @fdmg/ts-react-linked-image --dev
import * as React from 'react';
import LinkedImage from 'fdmg-ts-react-linked-image';
export default class foo {
public state: any;
public props: any;
constructor(props: any) {
super(props);
this.props = props;
}
clickHandler(event) {
console.info('Clicked');
}
render() {
return (
<LinkedImage
className="css-class-name"
target="newWindow"
src={'image.png'}
href={'https://fd.nl'}
onClick={this.clickHandler.bind(this)}
alt="FD.nl logo"
ariaLabel="Shows this text as aria-label or uses alt text when this props is not set"
/>
);
}
}
<a href="https://fd.nl" target="newWindow" class="css-class-name" aria-label="Shows this text as aria-label or uses alt text when this props is not set">
<img src="image.png" alt="FD.nl logo"/>
</a>