This will create a copy of this deck in your library that you can study and edit.
-
+
);
};
diff --git a/web/src/pages/Discovery.tsx b/web/src/pages/Discovery.tsx
index 9ce656d..8e2b3e2 100644
--- a/web/src/pages/Discovery.tsx
+++ b/web/src/pages/Discovery.tsx
@@ -1,64 +1,77 @@
import { SearchInput } from "$components/SearchInput";
+import { Skeleton } from "$components/ui/Skeleton";
+import { Tag } from "$components/ui/Tag";
import { api } from "$lib/api";
import { A } from "@solidjs/router";
import type { Component } from "solid-js";
-import { createResource, For, Show } from "solid-js";
+import { createResource, For, Index, Show } from "solid-js";
+import { Motion } from "solid-motionone";
-// TODO: type discovery response
const Discovery: Component = () => {
const [data] = createResource(async () => {
const res = await api.getDiscovery();
- if (res.ok) return await res.json();
+ if (res.ok) return (await res.json()) as { top_tags: [string, number][] };
return { top_tags: [] };
});
return (
-
-
-
-
Explore community decks and popular topics
-
+
+
+ Discover Malfestio
+ Explore community decks and popular topics
+
-
+
-
-
-
+
+
+
Top Tags
-
+
+ {() => }
}>
-
-
+
+
);
};
diff --git a/web/src/pages/Feed.tsx b/web/src/pages/Feed.tsx
index c22a5c1..8a82f60 100644
--- a/web/src/pages/Feed.tsx
+++ b/web/src/pages/Feed.tsx
@@ -2,12 +2,16 @@ import { FollowButton } from "$components/social/FollowButton";
import { Button } from "$components/ui/Button";
import { Card } from "$components/ui/Card";
import { Dialog } from "$components/ui/Dialog";
+import { EmptyState } from "$components/ui/EmptyState";
+import { Skeleton } from "$components/ui/Skeleton";
import { Tabs } from "$components/ui/Tabs";
+import { Tag } from "$components/ui/Tag";
import { api } from "$lib/api";
import type { Deck } from "$lib/model";
import { toast } from "$lib/toast";
import { A, useNavigate } from "@solidjs/router";
-import { createResource, createSignal, For, Match, Show, Switch } from "solid-js";
+import { createResource, createSignal, For, Index, Match, Show, Switch } from "solid-js";
+import { Motion } from "solid-motionone";
export default function Feed() {
const navigate = useNavigate();
@@ -15,12 +19,12 @@ export default function Feed() {
const [followsFeed] = createResource(async () => {
const res = await api.getFeedFollows();
- return res.ok ? (await res.json() as Deck[]) : [];
+ return res.ok ? ((await res.json()) as Deck[]) : [];
});
const [valuableFeed] = createResource(async () => {
const res = await api.getFeedTrending();
- return res.ok ? (await res.json() as Deck[]) : [];
+ return res.ok ? ((await res.json()) as Deck[]) : [];
});
const handleFork = async () => {
@@ -43,64 +47,104 @@ export default function Feed() {
}
};
- const DeckItem = (props: { deck: Deck }) => (
+ const DeckItem = (props: { deck: Deck; index: number }) => (
+
+
+
+
+
{props.deck.title}
+
+ By {props.deck.owner_did} •{" "}
+
+ {(published_at) => new Date(published_at()).toLocaleDateString()}
+
+
+
{props.deck.description}
+
+ {(tag) => }
+
+
+
+
+
+
+
+
+ View
+
+
setForkDialogDeck(props.deck)}>Fork
+
+
+
+ );
+
+ const DeckSkeleton = () => (
-
-
{props.deck.title}
-
- By {props.deck.owner_did} •{" "}
-
- {published_at => new Date(published_at()).toLocaleDateString()}
-
-
-
{props.deck.description}
-
-
- {(tag) => {tag} }
-
+
-
-
-
-
-
-
- View
-
-
setForkDialogDeck(props.deck)}>Fork
+
);
return (
-
-
Discovery
+
+
+ Discovery
+ Explore content from people you follow and trending decks.
+
+
{(activeTab) => (
-
-
- {feed => (
- No updates from followed users.
}>
- {(deck) => }
-
- )}
+
+ {() => }}>
+ } />
+ }>
+ {(deck, i) => }
+
-
-
- {feed => (
- No trending decks.
}>
- {(deck) => }
-
- )}
+
+ {() => }}>
+ } />
+ }>
+ {(deck, i) => }
+
@@ -118,9 +162,9 @@ export default function Feed() {
Fork Deck
>
}>
- Are you sure you want to fork "{forkDialogDeck()?.title}"?
- This will create a copy of this deck in your library.
+ Are you sure you want to fork "{forkDialogDeck()?.title}"?
+ This will create a copy of this deck in your library.
-
+
);
}
diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx
index f38f161..e3074a3 100644
--- a/web/src/pages/Home.tsx
+++ b/web/src/pages/Home.tsx
@@ -1,82 +1,115 @@
+import { Card } from "$components/ui/Card";
+import { EmptyState } from "$components/ui/EmptyState";
+import { Skeleton } from "$components/ui/Skeleton";
+import { Tag } from "$components/ui/Tag";
import { api } from "$lib/api";
import type { Deck } from "$lib/model";
+import { Button } from "$ui/Button";
import { A } from "@solidjs/router";
import type { Component } from "solid-js";
-import { createResource, For, Show } from "solid-js";
+import { createResource, For, Index, Show } from "solid-js";
+import { Motion } from "solid-motionone";
-const DeckCard: Component<{ deck: Deck }> = (props) => (
-
+const DeckCard: Component<{ deck: Deck; index: number }> = (props) => (
+
+
+
+
+ {props.deck.title}
+
+
+
+
+
+ {props.deck.description}
+
+
+ {(tag) => }
+
+
+
+
+
+);
+
+const DeckCardSkeleton: Component = () => (
+
-
- {props.deck.title}
-
-
-
- {props.deck.visibility.type}
-
-
+
- {props.deck.description}
-
-
-
- {(tag) => #{tag} }
-
+
+
+
-
-
+
+
+
+
);
const Home: Component = () => {
const [decks] = createResource(async () => {
const res = await api.getDecks();
- return res.ok ? (await res.json() as Deck[]) : [];
+ return res.ok ? ((await res.json()) as Deck[]) : [];
});
return (
-
-
+
-
- Loading library...
-
- }>
+
{() => }}>
- No decks found
-
- Create your first deck to get started with spaced repetition learning.
-
+
}>
- {(deck) => }
+ {(deck, i) => }
-
+
);
};
diff --git a/web/src/pages/Landing.tsx b/web/src/pages/Landing.tsx
index a3e6951..1329b8a 100644
--- a/web/src/pages/Landing.tsx
+++ b/web/src/pages/Landing.tsx
@@ -44,7 +44,7 @@ const steps = [{ title: "Import", desc: "Create cards from articles, lectures, o
const Feature: Component<{ title: string; desc: string; icon: JSX.Element }> = (props) => (
{props.icon}
-
{props.title}
+
{props.title}
{props.desc}
);
@@ -134,9 +134,9 @@ const Landing: Component = () => (
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6 }}
- class="text-5xl md:text-7xl font-light tracking-tight mb-8 leading-[1.1]">
+ class="text-7xl md:text-8xl font-medium tracking-tight mb-8 leading-[1.1]">
Learning on
- the AT Protocol.
+ the AT Protocol.