this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

do search params nicer

+9 -4
+9 -4
src/components/bluesky-embed.tsx
··· 7 7 8 8 export function BlueskyPostEmbed({ uri }: { uri: string }) { 9 9 const id = useId(); 10 - const path = usePathname(); 10 + const pathname = usePathname(); 11 11 const [height, setHeight] = useState(0); 12 12 13 13 useEffect(() => { ··· 38 38 }; 39 39 }, [id]); 40 40 41 + const ref_url = 42 + "https://" + process.env.VERCEL_PROJECT_PRODUCTION_URL + pathname; 43 + 44 + const searchParams = new URLSearchParams(); 45 + searchParams.set("id", id); 46 + searchParams.set("ref_url", encodeURIComponent(ref_url)); 47 + 41 48 return ( 42 49 <div 43 50 className="mt-8 flex max-w-[600px] w-full bluesky-embed" ··· 47 54 className="w-full block border-none flex-grow" 48 55 style={{ height }} 49 56 data-bluesky-uri={uri} 50 - src={`${EMBED_URL}/embed/${uri.slice("at://".length)}?id=${id}&ref_url=${encodeURIComponent( 51 - `https://mozzius.dev${path}`, 52 - )}`} 57 + src={`${EMBED_URL}/embed/${uri.slice("at://".length)}?${searchParams.toString()}`} 53 58 width="100%" 54 59 frameBorder="0" 55 60 scrolling="no"