tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
29
pulls
pipelines
add loader and toast for adding feed
awarm.space
8 months ago
2546f4ed
15f508eb
+8
-1
1 changed file
expand all
collapse all
unified
split
app
lish
Subscribe.tsx
+8
-1
app/lish/Subscribe.tsx
···
348
348
setOpen: (open: boolean) => void;
349
349
}) => {
350
350
let searchParams = useSearchParams();
351
351
+
let [loading, setLoading] = useState(false);
352
352
+
let toaster = useToaster();
351
353
return (
352
354
<Dialog.Root open={open} onOpenChange={setOpen}>
353
355
<Dialog.Trigger asChild></Dialog.Trigger>
···
372
374
<ButtonPrimary
373
375
className="place-self-center mt-4"
374
376
onClick={async () => {
377
377
+
if (loading) return;
378
378
+
379
379
+
setLoading(true);
375
380
let feedurl =
376
381
"https://bsky.app/profile/leaflet.pub/feed/subscribedPublications";
377
382
await addFeed();
383
383
+
toaster({ content: "Feed added!", type: "success" });
384
384
+
setLoading(false);
378
385
window.open(feedurl, "_blank");
379
386
}}
380
387
>
381
381
-
Add Bluesky Feed
388
388
+
{loading ? <DotLoader /> : "Add Bluesky Feed"}
382
389
</ButtonPrimary>
383
390
<button
384
391
className="text-accent-contrast mt-1"