Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: copy repo page Issues chart as image #4026

Merged
merged 3 commits into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions pages/s/[org]/[repo]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -543,15 +543,34 @@ export default function RepoPage({ repoData, ogImageUrl }: RepoPageProps) {

<section className="flex flex-col gap-4">
<h2 className="text-lg font-semibold">Activity</h2>
<div className="grid grid-cols-1 gap-4 lg:grid-cols-12">
<IssuesChart
stats={issueStats}
range={range}
velocity={repoStats?.issues_velocity_count ?? 0}
syncId={syncId}
isLoading={isIssueDataLoading}
className="lg:col-span-6 h-fit"
/>
<div className="flex flex-col gap-4 lg:grid lg:grid-cols-12">
<div className="block lg:col-span-6 h-fit">
<CopyContainer
onCopyClick={() => {
posthog.capture("Repo Pages: copied Issues 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} />
<IssuesChart
stats={issueStats}
range={range}
velocity={repoStats?.issues_velocity_count ?? 0}
syncId={syncId}
isLoading={isIssueDataLoading}
/>
</CopyContainer>
</div>

<PRChart
stats={prStats}
Expand Down
Loading