aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/pages/Settings.tsx
blob: c179fabddc79798bdbd77356deb34e6bfa88a623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { useCallback, useState } from "react";
import { AddFeedForm, FeedList } from "../components";

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} />
			</section>

			<section>
				<h2 className="mb-4 text-sm font-semibold uppercase tracking-wide text-stone-900">
					Your Feeds
				</h2>
				<FeedList key={refreshKey} onFeedUnsubscribed={handleChange} />
			</section>
		</div>
	);
}