mirror of
https://seed.radicle.dev/rad:z4D5UCArafTzTQpDZNQRuqswh3ury.git
synced 2026-11-28 22:30:27 +08:00
Extract buttons into own components
This commit is contained in:
committed by
Sebastian Martinez
parent
ace802118e
commit
7d977f22da
@@ -0,0 +1,43 @@
|
||||
<script lang="ts">
|
||||
import { nodeRunning } from "@app/lib/events";
|
||||
|
||||
import Border from "@app/components/Border.svelte";
|
||||
import Icon from "@app/components/Icon.svelte";
|
||||
import NakedButton from "@app/components/NakedButton.svelte";
|
||||
import Popover from "@app/components/Popover.svelte";
|
||||
</script>
|
||||
|
||||
<Popover
|
||||
popoverPadding="0"
|
||||
popoverPositionTop="2.5rem"
|
||||
popoverPositionRight="0">
|
||||
{#snippet toggle(onclick)}
|
||||
<NakedButton variant="ghost" {onclick}>
|
||||
{#if $nodeRunning}
|
||||
<Icon name="online" />
|
||||
Online
|
||||
{:else}
|
||||
<Icon name="offline" />
|
||||
Offline
|
||||
{/if}
|
||||
</NakedButton>
|
||||
{/snippet}
|
||||
{#snippet popover()}
|
||||
<Border
|
||||
variant="ghost"
|
||||
stylePadding="1rem"
|
||||
styleMinWidth="20rem"
|
||||
styleAlignItems="flex-start"
|
||||
styleFlexDirection="column">
|
||||
<div class="txt-small txt-missing">
|
||||
{#if $nodeRunning}
|
||||
Your node is up and running, your changes will be synced
|
||||
automatically.
|
||||
{:else}
|
||||
Your node is not running, changes you make are safe but won't be
|
||||
announced.
|
||||
{/if}
|
||||
</div>
|
||||
</Border>
|
||||
{/snippet}
|
||||
</Popover>
|
||||
Reference in New Issue
Block a user