Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

feat: Use OpenSauced links instead of GitHub #520

Merged
merged 3 commits into from
Apr 1, 2024
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
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ module.exports = {
"arrow-spacing": "error",
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs"],
"comma-dangle": ["error", "always-multiline"],
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": [
"error",
{
Expand Down
52 changes: 14 additions & 38 deletions src/components/HotRepoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
rel="noreferrer"
target="_blank"
href={`${String(
`${bugReportLink} repo not found [${repoName}]&body=Please take a look why this ${repoName} not founded`,
`${bugReportLink} repo not found [${repoName}]&body=Please take a look why this ${repoName} not founded`

Check warning on line 33 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Code standards

Missing trailing comma
)}`}
>
Report a bug
Expand All @@ -43,10 +43,7 @@
if (isLoading) {
return (
<div className="p-4 border rounded-2xl bg-white w-full space-y-1 relative">
<Skeleton
enableAnimation
count={5}
/>
<Skeleton enableAnimation count={5} />

Check warning on line 46 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Code standards

Prop `count` must be placed on a new line
</div>
);
}
Expand All @@ -58,62 +55,41 @@
<div className="p-4 border rounded-2xl bg-white w-full space-y-1 relative">
<div className="flex justify-between w-full">
<div className="flex space-x-1 items-center">
<img
alt="Hot Repo Icon"
className="h-4 w-4 rounded-md overflow-hidden"
src={getAvatarLink(owner)}
/>

<span className="text-sm font-medium text-lightSlate11">
{owner}
</span>
<img alt="Hot Repo Icon" className="h-4 w-4 rounded-md overflow-hidden" src={getAvatarLink(owner)} />

<span className="text-sm font-medium text-lightSlate11">{owner}</span>
</div>
</div>

<div className="flex flex-col pb-10">
<a
className="text-xl font-semibold"
href={`https://insights.opensauced.pizza/hot/repositories/filter/${full_name}`}
href={`https://app.opensauced.pizza/s/${full_name}`}
rel="noopener noreferrer"
target="_blank"
>
{name}
</a>

<p className="text-gray-500 font-medium text-xs w-5/6">
{description}
</p>
<p className="text-gray-500 font-medium text-xs w-5/6">{description}</p>
</div>

<div className="flex items-center justify-between absolute bottom-3 inset-x-0 px-4">
<div className="flex space-x-3 text-xs">
<div className="flex text-sm space-x-1 justify-center items-center">
<VscIssues
className="fill-lightSlate10"
size={16}
/>

<span className="text-lightSlate11">
{humanizeNumber(issues)}
</span>
<VscIssues className="fill-lightSlate10" size={16} />

<span className="text-lightSlate11">{humanizeNumber(issues)}</span>
</div>

<div className="flex text-sm space-x-1 justify-center items-center">
<AiOutlineStar
className="fill-lightSlate10"
size={16}
/>

<span className="text-lightSlate11">
{humanizeNumber(stars)}
</span>
<AiOutlineStar className="fill-lightSlate10" size={16} />

<span className="text-lightSlate11">{humanizeNumber(stars)}</span>
</div>

<div className="flex text-sm space-x-1 justify-center items-center">
<BiGitPullRequest
className="fill-lightSlate10"
size={16}
/>
<BiGitPullRequest className="fill-lightSlate10" size={16} />

<span className="text-lightSlate11">0</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ const getAvatarLink = (username: string | null) =>
`https://github.com/${username ?? "github"}.png?size=460`;

const getProfileLink = (username: string | null) =>
`https://github.com/${username ?? ""}`;
`https://app.opensauced.pizza/user/${username ?? ""}`;

const getRepoLink = (repoName: string | null) =>
`https://app.opensauced.pizza/${repoName ?? ""}`;
`https://app.opensauced.pizza/s/${repoName ?? ""}`;

const getRepoIssuesLink = (repoName: string | null) =>
`https://github.com/${repoName && `${repoName}/issues` || ""}`;
Expand Down
Loading