diff --git a/apps/marketing/src/app/(marketing)/open/gh-stars.tsx b/apps/marketing/src/app/(marketing)/open/gh-stars.tsx new file mode 100644 index 000000000..4d1d03254 --- /dev/null +++ b/apps/marketing/src/app/(marketing)/open/gh-stars.tsx @@ -0,0 +1,108 @@ +'use client'; + +import { HTMLAttributes } from 'react'; + +import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts'; + +import { cn } from '@documenso/ui/lib/utils'; + +type StargazersType = { + [key: string]: { + stars?: number; + forks?: number; + mergedPRs?: number; + openIssues?: number; + }; +}; + +const data: StargazersType = { + '2023-8': { + stars: 2483, + forks: 155, + mergedPRs: 87, + openIssues: 67, + }, + '2023-7': { + stars: 2250, + forks: 0, + mergedPRs: 0, + openIssues: 0, + }, + '2023-6': { + stars: 2070, + forks: 0, + mergedPRs: 0, + openIssues: 0, + }, + '2023-5': { + stars: 1260, + forks: 0, + mergedPRs: 0, + openIssues: 0, + }, + '2023-4': { + stars: 90, + forks: 0, + mergedPRs: 0, + openIssues: 0, + }, + '2023-3': { + stars: 0, + forks: 0, + mergedPRs: 0, + openIssues: 0, + }, +}; + +function formatMonth(monthStr: string) { + const [year, month] = monthStr.split('-'); + const monthNames = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December', + ]; + return `${monthNames[parseInt(month, 10) - 1]} ${year}`; +} + +const formattedData = Object.keys(data) + .map((key) => ({ + month: formatMonth(key), + stars: data[key].stars, + })) + .reverse(); + +export type GithubStarsProps = HTMLAttributes; + +export const GithubStars = ({ className, ...props }: GithubStarsProps) => { + return ( +
+

Github Monthly Stars

+ +
+ + + + + [Number(value), 'Stars']} + cursor={{ fill: 'hsl(var(--primary) / 10%)' }} + /> + + + +
+
+ ); +}; diff --git a/apps/marketing/src/app/(marketing)/open/page.tsx b/apps/marketing/src/app/(marketing)/open/page.tsx index 73de57dd5..bc7740b5a 100644 --- a/apps/marketing/src/app/(marketing)/open/page.tsx +++ b/apps/marketing/src/app/(marketing)/open/page.tsx @@ -5,6 +5,7 @@ import { SalaryBands } from '~/app/(marketing)/open/salary-bands'; import { CapTable } from './cap-table'; import { FundingRaised } from './funding-raised'; +import { GithubStars } from './gh-stars'; import { TeamMembers } from './team-members'; export const revalidate = 86400; @@ -86,7 +87,8 @@ export default async function OpenPage() { - + +

Where's the rest?