mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 13:06:01 +00:00
electron menu, about dialog
This commit is contained in:
28
packages/web/src/elements/Link.svelte
Normal file
28
packages/web/src/elements/Link.svelte
Normal file
@@ -0,0 +1,28 @@
|
||||
<script lang="ts">
|
||||
import getElectron from '../utility/getElectron';
|
||||
|
||||
export let href;
|
||||
|
||||
const electron = getElectron();
|
||||
</script>
|
||||
|
||||
{#if electron}
|
||||
<a on:click={() => electron.shell.openExternal(href)}>
|
||||
<slot />
|
||||
</a>
|
||||
{:else}
|
||||
<a {href} target="_blank" rel="noopener noreferrer">
|
||||
<slot />
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
a {
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
color: var(--theme-font-link);
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user