Skip to content
Merged
Show file tree
Hide file tree
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
Binary file added public/images/bitcoin-dev-og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 24 additions & 19 deletions src/app/components/cards/OrganisationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const OrganisationCard = ({
}: OrganisationCardProps) => {
return (
<div
className={`border border-card-border-color rounded-md bg-card-bg shadow-card-shadow flex py-[10px] px-4 cursor-pointer ${
className={`border border-card-border-color rounded-md bg-card-bg shadow-card-shadow flex py-[8px] sm:py-[10px] px-4 cursor-pointer ${
more
? "w-full items-start justify-start bg-transparent shadow-none py-2 px-2 hover:bg-card-bg"
: "w-max rounded-md items-center justify-center"
Expand All @@ -39,7 +39,7 @@ export const OrganisationCard = ({
height={16}
width={16}
/>
<p className="text-sm font-semibold tracking-tighter lowercase text-card-text-black whitespace-nowrap">
<p className="text-xs sm:text-sm font-semibold tracking-tighter lowercase text-card-text-black whitespace-nowrap">
@{login}
</p>
</section>
Expand Down Expand Up @@ -74,29 +74,34 @@ export const ProjectsBlock = ({
/>
))}
{projects.length > 3 ? (
<div className="relative">
<div className="md:relative">
<button
className="text-black border border-card-border-color rounded-md bg-card-bg shadow-card-shadow w-max flex items-center justify-center py-[10px] px-4 cursor-pointer tracking-tighter text-sm"
className="text-black border border-card-border-color rounded-md bg-card-bg shadow-card-shadow w-max flex items-center justify-center py-[8px] sm:py-[10px] px-4 cursor-pointer tracking-tighter text-xs sm:text-sm"
onClick={() => setShowMore(!showMore)}
>
More
</button>
{showMore ? (
<div className="absolute right-2 top-14 flex flex-col gap-3 border-card-border-color border rounded-md shadow-card-shadow w-[250px] pt-3 bg-white">
<p className="text-black text-sm font-semibold px-4">
projects
</p>
<div className="flex flex-col gap-1">
{projects.slice(3).map((x, idx) => (
<OrganisationCard
key={`${idx}_${x.login}`}
handleClick={handleFilterToggle}
login={x.login}
avatarUrl={x.avatarUrl}
more={true}
toggleFilter={toggleFilter}
/>
))}
<div
className="absolute top-0 right-0 left-0 bottom-0 md:backdrop-blur-none backdrop-blur-sm h-full flex items-center justify-center p-8 z-10"
onClick={() => setShowMore(!showMore)}
>
<div className="md:absolute md:right-2 md:top-14 flex flex-col gap-3 border-card-border-color border rounded-md shadow-card-shadow w-full md:w-[250px] pt-3 bg-white z-30">
<p className="text-black text-sm font-semibold px-4">
projects
</p>
<div className="flex flex-col gap-1">
{projects.slice(3).map((x, idx) => (
<OrganisationCard
key={`${idx}_${x.login}`}
handleClick={handleFilterToggle}
login={x.login}
avatarUrl={x.avatarUrl}
more={true}
toggleFilter={toggleFilter}
/>
))}
</div>
</div>
</div>
) : null}
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/years-switch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const YearSection = ({ years, currentYear, handleClick }: YearSectionProps) => {
const [showYears, setShowYears] = React.useState(false)

return (
<div className="w-full sm:p-4 md:p-9 lg:px-8 sm:px-4 md:px-4 sm:py-8 h-max rounded-[15px] p-0 flex items-end justify-end absolute top-9 right-4 sm:relative sm:block sm:top-0 sm:right-0">
<div className="sm:flex-col gap-1 sm:block hidden">
<div className="w-full sm:p-4 md:p-9 lg:px-8 sm:px-4 md:px-4 sm:py-8 h-max rounded-[15px] p-0 flex items-end justify-end absolute top-9 right-4 md:relative md:block md:top-0 md:right-0">
<div className="md:flex-col gap-1 md:block hidden">
{years.map((year) => (
<div
className={`px-4 py-2 sm:w-full cursor-pointer rounded-md max-w-[200px] ${
Expand All @@ -29,7 +29,7 @@ const YearSection = ({ years, currentYear, handleClick }: YearSectionProps) => {
))}
</div>

<div className="sm:hidden block">
<div className="md:hidden block">
<section className="text-black flex border border-card-border-color rounded-md bg-card-bg shadow-card-shadow w-max items-center justify-center cursor-pointer tracking-tighter text-sm">
<span
className={`px-4 py-[8px] rounded-md rounded-r-none ${
Expand Down
23 changes: 21 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,27 @@ import type { Metadata } from "next"
const inter = Inter({ subsets: ["latin"] })

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app"
title: "Github Stats",
description: "Generate github statistics of any user",
keywords:
"github stats, gh stats, gh-stats, git statistics of developers, github statistics for developers, github contributions, github contributions statistics, github statistics",
openGraph: {
title: "Github Stats",
description:
"Bitcoin-dev and Lightning-dev mailing list summaries and discoveries",
url: "https://ghstats.bitcoinsearch.xyz",
type: "website",
images: [
{
url: "https://ghstats.bitcoinsearch.xyz/images/bitcoin-dev-og.png"
}
]
},
twitter: {
card: "summary",
creator: "@chaincodelabs",
images: ["https://ghstats.bitcoinsearch.xyz/images/bitcoin-dev-og.png"]
}
}

export default function RootLayout({
Expand Down
18 changes: 16 additions & 2 deletions src/app/result/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Page = () => {
return (
<main className="flex items-center justify-center bg-white">
<div
className="sm:h-screen h-full max-w-5xl flex flex-col-reverse w-full sm:grid sm:justify-center"
className="sm:h-screen h-full max-w-5xl flex flex-col-reverse w-full md:grid sm:justify-center"
style={{ gridTemplateColumns: "3fr 1fr" }}
>
<div className="w-full flex flex-col sm:border-2 md:p-8 md:pt-0 sm:pb-2 p-4 pt-0 gap-6 h-screen overflow-x-scroll">
Expand All @@ -47,7 +47,7 @@ const Page = () => {
className="arrowLeftIcon"
/>
</button>
<div className="flex gap-2 flex-col sm:justify-between sm:items-center sm:flex-row">
<div className="flex gap-2 flex-col md:justify-between md:items-center md:flex-row">
<h2 className=" text-black capitalize">
{username} contributions
</h2>
Expand All @@ -72,6 +72,20 @@ const Page = () => {
))}
</div>
</div>
<section className="text-black text-xs font-medium flex gap-3 flex-wrap">
<div className="flex items-center gap-1">
<p>Commits</p>
<section className="h-[10px] w-[10px] rounded-[3px] bg-grid-blue"></section>
</div>
<div className="flex items-center gap-1">
<p>Comments</p>
<section className="h-[10px] w-[10px] rounded-[3px] bg-grid-yellow"></section>
</div>
<div className="flex items-center gap-1">
<p>Commits & Comments</p>
<section className="h-[10px] w-[10px] rounded-[3px] bg-grid-green"></section>
</div>
</section>
</section>
<ProjectsBlock
projects={projects}
Expand Down
8 changes: 4 additions & 4 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type Contribution = {
activity: Array<{ date: string; type: string }>
}

export const GRID_YELLOW = '#E7C23E'
export const GRID_BLUE = '#0783F5'
export const GRID_GRAY = '#EEEEEE'
export const GRID_GREEN = '#39D353'
export const GRID_YELLOW = "#E7C23E"
export const GRID_BLUE = "#0783F5"
export const GRID_GRAY = "#EEEEEE"
export const GRID_GREEN = "#39D353"