Link component

This commit is contained in:
Lea Anthony 2020-10-12 06:56:32 +11:00
commit 39c599d2de
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405

View file

@ -0,0 +1,37 @@
<script>
import runtime from '@wails/runtime';
import { darkMode } from '../Store';
export let href;
$: linkclass = darkMode ? 'dark' : 'light';
function openLink() {
runtime.Browser.OpenURL(href);
}
</script>
<span class="link {linkclass}" on:click="{openLink}"><slot></slot></span>
<style>
.link {
text-decoration: underline;
cursor: pointer;
}
.link.dark:hover {
color: #ff8bfb;
}
.link.dark {
color: #ff8bfb88;
}
.link.light {
color: #5c5cff;
text-decoration: underline;
}
</style>