diff --git a/src/components/ProfileShareCard.tsx b/src/components/ProfileShareCard.tsx new file mode 100644 index 00000000..18989061 --- /dev/null +++ b/src/components/ProfileShareCard.tsx @@ -0,0 +1,38 @@ +interface ProfileShareCardProps { + username: string; + streak: number; + profileUrl: string; +} + +export default function ProfileShareCard({ + username, + streak, + profileUrl, +}: ProfileShareCardProps) { + return ( +
+ ); +} \ No newline at end of file diff --git a/src/components/ShareProfileSection.tsx b/src/components/ShareProfileSection.tsx index adf9e00f..b7fd63b8 100644 --- a/src/components/ShareProfileSection.tsx +++ b/src/components/ShareProfileSection.tsx @@ -1,8 +1,10 @@ "use client"; -import { useEffect, useState } from "react"; +import { useEffect, useRef, useState } from "react"; import { toast } from "sonner"; import CopyLinkButton from "@/components/CopyLinkButton"; +import { toPng } from "html-to-image"; +import ProfileShareCard from "./ProfileShareCard"; interface ShareProfileSectionProps { username: string; @@ -16,6 +18,8 @@ export default function ShareProfileSection({ profileUrl, }: ShareProfileSectionProps) { const [canUseNativeShare, setCanUseNativeShare] = useState(false); + const cardRef = useRef