Skip to content

Commit

Permalink
fix: Repos with long names get cut off (#1769)
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan Singh <[email protected]>
Co-authored-by: OGBONNA SUNDAY <[email protected]>
  • Loading branch information
aryanas159 and OgDev-01 authored Oct 10, 2023
1 parent 198ee00 commit cabf292
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { StaticImageData } from "next/image";
import Avatar from "components/atoms/Avatar/avatar";
import { truncateString } from "lib/utils/truncate-string";

import Tooltip from "components/atoms/Tooltip/tooltip";
interface TableRepositoryNameProps {
avatarURL?: string | StaticImageData;
fullName: string;
Expand All @@ -26,12 +25,15 @@ const TableRepositoryName = ({ avatarURL, fullName }: TableRepositoryNameProps):
</a>

{/* Text */}

<div className="flex flex-col justify-center">
<div title={name} className=" text-base text-light-slate-12 tracking-tight">
<a href={`https://www.github.com/${handle}/${name}`} target="_blank" rel="noreferrer">
{name && name.length > 10 ? truncateString(name, 12) : name}
</a>
</div>
<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" rel="noreferrer">
{name}
</a>
</div>
</Tooltip>
<div className=" text-sm text-light-slate-11 truncate max-w-[85px] md:max-w-[110px]">
<a href={`https://www.github.com/${handle}`} target="_blank" rel="noreferrer">
{handle ? `@${handle}` : "handle1234"}
Expand Down

0 comments on commit cabf292

Please sign in to comment.