mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-15 11:20:36 +08:00
Remove AuthenticationError component
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
import { theme } from "@app/components/ThemeSwitch.svelte";
|
||||
import { unreachable } from "@app/lib/utils";
|
||||
|
||||
import AuthenticationError from "@app/views/AuthenticationError.svelte";
|
||||
import CreateIssue from "@app/views/repo/CreateIssue.svelte";
|
||||
import Inbox from "./views/home/Inbox.svelte";
|
||||
import Issue from "@app/views/repo/Issue.svelte";
|
||||
@@ -93,10 +92,7 @@
|
||||
</script>
|
||||
|
||||
{#if $activeRouteStore.resource === "booting"}
|
||||
{#if error && typeof error === "object" && "err" in error && typeof error.err === "string"}
|
||||
<AuthenticationError error={error.err} />
|
||||
{/if}
|
||||
<!-- Don't show anything -->
|
||||
{:else if $activeRouteStore.resource === "home"}
|
||||
<Repos {...$activeRouteStore.params} />
|
||||
{:else if $activeRouteStore.resource === "inbox"}
|
||||
@@ -111,8 +107,6 @@
|
||||
<Patch {...$activeRouteStore.params} />
|
||||
{:else if $activeRouteStore.resource === "repo.patches"}
|
||||
<Patches {...$activeRouteStore.params} />
|
||||
{:else if $activeRouteStore.resource === "authenticationError"}
|
||||
<AuthenticationError {...$activeRouteStore.params} />
|
||||
{:else}
|
||||
{unreachable($activeRouteStore)}
|
||||
{/if}
|
||||
|
||||
@@ -113,9 +113,6 @@ function urlToRoute(url: URL): Route | null {
|
||||
case "repos": {
|
||||
return repoUrlToRoute(segments, url.searchParams);
|
||||
}
|
||||
case "authenticationError": {
|
||||
return { resource: "authenticationError", params: { error: "" } };
|
||||
}
|
||||
default: {
|
||||
return null;
|
||||
}
|
||||
@@ -127,8 +124,6 @@ export function routeToPath(route: Route): string {
|
||||
return "/";
|
||||
} else if (route.resource === "inbox") {
|
||||
return "/inbox";
|
||||
} else if (route.resource === "authenticationError") {
|
||||
return "/authenticationError";
|
||||
} else if (
|
||||
route.resource === "repo.createIssue" ||
|
||||
route.resource === "repo.issue" ||
|
||||
|
||||
@@ -29,14 +29,6 @@ interface BootingRoute {
|
||||
resource: "booting";
|
||||
}
|
||||
|
||||
interface AuthenticationErrorRoute {
|
||||
resource: "authenticationError";
|
||||
params: {
|
||||
error: string;
|
||||
hint?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface HomeRoute {
|
||||
resource: "home";
|
||||
activeTab?: HomeReposTab;
|
||||
@@ -76,15 +68,9 @@ interface LoadedHomeRoute {
|
||||
};
|
||||
}
|
||||
|
||||
export type Route =
|
||||
| AuthenticationErrorRoute
|
||||
| InboxRoute
|
||||
| BootingRoute
|
||||
| HomeRoute
|
||||
| RepoRoute;
|
||||
export type Route = InboxRoute | BootingRoute | HomeRoute | RepoRoute;
|
||||
|
||||
export type LoadedRoute =
|
||||
| AuthenticationErrorRoute
|
||||
| LoadedInboxRoute
|
||||
| BootingRoute
|
||||
| LoadedHomeRoute
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<script lang="ts">
|
||||
import Icon from "@app/components/Icon.svelte";
|
||||
|
||||
interface Props {
|
||||
error: string;
|
||||
hint?: string;
|
||||
}
|
||||
|
||||
const { error, hint }: Props = $props();
|
||||
</script>
|
||||
|
||||
<style>
|
||||
main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
row-gap: 0.5rem;
|
||||
}
|
||||
|
||||
/* This tag comes from the backend. */
|
||||
:global(code) {
|
||||
font-family: var(--font-family-monospace);
|
||||
font-size: var(--font-size-small);
|
||||
background-color: var(--color-fill-ghost);
|
||||
padding: 0.125rem 0.25rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<main>
|
||||
<Icon name="warning" size="32" />
|
||||
<div class="txt-medium txt-semibold">
|
||||
{error}
|
||||
</div>
|
||||
{#if hint}
|
||||
<div class="txt-small">{@html hint}</div>
|
||||
{/if}
|
||||
</main>
|
||||
Reference in New Issue
Block a user