From 14e4176344b12417733b4d9bd45da3a709974acc Mon Sep 17 00:00:00 2001 From: Wanjohi Date: Sat, 17 May 2025 23:32:15 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9C=20fix(www):=20Uncomment=20the=20SS?= =?UTF-8?q?T=20parts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/App.tsx | 27 ++++----- packages/www/src/pages/team/index.tsx | 86 +++++++++++++-------------- 2 files changed, 56 insertions(+), 57 deletions(-) diff --git a/packages/www/src/App.tsx b/packages/www/src/App.tsx index 1866b072..966022d6 100644 --- a/packages/www/src/App.tsx +++ b/packages/www/src/App.tsx @@ -8,7 +8,6 @@ import '@fontsource/geist-sans/800.css'; import '@fontsource/geist-sans/900.css'; import { Text } from '@nestri/www/ui/text'; import { styled } from "@macaron-css/solid"; -import { Screen as FullScreen } from '@nestri/www/ui/layout'; import { TeamRoute } from '@nestri/www/pages/team'; import { OpenAuthProvider } from "@openauthjs/solid"; import { NotFound } from '@nestri/www/pages/not-found'; @@ -16,6 +15,7 @@ import { Navigate, Route, Router } from "@solidjs/router"; import { globalStyle, macaron$ } from "@macaron-css/core"; import { useStorage } from '@nestri/www/providers/account'; import { CreateTeamComponent } from '@nestri/www/pages/new'; +import { Screen as FullScreen } from '@nestri/www/ui/layout'; import { darkClass, lightClass, theme } from '@nestri/www/ui/theme'; import { AccountProvider, useAccount } from '@nestri/www/providers/account'; import { Component, createSignal, Match, onCleanup, Switch } from 'solid-js'; @@ -92,24 +92,23 @@ export const App: Component = () => { const storage = useStorage(); return ( - // + ( - // - // Confirming your identity… - // - // }> - // {props.children} - props.children - // + + Confirming your identity… + + }> + {props.children} + )} > {TeamRoute} diff --git a/packages/www/src/pages/team/index.tsx b/packages/www/src/pages/team/index.tsx index 3fa6f95f..d71902c9 100644 --- a/packages/www/src/pages/team/index.tsx +++ b/packages/www/src/pages/team/index.tsx @@ -11,53 +11,53 @@ import { useAccount, useStorage } from "@nestri/www/providers/account"; export const TeamRoute = ( { - // const params = useParams(); - // const account = useAccount(); - // const storage = useStorage(); - // const openauth = useOpenAuth(); + component={(props) => { + const params = useParams(); + const account = useAccount(); + const storage = useStorage(); + const openauth = useOpenAuth(); - // const team = createMemo(() => - // account.current.teams.find( - // (item) => item.slug === params.teamSlug, - // ), - // ); + const team = createMemo(() => + account.current.teams.find( + (item) => item.slug === params.teamSlug, + ), + ); - // createEffect(() => { - // const t = team(); - // if (!t) return; - // storage.set("team", t.id); - // }); + createEffect(() => { + const t = team(); + if (!t) return; + storage.set("team", t.id); + }); - // createEffect(() => { - // const teamSlug = params.teamSlug; - // for (const item of Object.values(account.all)) { - // for (const team of item.teams) { - // if (team.slug === teamSlug && item.id !== openauth.subject!.id) { - // openauth.switch(item.email); - // } - // } - // } - // }) + createEffect(() => { + const teamSlug = params.teamSlug; + for (const item of Object.values(account.all)) { + for (const team of item.teams) { + if (team.slug === teamSlug && item.id !== openauth.subject!.id) { + openauth.switch(item.email); + } + } + } + }) - // return ( - // - // - // {/* TODO: Add a public page for (other) teams */} - // - // - // - // team()!}> - // - // - // {props.children} - // - // - // - // - // - // ) - // }} + return ( + + + {/* TODO: Add a public page for (other) teams */} + + + + team()!}> + + + {props.children} + + + + + + ) + }} >