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 (
<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 className="flex justify-between text-sky-600 items-center">
<p className="text-lg w-max font-bold">{collection.name}</p>
@ -30,25 +30,33 @@ export default function ({ collection }: { collection: ExtendedCollection }) {
</div>
<p className="text-sky-400">{collection.description}</p>
</div>
<div className="text-sky-400 flex gap-1 flex-wrap">
<p>Members:</p>
{collection.members.map((e, i) => {
<div className="flex justify-between items-center">
<div className="text-sky-400 flex items-center w-full">
{collection.members
.map((e, i) => {
return (
<p
className="text-sky-500 font-semibold"
title={e.user.email}
key={i}
>
{e.user.name}
</p>
<img
src={`/api/avatar/${e.userId}`}
className="h-10 w-10 shadow rounded-full border-[3px] border-sky-100 -mr-3"
alt=""
/>
);
})}
})
.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 className="flex gap-2 items-baseline">
<p className="text-sky-300 font-bold text-sm">{formattedDate}</p>
) : null}
</div>
<div className="text-right w-full">
<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 className="text-sky-300 font-bold text-sm">{formattedDate}</p>
</div>
</div>
</div>
</Link>

View File

@ -120,6 +120,7 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
</p>
) : null}
<div className="h-36 overflow-auto flex flex-col gap-3 rounded-md shadow-inner">
{newCollection.members.map((e, i) => {
return (
<div
@ -146,7 +147,7 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
<img
// @ts-ignore
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=""
/>
<div>
@ -157,7 +158,9 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
<div className="flex sm:block items-center gap-5">
<div>
<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>
@ -243,6 +246,7 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
</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"

View File

@ -135,6 +135,7 @@ export default function EditCollection({
</p>
) : null}
<div className="h-36 overflow-auto flex flex-col gap-3 rounded-md shadow-inner">
{activeCollection.members.map((e, i) => {
return (
<div
@ -161,18 +162,22 @@ export default function EditCollection({
<img
// @ts-ignore
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=""
/>
<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>
</div>
</div>
<div className="flex sm:block items-center gap-5">
<div>
<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>
@ -258,6 +263,7 @@ export default function EditCollection({
</div>
);
})}
</div>
<div className="flex flex-col justify-center items-center gap-2 mt-2">
<div

View File

@ -81,7 +81,7 @@ export default function () {
{account.profilePic ? (
<img
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=""
/>
) : (

View File

@ -188,13 +188,13 @@ export default function () {
</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) => {
return <CollectionCard key={i} collection={e} />;
})}
<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}
>
<p className="text-sky-900">New Collection</p>