Add message URLs, unify URL generation

This commit is contained in:
Simon Ser 2020-07-15 18:47:33 +02:00
parent 36df984b09
commit 0d9f7f35f0
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 31 additions and 24 deletions

View file

@ -1,4 +1,5 @@
import { html, Component } from "/lib/index.js";
import { getNickURL } from "/state.js";
class MemberItem extends Component {
constructor(props) {
@ -17,10 +18,9 @@ class MemberItem extends Component {
}
render() {
var url = "irc:///" + encodeURIComponent(this.props.nick) + ",isnick";
return html`
<li>
<a href=${url} class="nick" onClick=${this.handleClick}>${this.props.nick}</a>
<a href=${getNickURL(this.props.nick)} class="nick" onClick=${this.handleClick}>${this.props.nick}</a>
</li>
`;
}