mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 18:20:30 +08:00
Add experimental switch in settings
Hide all read/write functionality behind this setting.
This commit is contained in:
+21
-18
@@ -11,6 +11,7 @@
|
||||
import NodeInfo from "@app/App/Header/NodeInfo.svelte";
|
||||
import Popover from "@app/components/Popover.svelte";
|
||||
import ConnectInstructions from "@app/components/ConnectInstructions.svelte";
|
||||
import { experimental } from "@app/lib/appearance";
|
||||
|
||||
const buttonTitle: Record<HttpdState["state"], string> = {
|
||||
stopped: "radicle-httpd is stopped",
|
||||
@@ -60,24 +61,26 @@
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
{#if $httpdStore.state === "stopped"}
|
||||
<Popover popoverPositionTop="3rem" popoverPositionRight="0">
|
||||
<Button
|
||||
slot="toggle"
|
||||
let:toggle
|
||||
on:click={toggle}
|
||||
title={buttonTitle[$httpdStore.state]}
|
||||
variant="naked-toggle">
|
||||
<IconSmall name="device" />
|
||||
Connect
|
||||
</Button>
|
||||
<div slot="popover" class="connect-popover">
|
||||
<ConnectInstructions />
|
||||
</div>
|
||||
</Popover>
|
||||
{:else}
|
||||
<NodeInfo node={$httpdStore.node} />
|
||||
<Authenticate />
|
||||
{#if $experimental}
|
||||
{#if $httpdStore.state === "stopped"}
|
||||
<Popover popoverPositionTop="3rem" popoverPositionRight="0">
|
||||
<Button
|
||||
slot="toggle"
|
||||
let:toggle
|
||||
on:click={toggle}
|
||||
title={buttonTitle[$httpdStore.state]}
|
||||
variant="naked-toggle">
|
||||
<IconSmall name="device" />
|
||||
Connect
|
||||
</Button>
|
||||
<div slot="popover" class="connect-popover">
|
||||
<ConnectInstructions />
|
||||
</div>
|
||||
</Popover>
|
||||
{:else}
|
||||
<NodeInfo node={$httpdStore.node} />
|
||||
<Authenticate />
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+28
-1
@@ -2,7 +2,9 @@
|
||||
import {
|
||||
codeFont,
|
||||
codeFonts,
|
||||
experimental,
|
||||
storeCodeFont,
|
||||
storeExperimental,
|
||||
storeTheme,
|
||||
theme,
|
||||
} from "@app/lib/appearance";
|
||||
@@ -14,7 +16,7 @@
|
||||
|
||||
<style>
|
||||
.settings {
|
||||
width: 18.5rem;
|
||||
width: 24rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -76,4 +78,29 @@
|
||||
</Radio>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div
|
||||
style="display: flex; flex-direction: row; align-items: center; gap: 0.5rem;">
|
||||
Make changes on the web (experimental)
|
||||
</div>
|
||||
<div class="right">
|
||||
<Radio>
|
||||
<Button
|
||||
styleBorderRadius="0"
|
||||
on:click={() => storeExperimental(true)}
|
||||
variant={$experimental ? "selected" : "not-selected"}>
|
||||
On
|
||||
</Button>
|
||||
<div class="global-spacer" />
|
||||
<Radio>
|
||||
<Button
|
||||
styleBorderRadius="0"
|
||||
on:click={() => storeExperimental(undefined)}
|
||||
variant={$experimental ? "not-selected" : "selected"}>
|
||||
Off
|
||||
</Button>
|
||||
</Radio>
|
||||
</Radio>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user