a tool for shared writing and social publishing

add loader and toast for adding feed

+8 -1
+8 -1
app/lish/Subscribe.tsx
··· 348 348 setOpen: (open: boolean) => void; 349 349 }) => { 350 350 let searchParams = useSearchParams(); 351 + let [loading, setLoading] = useState(false); 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 + if (loading) return; 378 + 379 + setLoading(true); 375 380 let feedurl = 376 381 "https://bsky.app/profile/leaflet.pub/feed/subscribedPublications"; 377 382 await addFeed(); 383 + toaster({ content: "Feed added!", type: "success" }); 384 + setLoading(false); 378 385 window.open(feedurl, "_blank"); 379 386 }} 380 387 > 381 - Add Bluesky Feed 388 + {loading ? <DotLoader /> : "Add Bluesky Feed"} 382 389 </ButtonPrimary> 383 390 <button 384 391 className="text-accent-contrast mt-1"