mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-31 09:10:44 +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"
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
}}
|
||||
hideSidebar
|
||||
styleSecondColumnOverflow="visible"
|
||||
{config}>
|
||||
publicKey={config.publicKey}>
|
||||
{#snippet headerCenter()}
|
||||
<CopyableId id={config.publicKey} />
|
||||
{/snippet}
|
||||
|
||||
@@ -106,7 +106,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<Layout hideSidebar styleSecondColumnOverflow="visible" {config}>
|
||||
<Layout
|
||||
hideSidebar
|
||||
styleSecondColumnOverflow="visible"
|
||||
publicKey={config.publicKey}>
|
||||
{#snippet headerCenter()}
|
||||
<CopyableId id={config.publicKey} />
|
||||
{/snippet}
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<Layout {config}>
|
||||
<Layout publicKey={config.publicKey}>
|
||||
{#snippet sidebar()}
|
||||
<Sidebar activeTab="issues" rid={repo.rid} />
|
||||
{/snippet}
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<Layout {config}>
|
||||
<Layout publicKey={config.publicKey}>
|
||||
{#snippet headerCenter()}
|
||||
<CopyableId id={issue.id} />
|
||||
{/snippet}
|
||||
|
||||
@@ -84,7 +84,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<Layout hideSidebar styleSecondColumnOverflow="visible" {config}>
|
||||
<Layout
|
||||
hideSidebar
|
||||
styleSecondColumnOverflow="visible"
|
||||
publicKey={config.publicKey}>
|
||||
{#snippet headerCenter()}
|
||||
<CopyableId id={repo.rid} />
|
||||
{/snippet}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import type { Config } from "@bindings/config/Config";
|
||||
import type { Snippet } from "svelte";
|
||||
|
||||
import { onMount } from "svelte";
|
||||
@@ -33,7 +32,7 @@
|
||||
|
||||
interface Props {
|
||||
children: Snippet;
|
||||
config: Config;
|
||||
publicKey: string;
|
||||
headerCenter?: Snippet;
|
||||
secondColumn: Snippet;
|
||||
sidebar?: Snippet;
|
||||
@@ -45,7 +44,7 @@
|
||||
|
||||
const {
|
||||
children,
|
||||
config,
|
||||
publicKey,
|
||||
headerCenter = undefined,
|
||||
secondColumn,
|
||||
sidebar = undefined,
|
||||
@@ -133,7 +132,7 @@
|
||||
|
||||
<div class="layout">
|
||||
<div class="header">
|
||||
<Header {config} center={headerCenter}></Header>
|
||||
<Header {publicKey} center={headerCenter}></Header>
|
||||
</div>
|
||||
|
||||
{#if sidebar}
|
||||
|
||||
@@ -356,7 +356,7 @@
|
||||
</div>
|
||||
{/snippet}
|
||||
|
||||
<Layout loadMoreSecondColumn={loadMoreTeasers} {config}>
|
||||
<Layout loadMoreSecondColumn={loadMoreTeasers} publicKey={config.publicKey}>
|
||||
{#snippet headerCenter()}
|
||||
<CopyableId id={patch.id} />
|
||||
{/snippet}
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
{loadMoreContent}
|
||||
hideSidebar
|
||||
styleSecondColumnOverflow="visible"
|
||||
{config}>
|
||||
publicKey={config.publicKey}>
|
||||
{#snippet headerCenter()}
|
||||
<CopyableId id={repo.rid} />
|
||||
{/snippet}
|
||||
|
||||
Reference in New Issue
Block a user