Add experimental switch in settings

Hide all read/write functionality behind this setting.
This commit is contained in:
Sebastian Martinez
2024-03-07 10:35:21 +01:00
parent 273dff2da4
commit 192524fe90
19 changed files with 296 additions and 137 deletions
+31 -12
View File
@@ -1,8 +1,11 @@
<script>
import Command from "./Command.svelte";
import { experimental } from "@app/lib/appearance";
import { api, httpdStore } from "@app/lib/httpd";
import { routeToPath, activeUnloadedRouteStore } from "@app/lib/router";
import Command from "@app/components/Command.svelte";
import ExternalLink from "./ExternalLink.svelte";
$: path = routeToPath($activeUnloadedRouteStore);
$: pathParam = path === "/" ? "" : `--path "${path}"`;
</script>
@@ -30,25 +33,41 @@
</style>
<div>
{#if $httpdStore.state === "running"}
<div class="label">Authenticate with your local node to make changes.</div>
<Command
fullWidth
command={`rad web ${window.origin} --connect ${api.hostname}:${api.port} ${pathParam}`} />
{#if $experimental}
{#if $httpdStore.state === "running"}
<div class="label">
Authenticate with your local node to make changes.
</div>
<Command
fullWidth
command={`rad web ${window.origin} --connect ${api.hostname}:${api.port} ${pathParam}`} />
{:else}
<div class="heading">Connect & Authenticate</div>
<div class="label">
Connect to your local node to browse projects on your local machine,
create issues, and participate in discussions.
</div>
<Command fullWidth command={`rad web ${window.origin} ${pathParam}`} />
<div class="divider" />
<div class="heading">New to Radicle?</div>
<div class="label">
Visit <ExternalLink href="https://radicle.xyz/#try" /> to download Radicle
and get started.
</div>
{/if}
{:else}
<div class="heading">Connect & Authenticate</div>
<div class="heading">Browse your local projects</div>
<div class="label">
Connect to your local node to browse projects on your local machine,
create issues, and participate in discussions.
To browse projects on your local node, run the following command.
</div>
<Command fullWidth command={`rad web ${window.origin} ${pathParam}`} />
<Command fullWidth command="radicle-httpd" />
<div class="divider" />
<div class="heading">New to Radicle?</div>
<div class="label">
Run the following command and follow the instructions to install Radicle
Visit <ExternalLink href="https://radicle.xyz/#try" /> to download Radicle
and get started.
</div>
<Command fullWidth command="curl -sSf https://radicle.xyz/install | sh" />
{/if}
</div>
+15 -8
View File
@@ -25,16 +25,23 @@
<div class="reactions">
{#each reactions as { emoji, authors }}
<IconButton
on:click={async () => {
if (handleReaction) {
await handleReaction(authors, emoji);
}
}}>
<div class="reaction txt-tiny">
{#if handleReaction}
<IconButton
on:click={async () => {
if (handleReaction) {
await handleReaction(authors, emoji);
}
}}>
<div class="reaction txt-tiny">
<span>{emoji}</span>
<span title={authors.join("\n")}>{authors.length}</span>
</div>
</IconButton>
{:else}
<div class="reaction txt-tiny" style="padding: 2px 4px;">
<span>{emoji}</span>
<span title={authors.join("\n")}>{authors.length}</span>
</div>
</IconButton>
{/if}
{/each}
</div>