Skip to content

Commit

Permalink
feat: change repo links from github to repo pages (#3178)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeucapua authored Apr 12, 2024
2 parents c1798cc + 20a0d3e commit 506dde2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion components/molecules/CardRepoList/card-repo-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const CardRepoList = ({
<div className="flex gap-1 p-1 pr-2 border-[1px] border-light-slate-6 rounded-lg text-light-slate-12">
<Icon IconImage={repoIcon} className="rounded-[4px] overflow-hidden" />
<span className={`max-w-[45px] md:max-w-[100px] truncate ${fontSizeClassName}`}>
<Link href={`https://github.com/${repoOwner}/${repoName}`} target="_blank">
<Link href={`/s/${repoOwner}/${repoName}`} target="_blank">
{repoName}
</Link>
</span>
Expand Down
8 changes: 4 additions & 4 deletions components/molecules/DevProfile/dev-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ interface DevProfileProps {
}
const DevProfile = ({ username, hasBorder }: DevProfileProps) => {
return (
<Link href={`/user/${username}`} className="flex items-center gap-2 text-light-slate-11">
<section className="flex items-center gap-2 text-light-slate-11">
{/* Mobile */}
<div className="rounded-full md:hidden">
<Link href={`/user/${username}`} className="rounded-full md:hidden">
<Avatar
className={hasBorder ? "ring-2 ring-orange-500" : ""}
size={45}
isCircle
hasBorder={hasBorder}
avatarURL={getAvatarByUsername(username)}
/>
</div>
</Link>
{/* Desktop */}
<div className="hidden rounded-full md:flex">
<AvatarHoverCard contributor={username} repositories={[]} size="small" />
Expand All @@ -33,7 +33,7 @@ const DevProfile = ({ username, hasBorder }: DevProfileProps) => {
{username && username.length > 10 ? truncateString(username, 11) : username}
</h1>
</div>
</Link>
</section>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const RecommendedRepoCard = ({ fullName, className }: RecommendedRepoCardProps):
{data && (
<>
<div className="flex justify-between w-full">
<a target="_blank" href={`https://github.com/${fullName}`} className="flex items-center gap-1.5">
<Link href={`/s/${fullName}`} className="flex items-center gap-1.5">
<picture>
<img
alt="Hot Repo Icon"
Expand All @@ -42,7 +42,7 @@ const RecommendedRepoCard = ({ fullName, className }: RecommendedRepoCardProps):
/>
</picture>
<span className="text-sm text-light-slate-11">{owner}</span>
</a>
</Link>
</div>

<div className="flex flex-col gap-2 pb-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { StaticImageData } from "next/image";
import Link from "next/link";
import Avatar from "components/atoms/Avatar/avatar";
import Tooltip from "components/atoms/Tooltip/tooltip";
interface TableRepositoryNameProps {
Expand All @@ -14,24 +15,22 @@ const TableRepositoryName = ({ avatarURL, fullName }: TableRepositoryNameProps):
return (
<div className="flex items-center gap-2.5">
{/* Avatar */}
<a href={`https://www.github.com/${handle}/${name}`} target="_blank">
<Link href={`/s/${fullName}`}>
<Avatar
isCached={false}
className="shrink-0 min-w-10 min-h-10"
size={40}
avatarURL={avatarURL}
isCircle={false}
/>
</a>
</Link>

{/* Text */}

<div className="flex flex-col justify-center">
<Tooltip content={name}>
<div className=" text-base text-light-slate-12 tracking-tight max-w-[5.5rem] sm:max-w-[9.3rem] md:max-w-[7rem] whitespace-nowrap overflow-hidden overflow-ellipsis">
<a href={`https://www.github.com/${handle}/${name}`} target="_blank">
{name}
</a>
<Link href={`/s/${fullName}`}>{name}</Link>
</div>
</Tooltip>
<div className=" text-sm text-light-slate-11 truncate max-w-[85px] md:max-w-[110px]">
Expand Down

0 comments on commit 506dde2

Please sign in to comment.