many more improvements

This commit is contained in:
Daniel
2023-05-25 17:47:20 +03:30
parent b473716237
commit d5d052b9b2
10 changed files with 118 additions and 61 deletions
+9 -4
View File
@@ -5,12 +5,13 @@
import React, { useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faClose, faPlus } from "@fortawesome/free-solid-svg-icons";
import { faClose, faPlus, faUser } from "@fortawesome/free-solid-svg-icons";
import useCollectionStore from "@/store/collections";
import { ExtendedCollection, NewCollection } from "@/types/global";
import { useSession } from "next-auth/react";
import RequiredBadge from "../RequiredBadge";
import addMemberToCollection from "@/lib/client/addMemberToCollection";
import ImageWithFallback from "../ImageWithFallback";
type Props = {
toggleCollectionModal: Function;
@@ -144,12 +145,16 @@ export default function AddCollection({ toggleCollectionModal }: Props) {
}}
/>
<div className="flex items-center gap-2">
<img
<ImageWithFallback
key={i}
// @ts-ignore
src={`/api/avatar/${e.id}`}
className="h-10 w-10 shadow rounded-full border-[3px] border-sky-100"
alt=""
/>
>
<div className="text-white bg-sky-500 h-10 w-10 shadow rounded-full border-[3px] border-sky-100 flex items-center justify-center">
<FontAwesomeIcon icon={faUser} className="w-5 h-5" />
</div>
</ImageWithFallback>
<div>
<p className="text-sm font-bold text-sky-500">{e.name}</p>
<p className="text-sky-900">{e.email}</p>
+9 -4
View File
@@ -10,6 +10,7 @@ import {
faPenToSquare,
faPlus,
faTrashCan,
faUser,
} from "@fortawesome/free-solid-svg-icons";
import useCollectionStore from "@/store/collections";
import { ExtendedCollection } from "@/types/global";
@@ -18,6 +19,7 @@ import Modal from "@/components/Modal";
import DeleteCollection from "@/components/Modal/DeleteCollection";
import RequiredBadge from "../RequiredBadge";
import addMemberToCollection from "@/lib/client/addMemberToCollection";
import ImageWithFallback from "../ImageWithFallback";
type Props = {
toggleCollectionModal: Function;
@@ -159,12 +161,15 @@ export default function EditCollection({
}}
/>
<div className="flex items-center gap-2">
<img
// @ts-ignore
<ImageWithFallback
key={i}
src={`/api/avatar/${e.userId}`}
className="h-10 w-10 shadow rounded-full border-[3px] border-sky-100"
alt=""
/>
>
<div className="text-white bg-sky-500 h-10 w-10 shadow rounded-full border-[3px] border-sky-100 flex items-center justify-center">
<FontAwesomeIcon icon={faUser} className="w-5 h-5" />
</div>
</ImageWithFallback>
<div>
<p className="text-sm font-bold text-sky-500">
{e.user.name}