aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/pages/Settings.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/pages/Settings.tsx')
-rw-r--r--frontend/src/pages/Settings.tsx21
1 files changed, 11 insertions, 10 deletions
diff --git a/frontend/src/pages/Settings.tsx b/frontend/src/pages/Settings.tsx
index c179fab..48a1f8e 100644
--- a/frontend/src/pages/Settings.tsx
+++ b/frontend/src/pages/Settings.tsx
@@ -1,24 +1,25 @@
-import { useCallback, useState } from "react";
-import { AddFeedForm, FeedList } from "../components";
+import { Suspense } from "react";
+import { AddFeedForm } from "../components/AddFeedForm";
+import { ErrorBoundary } from "../components/ErrorBoundary";
+import { FeedList } from "../components/FeedList";
+import { LoadingSpinner } from "../components/LoadingSpinner";
export function Settings() {
- const [refreshKey, setRefreshKey] = useState(0);
-
- const handleChange = useCallback(() => {
- setRefreshKey((k) => k + 1);
- }, []);
-
return (
<div className="mx-auto max-w-3xl space-y-10">
<section>
- <AddFeedForm onFeedAdded={handleChange} />
+ <AddFeedForm />
</section>
<section>
<h2 className="mb-4 text-sm font-semibold uppercase tracking-wide text-stone-900">
Your Feeds
</h2>
- <FeedList key={refreshKey} onFeedUnsubscribed={handleChange} />
+ <ErrorBoundary>
+ <Suspense fallback={<LoadingSpinner />}>
+ <FeedList />
+ </Suspense>
+ </ErrorBoundary>
</section>
</div>
);