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';
|
||||
|
||||
type Props = {
|
||||
extra?: Record<string, string>;
|
||||
class?: string;
|
||||
text: string;
|
||||
url: string;
|
||||
};
|
||||
|
||||
export default class ExternalAnchor extends Component<Props> {
|
||||
render() {
|
||||
const {extra, text, url} = this.props;
|
||||
|
||||
return html`
|
||||
<a href="${url}" target="_blank" rel="noopener noreferrer" ...${extra}>
|
||||
${text}
|
||||
<a
|
||||
class="${this.props.class}"
|
||||
href="${this.props.url}"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
${this.props.text}
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue