Make normal links in header more generic
This commit is contained in:
parent
6ddb78ef50
commit
9b9992a015
1 changed files with 11 additions and 8 deletions
|
@ -35,10 +35,7 @@
|
|||
donate() {
|
||||
console.log("donate");
|
||||
},
|
||||
discord() {
|
||||
// No-Op
|
||||
throw new Error("This function shouldn't have been called.");
|
||||
},
|
||||
discord: discordLink,
|
||||
notice() {
|
||||
console.log("notice");
|
||||
},
|
||||
|
@ -52,17 +49,23 @@
|
|||
<header id="header">
|
||||
<ul id="main-header-buttons">
|
||||
{#each Object.entries(mainHeaderButtons) as [name, onClick]}
|
||||
<li><a on:click={onClick} href={"javascript:;"}>{name}</a></li>
|
||||
<li>
|
||||
{#if typeof onClick === "function"}
|
||||
<a on:click={onClick} href={"javascript:;"}>{name}</a>
|
||||
{:else if typeof onClick === "string"}
|
||||
<a target="_blank" rel="noreferrer noopener" href={onClick}>{name}</a>
|
||||
{/if}
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
<span>{title}</span>
|
||||
<ul id="other-header-buttons">
|
||||
{#each Object.entries(otherHeaderButtons) as [name, onClick]}
|
||||
<li>
|
||||
{#if name === "discord"}
|
||||
<a href={discordLink} rel="noopener" target="_blank">{name}</a>
|
||||
{:else}
|
||||
{#if typeof onClick === "function"}
|
||||
<a on:click={onClick} href={"javascript:;"}>{name}</a>
|
||||
{:else if typeof onClick === "string"}
|
||||
<a target="_blank" rel="noreferrer noopener" href={onClick}>{name}</a>
|
||||
{/if}
|
||||
</li>
|
||||
{/each}
|
||||
|
|
Reference in a new issue