Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added ellipsis for large numbers, texts, and links #149

Merged
merged 1 commit into from
Aug 22, 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
4 changes: 2 additions & 2 deletions src/components/gui/table-cell/display-link-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default function DisplayLinkCell({ link }: { link: string }) {
const isImage = IMAGE_EXTENSION.includes((extension ?? "").toLowerCase());

return (
<div className="flex">
<div className="flex w-full">
<HoverCard>
<HoverCardTrigger
target="_blank"
className="text-blue-600 dark:text-blue-300 underline"
className="text-blue-600 dark:text-blue-300 underline flex-1 text-ellipsis overflow-hidden whitespace-nowrap"
>
{link}
</HoverCardTrigger>
Expand Down
12 changes: 7 additions & 5 deletions src/components/gui/table-cell/generic-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,10 @@ export default function GenericCell({

return (
<span
className={
className={cn(
"flex-1 text-ellipsis overflow-hidden whitespace-nowrap",
isChanged ? "text-black" : "text-green-600 dark:text-green-500"
}
)}
>
{value}
</span>
Expand All @@ -237,11 +238,12 @@ export default function GenericCell({
if (typeof value === "number" || typeof value === "bigint") {
return (
<span
className={
className={cn(
"flex-1 text-ellipsis overflow-hidden whitespace-nowrap",
isChanged
? "text-black block text-right flex-grow"
: "text-blue-700 dark:text-blue-300 block text-right flex-grow"
}
)}
>
{value.toString()}
</span>
Expand Down Expand Up @@ -275,7 +277,7 @@ export default function GenericCell({
(This can easily be fixed)
- Some driver do not even give us the header type
(For sqljs driver does not return header type. I need to find better driver first)

*/}
{/* {valueType && header.dataType && valueType !== header.dataType && (
<Tooltip>
Expand Down
Loading