even more visual improvements

This commit is contained in:
Daniel 2023-05-25 05:17:18 +03:30
parent 1606587931
commit b473716237
5 changed files with 281 additions and 263 deletions

View File

@ -19,7 +19,7 @@ export default function ({ collection }: { collection: ExtendedCollection }) {
return ( return (
<Link href={`/collections/${collection.id}`}> <Link href={`/collections/${collection.id}`}>
<div className="p-5 bg-gray-100 min-h-[10rem] w-72 rounded-md border-sky-100 border-solid border flex flex-col gap-2 justify-between cursor-pointer hover:bg-gray-50 duration-100"> <div className="p-5 bg-gray-100 min-h-[12rem] rounded-md border-sky-100 border-solid border flex flex-col gap-2 justify-between cursor-pointer hover:bg-gray-50 duration-100">
<div> <div>
<div className="flex justify-between text-sky-600 items-center"> <div className="flex justify-between text-sky-600 items-center">
<p className="text-lg w-max font-bold">{collection.name}</p> <p className="text-lg w-max font-bold">{collection.name}</p>
@ -30,25 +30,33 @@ export default function ({ collection }: { collection: ExtendedCollection }) {
</div> </div>
<p className="text-sky-400">{collection.description}</p> <p className="text-sky-400">{collection.description}</p>
</div> </div>
<div className="text-sky-400 flex gap-1 flex-wrap"> <div className="flex justify-between items-center">
<p>Members:</p> <div className="text-sky-400 flex items-center w-full">
{collection.members.map((e, i) => { {collection.members
.map((e, i) => {
return ( return (
<p <img
className="text-sky-500 font-semibold" src={`/api/avatar/${e.userId}`}
title={e.user.email} className="h-10 w-10 shadow rounded-full border-[3px] border-sky-100 -mr-3"
key={i} alt=""
> />
{e.user.name}
</p>
); );
})} })
.reverse()
.slice(0, 3)}
{collection.members.length - 3 > 0 ? (
<div className="h-10 w-10 text-white flex items-center justify-center rounded-full border-[3px] bg-sky-500 border-sky-100 -mr-3">
+{collection.members.length - 3}
</div> </div>
<div className="flex gap-2 items-baseline"> ) : null}
<p className="text-sky-300 font-bold text-sm">{formattedDate}</p> </div>
<div className="text-right w-full">
<p className="text-sky-500 font-bold"> <p className="text-sky-500 font-bold">
{links.filter((e) => e.collectionId === collection.id).length} Links {links.filter((e) => e.collectionId === collection.id).length}{" "}
Links
</p> </p>
<p className="text-sky-300 font-bold text-sm">{formattedDate}</p>
</div>
</div> </div>
</div> </div>
</Link> </Link>

View File

@ -120,6 +120,7 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
</p> </p>
) : null} ) : null}
<div className="h-36 overflow-auto flex flex-col gap-3 rounded-md shadow-inner">
{newCollection.members.map((e, i) => { {newCollection.members.map((e, i) => {
return ( return (
<div <div
@ -146,7 +147,7 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
<img <img
// @ts-ignore // @ts-ignore
src={`/api/avatar/${e.id}`} src={`/api/avatar/${e.id}`}
className="h-10 w-10 rounded-full border-[3px] border-sky-100" className="h-10 w-10 shadow rounded-full border-[3px] border-sky-100"
alt="" alt=""
/> />
<div> <div>
@ -157,7 +158,9 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
<div className="flex sm:block items-center gap-5"> <div className="flex sm:block items-center gap-5">
<div> <div>
<p className="font-bold text-sm text-gray-500">Permissions</p> <p className="font-bold text-sm text-gray-500">Permissions</p>
<p className="text-xs text-gray-400 mb-2">(Click to toggle.)</p> <p className="text-xs text-gray-400 mb-2">
(Click to toggle.)
</p>
</div> </div>
<div> <div>
@ -243,6 +246,7 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
</div> </div>
); );
})} })}
</div>
<div <div
className="mx-auto mt-2 bg-sky-500 text-white flex items-center gap-2 py-2 px-5 rounded-md select-none font-bold cursor-pointer duration-100 hover:bg-sky-400" className="mx-auto mt-2 bg-sky-500 text-white flex items-center gap-2 py-2 px-5 rounded-md select-none font-bold cursor-pointer duration-100 hover:bg-sky-400"

View File

@ -135,6 +135,7 @@ export default function EditCollection({
</p> </p>
) : null} ) : null}
<div className="h-36 overflow-auto flex flex-col gap-3 rounded-md shadow-inner">
{activeCollection.members.map((e, i) => { {activeCollection.members.map((e, i) => {
return ( return (
<div <div
@ -161,18 +162,22 @@ export default function EditCollection({
<img <img
// @ts-ignore // @ts-ignore
src={`/api/avatar/${e.userId}`} src={`/api/avatar/${e.userId}`}
className="h-10 w-10 rounded-full border-[3px] border-sky-100" className="h-10 w-10 shadow rounded-full border-[3px] border-sky-100"
alt="" alt=""
/> />
<div> <div>
<p className="text-sm font-bold text-sky-500">{e.user.name}</p> <p className="text-sm font-bold text-sky-500">
{e.user.name}
</p>
<p className="text-sky-900">{e.user.email}</p> <p className="text-sky-900">{e.user.email}</p>
</div> </div>
</div> </div>
<div className="flex sm:block items-center gap-5"> <div className="flex sm:block items-center gap-5">
<div> <div>
<p className="font-bold text-sm text-gray-500">Permissions</p> <p className="font-bold text-sm text-gray-500">Permissions</p>
<p className="text-xs text-gray-400 mb-2">(Click to toggle.)</p> <p className="text-xs text-gray-400 mb-2">
(Click to toggle.)
</p>
</div> </div>
<div> <div>
@ -258,6 +263,7 @@ export default function EditCollection({
</div> </div>
); );
})} })}
</div>
<div className="flex flex-col justify-center items-center gap-2 mt-2"> <div className="flex flex-col justify-center items-center gap-2 mt-2">
<div <div

View File

@ -81,7 +81,7 @@ export default function () {
{account.profilePic ? ( {account.profilePic ? (
<img <img
src={account.profilePic} src={account.profilePic}
className="h-10 w-10 pointer-events-none rounded-full border-[3px] border-sky-100 group-hover:border-sky-500 duration-100" className="h-10 w-10 shadow pointer-events-none rounded-full border-[3px] border-sky-100 group-hover:border-sky-500 duration-100"
alt="" alt=""
/> />
) : ( ) : (

View File

@ -188,13 +188,13 @@ export default function () {
</div> </div>
</div> </div>
<div className="flex flex-wrap gap-5"> <div className="grid 2xl:grid-cols-4 xl:grid-cols-3 sm:grid-cols-2 gap-5">
{sortedCollections.map((e, i) => { {sortedCollections.map((e, i) => {
return <CollectionCard key={i} collection={e} />; return <CollectionCard key={i} collection={e} />;
})} })}
<div <div
className="p-5 bg-gray-100 h-40 w-60 rounded-md border-sky-100 border-solid border flex flex-col gap-4 justify-center items-center cursor-pointer hover:bg-gray-50 duration-100" className="p-5 bg-gray-100 self-stretch min-h-[12rem] rounded-md border-sky-100 border-solid border flex flex-col gap-4 justify-center items-center cursor-pointer hover:bg-gray-50 duration-100"
onClick={toggleCollectionModal} onClick={toggleCollectionModal}
> >
<p className="text-sky-900">New Collection</p> <p className="text-sky-900">New Collection</p>