mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 11:50:42 +08:00
Revert "Add a little explainer to the Online/Offline button"
This reverts commit 301d8a6b7c.
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
<script lang="ts">
|
||||
import type { Config } from "@bindings/config/Config";
|
||||
import type { Snippet } from "svelte";
|
||||
|
||||
import * as router from "@app/lib/router";
|
||||
import { authorForNodeId } from "@app/lib/utils";
|
||||
import { nodeRunning } from "@app/lib/events";
|
||||
|
||||
import Border from "./Border.svelte";
|
||||
import Avatar from "./Avatar.svelte";
|
||||
import Icon from "./Icon.svelte";
|
||||
import NakedButton from "./NakedButton.svelte";
|
||||
import NodeId from "./NodeId.svelte";
|
||||
import Popover from "./Popover.svelte";
|
||||
|
||||
const activeRouteStore = router.activeRouteStore;
|
||||
|
||||
interface Props {
|
||||
config: Config;
|
||||
publicKey: string;
|
||||
center?: Snippet;
|
||||
}
|
||||
|
||||
const { center, config }: Props = $props();
|
||||
const { center, publicKey }: Props = $props();
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -63,7 +59,7 @@
|
||||
void router.push({ resource: "home" });
|
||||
}}
|
||||
stylePadding="0 4px">
|
||||
<Icon name="home" />
|
||||
<Avatar {publicKey} />
|
||||
</NakedButton>
|
||||
<NakedButton
|
||||
variant="ghost"
|
||||
@@ -86,48 +82,17 @@
|
||||
{@render center?.()}
|
||||
|
||||
<div class="global-flex">
|
||||
<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 global-flex">
|
||||
Authenticated as:
|
||||
<NodeId
|
||||
{...authorForNodeId({
|
||||
did: config.publicKey,
|
||||
alias: config.alias,
|
||||
})} />
|
||||
</div>
|
||||
<div class="txt-small txt-missing">
|
||||
{#if $nodeRunning}
|
||||
Your node is up and running, your changes will be synced
|
||||
automatically.
|
||||
{:else}
|
||||
Your node is stopped, to sync changes with the network start
|
||||
your node.
|
||||
{/if}
|
||||
</div>
|
||||
</Border>
|
||||
{/snippet}
|
||||
</Popover>
|
||||
<div
|
||||
class="global-flex txt-semibold txt-small"
|
||||
style:margin-right="0.25rem">
|
||||
{#if $nodeRunning}
|
||||
<Icon name="online" />
|
||||
Online
|
||||
{:else}
|
||||
<Icon name="offline" />
|
||||
Offline
|
||||
{/if}
|
||||
</div>
|
||||
<NakedButton
|
||||
variant="ghost"
|
||||
stylePadding="0 4px"
|
||||
|
||||
Reference in New Issue
Block a user