ignore: sync
This commit is contained in:
@@ -52,7 +52,10 @@
|
|||||||
color: var(--color-text-muted);
|
color: var(--color-text-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a,
|
||||||
|
button {
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
text-underline-offset: var(--space-0-75);
|
text-underline-offset: var(--space-0-75);
|
||||||
@@ -1,6 +1,20 @@
|
|||||||
|
import { useAuthSession } from "~/context/auth.session"
|
||||||
import { IconLogo } from "../component/icon"
|
import { IconLogo } from "../component/icon"
|
||||||
import "./workspace/workspace.css"
|
import "./workspace.css"
|
||||||
import { RouteSectionProps } from "@solidjs/router"
|
import { action, redirect, RouteSectionProps } from "@solidjs/router"
|
||||||
|
|
||||||
|
const logout = action(async () => {
|
||||||
|
"use server"
|
||||||
|
const auth = await useAuthSession()
|
||||||
|
const current = auth.data.current
|
||||||
|
if (current)
|
||||||
|
await auth.update((val) => {
|
||||||
|
delete val.account[current]
|
||||||
|
return val
|
||||||
|
})
|
||||||
|
|
||||||
|
return redirect("/")
|
||||||
|
})
|
||||||
|
|
||||||
export default function WorkspaceLayout(props: RouteSectionProps) {
|
export default function WorkspaceLayout(props: RouteSectionProps) {
|
||||||
return (
|
return (
|
||||||
@@ -13,7 +27,9 @@ export default function WorkspaceLayout(props: RouteSectionProps) {
|
|||||||
</div>
|
</div>
|
||||||
<div data-slot="header-actions">
|
<div data-slot="header-actions">
|
||||||
<span>name@example.com</span>
|
<span>name@example.com</span>
|
||||||
<a href="/logout">Logout</a>
|
<form action={logout} method="post">
|
||||||
|
<button type="submit" formaction={logout}>Logout</button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div data-slot="content">{props.children}</div>
|
<div data-slot="content">{props.children}</div>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Billing } from "@opencode/cloud-core/billing.js"
|
import { Billing } from "@opencode/cloud-core/billing.js"
|
||||||
import { Key } from "@opencode/cloud-core/key.js"
|
import { Key } from "@opencode/cloud-core/key.js"
|
||||||
import { action, createAsync, revalidate, query, useAction, useSubmission, json } from "@solidjs/router"
|
import { action, createAsync, query, useAction, useSubmission, json } from "@solidjs/router"
|
||||||
import { createEffect, createSignal, For, onMount, Show } from "solid-js"
|
import { createSignal, For, onMount, Show } from "solid-js"
|
||||||
import { getActor } from "~/context/auth"
|
import { getActor } from "~/context/auth"
|
||||||
import { withActor } from "~/context/auth.withActor"
|
import { withActor } from "~/context/auth.withActor"
|
||||||
import { IconCopy, IconCheck } from "~/component/icon"
|
import { IconCopy, IconCheck } from "~/component/icon"
|
||||||
import "./index.css"
|
import "./[id].css"
|
||||||
import { User } from "@opencode/cloud-core/user.js"
|
import { User } from "@opencode/cloud-core/user.js"
|
||||||
import { Actor } from "@opencode/cloud-core/actor.js"
|
import { Actor } from "@opencode/cloud-core/actor.js"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user