merge
This commit is contained in:
parent
0eb2e34e60
commit
a15809f4fd
11 changed files with 32770 additions and 82 deletions
|
@ -18,9 +18,15 @@ const load = query(async (): Promise<User | undefined> => {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
const { name, email, image = null } = session.user;
|
||||
const {
|
||||
preferred_username,
|
||||
name,
|
||||
email,
|
||||
image = null,
|
||||
...user
|
||||
} = session.user;
|
||||
|
||||
return { name, email, image };
|
||||
return { username: preferred_username, name, email, image };
|
||||
}, "session");
|
||||
|
||||
export const route = {
|
||||
|
|
|
@ -1,34 +1,40 @@
|
|||
import { Title } from "@solidjs/meta";
|
||||
import { createAsync, query } from "@solidjs/router";
|
||||
import { createAsync } from "@solidjs/router";
|
||||
import { Overview } from "~/features/overview";
|
||||
import { listCategories, getEntry } from "~/features/content";
|
||||
import { createEffect, Show } from "solid-js";
|
||||
|
||||
const load = query(async () => {
|
||||
"use server";
|
||||
|
||||
// const response =
|
||||
}, "home.data");
|
||||
import {
|
||||
listCategories,
|
||||
getEntry,
|
||||
getContinueWatching,
|
||||
} from "~/features/content";
|
||||
import { Show } from "solid-js";
|
||||
import { List } from "~/components/list";
|
||||
import { ListItem } from "~/features/overview/list-item";
|
||||
|
||||
export const route = {
|
||||
preload: async () => ({
|
||||
highlight: await getEntry("14"),
|
||||
categories: await listCategories(),
|
||||
continue: await getContinueWatching("a9c51af84bf54578a99ab4dd0ebf0763"),
|
||||
}),
|
||||
};
|
||||
|
||||
export default function Home() {
|
||||
const highlight = createAsync(() => getEntry("14"));
|
||||
const categories = createAsync(() => listCategories());
|
||||
|
||||
createEffect(() => {
|
||||
console.log(highlight(), categories());
|
||||
});
|
||||
const continueWatching = createAsync(() =>
|
||||
getContinueWatching("a9c51af84bf54578a99ab4dd0ebf0763"),
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Title>Home</Title>
|
||||
|
||||
<Show when={continueWatching()}>
|
||||
<List label="Continue watching" items={continueWatching()}>
|
||||
{(item) => <ListItem entry={item()} />}
|
||||
</List>
|
||||
</Show>
|
||||
|
||||
<Show when={highlight() && categories()}>
|
||||
<Overview highlight={highlight()!} categories={categories()!} />
|
||||
</Show>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue