Change the ExternalAnchor to accept a direct class prop instead of extras.
This commit is contained in:
parent
fd3faa4807
commit
f28ef60faf
|
@ -1,18 +1,21 @@
|
||||||
import {html, Component} from 'htm/preact';
|
import {html, Component} from 'htm/preact';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
extra?: Record<string, string>;
|
class?: string;
|
||||||
text: string;
|
text: string;
|
||||||
url: string;
|
url: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class ExternalAnchor extends Component<Props> {
|
export default class ExternalAnchor extends Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const {extra, text, url} = this.props;
|
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<a href="${url}" target="_blank" rel="noopener noreferrer" ...${extra}>
|
<a
|
||||||
${text}
|
class="${this.props.class}"
|
||||||
|
href="${this.props.url}"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
${this.props.text}
|
||||||
</a>
|
</a>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue