small improvements

This commit is contained in:
daniel31x13 2024-08-18 14:45:40 -04:00
parent 17d1cb45e3
commit c979adfe69
4 changed files with 34 additions and 31 deletions

View File

@ -135,16 +135,15 @@ export default function LinkDetails({ className, link }: Props) {
<p className="text-sm mb-2 text-neutral">{t("link")}</p> <p className="text-sm mb-2 text-neutral">{t("link")}</p>
<div className="rounded-lg p-2 bg-base-200 flex justify-between items-center gap-2"> <div className="relative">
<Link <div className="rounded-lg p-2 bg-base-200 hide-scrollbar overflow-x-auto whitespace-nowrap flex justify-between items-center gap-2 pr-14">
href={link.url} <Link href={link.url} title={link.url} target="_blank">
title={link.url} {link.url}
target="_blank" </Link>
className="truncate" <div className="absolute right-0 px-2 bg-base-200">
> <CopyButton text={link.url} />
{link.url} </div>
</Link> </div>
<CopyButton text={link.url} />
</div> </div>
</> </>
)} )}
@ -153,20 +152,24 @@ export default function LinkDetails({ className, link }: Props) {
<p className="text-sm mb-2 text-neutral">{t("collection")}</p> <p className="text-sm mb-2 text-neutral">{t("collection")}</p>
<Link <div className="relative">
href={ <Link
isPublicRoute href={
? `/public/collections/${link.collection.id}` isPublicRoute
: `/collections/${link.collection.id}` ? `/public/collections/${link.collection.id}`
} : `/collections/${link.collection.id}`
className="rounded-lg p-2 bg-base-200 flex justify-between items-center gap-2" }
> className="rounded-lg p-2 bg-base-200 hide-scrollbar overflow-x-auto whitespace-nowrap flex justify-between items-center gap-2 pr-14"
<p className="truncate">{link.collection.name}</p> >
<i <p>{link.collection.name}</p>
className="bi-folder-fill text-xl" <div className="absolute right-0 px-2 bg-base-200">
style={{ color: link.collection.color }} <i
></i> className="bi-folder-fill text-xl"
</Link> style={{ color: link.collection.color }}
></i>
</div>
</Link>
</div>
{link.tags[0] && ( {link.tags[0] && (
<> <>

View File

@ -117,7 +117,7 @@ export default function LinkDetailModal({ onClose, onEdit, link }: Props) {
className="bi-box-arrow-up-right text-xl text-neutral btn btn-sm btn-square btn-ghost absolute top-3 right-3 select-none" className="bi-box-arrow-up-right text-xl text-neutral btn btn-sm btn-square btn-ghost absolute top-3 right-3 select-none"
></Link> ></Link>
<div className="sm:m-auto sm:w-5/6"> <div className="sm:m-auto p-10 w-full max-w-xl">
<LinkDetails link={link} /> <LinkDetails link={link} />
{permissions === true || {permissions === true ||

View File

@ -17,14 +17,14 @@ const Index = () => {
}, []); }, []);
return ( return (
<div className="flex h-screen"> <div className="flex h-screen py-20">
{getLink.data ? ( {getLink.data ? (
<LinkDetails <LinkDetails
link={getLink.data} link={getLink.data}
className="mx-auto max-w-2xl p-5 m-auto w-full" className="max-w-xl p-5 m-auto w-full"
/> />
) : ( ) : (
<div className="mx-auto max-w-2xl p-5 m-auto w-full flex flex-col items-center gap-5"> <div className="max-w-xl p-5 m-auto w-full flex flex-col items-center gap-5">
<div className="w-20 h-20 skeleton rounded-xl"></div> <div className="w-20 h-20 skeleton rounded-xl"></div>
<div className="w-full h-10 skeleton rounded-xl"></div> <div className="w-full h-10 skeleton rounded-xl"></div>
<div className="w-full h-10 skeleton rounded-xl"></div> <div className="w-full h-10 skeleton rounded-xl"></div>

View File

@ -17,14 +17,14 @@ const Index = () => {
}, []); }, []);
return ( return (
<div className="flex h-screen"> <div className="flex h-screen py-20">
{getLink.data ? ( {getLink.data ? (
<LinkDetails <LinkDetails
link={getLink.data} link={getLink.data}
className="mx-auto max-w-2xl p-5 m-auto w-full" className="max-w-xl p-5 m-auto w-full"
/> />
) : ( ) : (
<div className="mx-auto max-w-2xl p-5 m-auto w-full flex flex-col items-center gap-5"> <div className="max-w-xl p-5 m-auto w-full flex flex-col items-center gap-5">
<div className="w-20 h-20 skeleton rounded-xl"></div> <div className="w-20 h-20 skeleton rounded-xl"></div>
<div className="w-full h-10 skeleton rounded-xl"></div> <div className="w-full h-10 skeleton rounded-xl"></div>
<div className="w-full h-10 skeleton rounded-xl"></div> <div className="w-full h-10 skeleton rounded-xl"></div>