From fcbecb5bc577120e6bd9b430c28474bfb7629e06 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 28 May 2023 20:52:01 +0330 Subject: [PATCH] bug fixes --- .../Modal/Collection/TeamManagement.tsx | 284 +++++++++--------- components/ProfilePhoto.tsx | 2 +- pages/collections/[id].tsx | 2 +- tailwind.config.js | 4 + 4 files changed, 156 insertions(+), 136 deletions(-) diff --git a/components/Modal/Collection/TeamManagement.tsx b/components/Modal/Collection/TeamManagement.tsx index 1253f1a..5d98ae9 100644 --- a/components/Modal/Collection/TeamManagement.tsx +++ b/components/Modal/Collection/TeamManagement.tsx @@ -99,11 +99,16 @@ export default function TeamManagement({

Public Link (Click to copy)

- navigator.clipboard - .writeText(publicCollectionURL) - .then(() => console.log("Copied!")) - } + onClick={() => { + try { + navigator.clipboard + .writeText(publicCollectionURL) + .then(() => console.log("Copied!")); + } catch (err) { + alert(err); + console.log(err); + } + }} className="w-full hide-scrollbar overflow-x-auto whitespace-nowrap rounded-md p-3 border-sky-100 border-solid border outline-none hover:border-sky-500 duration-100 cursor-text" > {publicCollectionURL} @@ -159,138 +164,149 @@ export default function TeamManagement({

- {collection.members.map((e, i) => { - return ( -
- { - const updatedMembers = collection.members.filter( - (member) => { - return member.user.email !== e.user.email; - } - ); - setCollection({ - ...collection, - members: updatedMembers, - }); - }} - /> -
- -
- + {collection.members + .sort((a, b) => (a.userId as number) - (b.userId as number)) + .map((e, i) => { + return ( +
+ { + const updatedMembers = collection.members.filter( + (member) => { + return member.user.email !== e.user.email; + } + ); + setCollection({ + ...collection, + members: updatedMembers, + }); + }} + /> +
+ +
+ +
+
+
+

+ {e.user.name} +

+

{e.user.email}

+
+
+
+
+

+ Permissions +

+

+ (Click to toggle.) +

+
+ +
+ + + + +
- -
-

- {e.user.name} -

-

{e.user.email}

-
-
-

- Permissions -

-

- (Click to toggle.) -

-
- -
- - - - - -
-
-
- ); - })} + ); + })}
) : null} diff --git a/components/ProfilePhoto.tsx b/components/ProfilePhoto.tsx index 9330f98..12f86cb 100644 --- a/components/ProfilePhoto.tsx +++ b/components/ProfilePhoto.tsx @@ -15,7 +15,7 @@ export default function ProfilePhoto({ src, className }: Props) { className={`h-10 w-10 shadow rounded-full border-[3px] border-sky-100 ${className}`} >
diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsx index 2e5e2c6..9f0c767 100644 --- a/pages/collections/[id].tsx +++ b/pages/collections/[id].tsx @@ -149,7 +149,7 @@ export default function () { ); }) diff --git a/tailwind.config.js b/tailwind.config.js index 87aedba..eb74f32 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,9 +1,13 @@ /** @type {import('tailwindcss').Config} */ + module.exports = { content: [ "./app/**/*.{js,ts,jsx,tsx}", "./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}", + + // For the "layouts" directory + "./layouts/**/*.{js,ts,jsx,tsx}", ], theme: { extend: {},