Skip to content

Commit

Permalink
Suggested cahnges done
Browse files Browse the repository at this point in the history
  • Loading branch information
dgparmar14 committed Jun 27, 2024
1 parent 0e807d8 commit 6c14a72
Show file tree
Hide file tree
Showing 22 changed files with 102 additions and 657 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ DATA_SOURCE="https://github.com/coronasafe/leaderboard-data.git"
# SLACK_EOD_BOT_SIGNING_SECRET=<Slack EOD Bot App's Signing Secret>

## -- Features -- ##
NEXT_PUBLIC_FEATURES=Leaderboard,Contributors,Feed,Releases,Projects
NEXT_PUBLIC_FEATURES=Leaderboard,Contributors,Feed,Releases,Projects
2 changes: 1 addition & 1 deletion app/api/leaderboard/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const getLeaderboardData = async (
)
.sort((a, b) => {
if (sortBy === "pr_stale") {
return (b.activityData.pr_stale ?? 0) - (a.activityData.pr_stale ?? 0);
return b.activityData.pr_stale - a.activityData.pr_stale;
}
return b.summary[sortBy] - a.summary[sortBy];
});
Expand Down
4 changes: 2 additions & 2 deletions app/feed/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import LoadingText from "@/components/LoadingText";
import { IGitHubEvent } from "@/lib/gh_events";
import GitHubEvent from "@/components/gh_events/GitHubEvent";
import { env } from "../../env.mjs";
import { env } from "@/env.mjs";
import octokit from "@/lib/octokit";

const GITHUB_ORG: string = env.NEXT_PUBLIC_GITHUB_ORG ?? "";
const GITHUB_ORG: string = env.NEXT_PUBLIC_GITHUB_ORG;

export const revalidate = 600;

Expand Down
4 changes: 2 additions & 2 deletions components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function Select({
<>
{showSelectionsAs ? (
showSelectionsAs == "tags" ? (
<div className="left-[-2.5rem] top-9 flex w-full flex-wrap gap-0.5">
<div className="-left-10 top-9 flex w-full flex-wrap gap-0.5">
{Array.isArray(value) &&
value?.length > 0 &&
value.length !== options.length ? (
Expand All @@ -129,7 +129,7 @@ export function Select({
)}
</div>
) : (
<div className="left-[-2.5rem] top-9 flex gap-0.5">
<div className="-left-10 top-9 flex gap-0.5">
{Array.isArray(value) &&
value.length > 0 &&
value.length !== options.length ? (
Expand Down
2 changes: 1 addition & 1 deletion components/contributors/LeaderboardCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function LeaderboardCard({
height={56}
width={56}
/>
<div className="ml-4 mr-4 basis-[60%] text-wrap pr-10">
<div className="ml-4 mr-4 basis-3/5 text-wrap pr-10">
<div className="w-[180px] truncate font-bold text-green-500">
{contributor.user.name}
</div>
Expand Down
32 changes: 15 additions & 17 deletions components/gh_events/GitHubEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,20 @@ export default async function GitHubEvents({ minimal }: { minimal?: boolean }) {
.slice(0, 5);

return (
<>
<div className="flow-root">
<ul role="list" className="-mb-8 mt-4 flex flex-col gap-4 space-y-4">
{events ? (
events.map((e) => <GitHubEvent key={e.id} event={e} />)
) : (
<>
<GitHubEvent />
<GitHubEvent />
<GitHubEvent />
<GitHubEvent />
<GitHubEvent />
</>
)}
</ul>
</div>
</>
<div className="flow-root">
<ul role="list" className="-mb-8 mt-4 flex flex-col gap-4 space-y-4">
{events ? (
events.map((e) => <GitHubEvent key={e.id} event={e} />)
) : (
<>
<GitHubEvent />
<GitHubEvent />
<GitHubEvent />
<GitHubEvent />
<GitHubEvent />
</>
)}
</ul>
</div>
);
}
2 changes: 2 additions & 0 deletions env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const env = createEnv({
NEXT_PUBLIC_PAGE_TITLE: z.string(),
NEXT_PUBLIC_CONTRIBUTORS_INFO: z.string().optional(),
NEXT_PUBLIC_LEADERBOARD_DEFAULT_ROLES: z.string().optional(),
BLACKLISTED_USERS: z.string().array(),

NEXT_PUBLIC_FEATURES: z.string(),
},
Expand All @@ -47,5 +48,6 @@ export const env = createEnv({
? ""
: process.env.GITHUB_PAT,
NEXT_PUBLIC_FEATURES: process.env.NEXT_PUBLIC_FEATURES,
BLACKLISTED_USERS: process.env.BLACKLISTED_USERS,
},
});
Loading

0 comments on commit 6c14a72

Please sign in to comment.