mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
🐜 fix(www): Uncomment the SST parts
This commit is contained in:
@@ -8,7 +8,6 @@ import '@fontsource/geist-sans/800.css';
|
|||||||
import '@fontsource/geist-sans/900.css';
|
import '@fontsource/geist-sans/900.css';
|
||||||
import { Text } from '@nestri/www/ui/text';
|
import { Text } from '@nestri/www/ui/text';
|
||||||
import { styled } from "@macaron-css/solid";
|
import { styled } from "@macaron-css/solid";
|
||||||
import { Screen as FullScreen } from '@nestri/www/ui/layout';
|
|
||||||
import { TeamRoute } from '@nestri/www/pages/team';
|
import { TeamRoute } from '@nestri/www/pages/team';
|
||||||
import { OpenAuthProvider } from "@openauthjs/solid";
|
import { OpenAuthProvider } from "@openauthjs/solid";
|
||||||
import { NotFound } from '@nestri/www/pages/not-found';
|
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 { globalStyle, macaron$ } from "@macaron-css/core";
|
||||||
import { useStorage } from '@nestri/www/providers/account';
|
import { useStorage } from '@nestri/www/providers/account';
|
||||||
import { CreateTeamComponent } from '@nestri/www/pages/new';
|
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 { darkClass, lightClass, theme } from '@nestri/www/ui/theme';
|
||||||
import { AccountProvider, useAccount } from '@nestri/www/providers/account';
|
import { AccountProvider, useAccount } from '@nestri/www/providers/account';
|
||||||
import { Component, createSignal, Match, onCleanup, Switch } from 'solid-js';
|
import { Component, createSignal, Match, onCleanup, Switch } from 'solid-js';
|
||||||
@@ -92,24 +92,23 @@ export const App: Component = () => {
|
|||||||
const storage = useStorage();
|
const storage = useStorage();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// <OpenAuthProvider
|
<OpenAuthProvider
|
||||||
// issuer={import.meta.env.VITE_AUTH_URL}
|
issuer={import.meta.env.VITE_AUTH_URL}
|
||||||
// clientID="web"
|
clientID="web"
|
||||||
// >
|
>
|
||||||
<Root class={theme() === "light" ? lightClass : darkClass} id="styled">
|
<Root class={theme() === "light" ? lightClass : darkClass} id="styled">
|
||||||
<Router>
|
<Router>
|
||||||
<Route
|
<Route
|
||||||
path="*"
|
path="*"
|
||||||
component={(props) => (
|
component={(props) => (
|
||||||
// <AccountProvider
|
<AccountProvider
|
||||||
// loadingUI={
|
loadingUI={
|
||||||
// <FullScreen>
|
<FullScreen>
|
||||||
// <Text weight='semibold' spacing='xs' size="3xl" font="heading" >Confirming your identity…</Text>
|
<Text weight='semibold' spacing='xs' size="3xl" font="heading" >Confirming your identity…</Text>
|
||||||
// </FullScreen>
|
</FullScreen>
|
||||||
// }>
|
}>
|
||||||
// {props.children}
|
{props.children}
|
||||||
props.children
|
</AccountProvider>
|
||||||
// </AccountProvider>
|
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Route path=":teamSlug">{TeamRoute}</Route>
|
<Route path=":teamSlug">{TeamRoute}</Route>
|
||||||
|
|||||||
@@ -11,53 +11,53 @@ import { useAccount, useStorage } from "@nestri/www/providers/account";
|
|||||||
|
|
||||||
export const TeamRoute = (
|
export const TeamRoute = (
|
||||||
<Route
|
<Route
|
||||||
// component={(props) => {
|
component={(props) => {
|
||||||
// const params = useParams();
|
const params = useParams();
|
||||||
// const account = useAccount();
|
const account = useAccount();
|
||||||
// const storage = useStorage();
|
const storage = useStorage();
|
||||||
// const openauth = useOpenAuth();
|
const openauth = useOpenAuth();
|
||||||
|
|
||||||
// const team = createMemo(() =>
|
const team = createMemo(() =>
|
||||||
// account.current.teams.find(
|
account.current.teams.find(
|
||||||
// (item) => item.slug === params.teamSlug,
|
(item) => item.slug === params.teamSlug,
|
||||||
// ),
|
),
|
||||||
// );
|
);
|
||||||
|
|
||||||
// createEffect(() => {
|
createEffect(() => {
|
||||||
// const t = team();
|
const t = team();
|
||||||
// if (!t) return;
|
if (!t) return;
|
||||||
// storage.set("team", t.id);
|
storage.set("team", t.id);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// createEffect(() => {
|
createEffect(() => {
|
||||||
// const teamSlug = params.teamSlug;
|
const teamSlug = params.teamSlug;
|
||||||
// for (const item of Object.values(account.all)) {
|
for (const item of Object.values(account.all)) {
|
||||||
// for (const team of item.teams) {
|
for (const team of item.teams) {
|
||||||
// if (team.slug === teamSlug && item.id !== openauth.subject!.id) {
|
if (team.slug === teamSlug && item.id !== openauth.subject!.id) {
|
||||||
// openauth.switch(item.email);
|
openauth.switch(item.email);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
|
|
||||||
// return (
|
return (
|
||||||
// <Switch>
|
<Switch>
|
||||||
// <Match when={!team()}>
|
<Match when={!team()}>
|
||||||
// {/* TODO: Add a public page for (other) teams */}
|
{/* TODO: Add a public page for (other) teams */}
|
||||||
// <NotAllowed header />
|
<NotAllowed header />
|
||||||
// </Match>
|
</Match>
|
||||||
// <Match when={team()}>
|
<Match when={team()}>
|
||||||
// <TeamContext.Provider value={() => team()!}>
|
<TeamContext.Provider value={() => team()!}>
|
||||||
// <ZeroProvider>
|
<ZeroProvider>
|
||||||
// <ApiProvider>
|
<ApiProvider>
|
||||||
// {props.children}
|
{props.children}
|
||||||
// </ApiProvider>
|
</ApiProvider>
|
||||||
// </ZeroProvider>
|
</ZeroProvider>
|
||||||
// </TeamContext.Provider>
|
</TeamContext.Provider>
|
||||||
// </Match>
|
</Match>
|
||||||
// </Switch>
|
</Switch>
|
||||||
// )
|
)
|
||||||
// }}
|
}}
|
||||||
>
|
>
|
||||||
<Route path="" component={HomeRoute} />
|
<Route path="" component={HomeRoute} />
|
||||||
<Route path="library" component={LibraryRoute} />
|
<Route path="library" component={LibraryRoute} />
|
||||||
|
|||||||
Reference in New Issue
Block a user