Skip to content

Commit

Permalink
feat: copy repo page PR chart as image (#4027)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeucapua authored Aug 26, 2024
1 parent 933bb2c commit 3541a37
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions pages/s/[org]/[repo]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,33 @@ export default function RepoPage({ repoData, ogImageUrl }: RepoPageProps) {
className="lg:col-span-6 h-fit"
/>

<PRChart
stats={prStats}
range={range}
velocity={repoStats?.pr_velocity_count ?? 0}
syncId={syncId}
isLoading={isPrDataLoading}
className="lg:col-span-6 h-fit"
/>
<div className="lg:col-span-6 h-fit">
<CopyContainer
onCopyClick={() => {
posthog.capture("Repo Pages: copied PR chart", {
repository: repoData.full_name,
});
}}
options={{
windowWidth: 1700,
allowTaint: true,
onclone: (document, element) => {
element.querySelectorAll("[data-copy-image-branding]").forEach((el) => {
el.classList.remove("hidden");
});
},
}}
>
<CopyImageBranding repository={repoData.full_name} />
<PRChart
stats={prStats}
range={range}
velocity={repoStats?.pr_velocity_count ?? 0}
syncId={syncId}
isLoading={isPrDataLoading}
/>
</CopyContainer>
</div>
</div>
</section>

Expand Down

0 comments on commit 3541a37

Please sign in to comment.