From 48eb253cac42fecc06a5631a4572c4bc22e69042 Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Mon, 9 Oct 2023 08:35:33 -0400 Subject: [PATCH] UI improvements --- components/CollectionCard.tsx | 10 +++++- .../Modal/Collection/TeamManagement.tsx | 6 ++-- components/Modal/Link/LinkDetails.tsx | 2 +- components/ProfilePhoto.tsx | 2 +- pages/collections/[id].tsx | 31 +++++++++++-------- pages/collections/index.tsx | 5 ++- pages/subscribe.tsx | 4 +-- 7 files changed, 38 insertions(+), 22 deletions(-) diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx index 60609a4..a2ffa49 100644 --- a/components/CollectionCard.tsx +++ b/components/CollectionCard.tsx @@ -8,6 +8,7 @@ import ProfilePhoto from "./ProfilePhoto"; import { faCalendarDays } from "@fortawesome/free-regular-svg-icons"; import useModalStore from "@/store/modals"; import usePermissions from "@/hooks/usePermissions"; +import { useTheme } from "next-themes"; type Props = { collection: CollectionIncludingMembersAndLinkCount; @@ -17,6 +18,8 @@ type Props = { export default function CollectionCard({ collection, className }: Props) { const { setModal } = useModalStore(); + const { theme } = useTheme(); + const formattedDate = new Date(collection.createdAt as string).toLocaleString( "en-US", { @@ -32,7 +35,12 @@ export default function CollectionCard({ collection, className }: Props) { return (
setExpandDropdown(!expandDropdown)} diff --git a/components/Modal/Collection/TeamManagement.tsx b/components/Modal/Collection/TeamManagement.tsx index 3f2f3e6..2904517 100644 --- a/components/Modal/Collection/TeamManagement.tsx +++ b/components/Modal/Collection/TeamManagement.tsx @@ -310,7 +310,7 @@ export default function TeamManagement({ @@ -355,7 +355,7 @@ export default function TeamManagement({ @@ -400,7 +400,7 @@ export default function TeamManagement({ diff --git a/components/Modal/Link/LinkDetails.tsx b/components/Modal/Link/LinkDetails.tsx index 8281939..827bd7e 100644 --- a/components/Modal/Link/LinkDetails.tsx +++ b/components/Modal/Link/LinkDetails.tsx @@ -29,7 +29,7 @@ type Props = { }; export default function LinkDetails({ link, isOwnerOrMod }: Props) { - const { theme, setTheme } = useTheme(); + const { theme } = useTheme(); const [imageError, setImageError] = useState(false); const formattedDate = new Date(link.createdAt as string).toLocaleString( diff --git a/components/ProfilePhoto.tsx b/components/ProfilePhoto.tsx index 62dd8bc..f9c99eb 100644 --- a/components/ProfilePhoto.tsx +++ b/components/ProfilePhoto.tsx @@ -43,7 +43,7 @@ export default function ProfilePhoto({ src={src} height={112} width={112} - className={`h-10 w-10 shadow rounded-full aspect-square border border-slate-200 dark:border-neutral-700 ${className}`} + className={`h-10 w-10 bg-sky-600 dark:bg-sky-600 shadow rounded-full aspect-square border border-slate-200 dark:border-neutral-700 ${className}`} /> ); } diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsx index 4fccd00..34626f8 100644 --- a/pages/collections/[id].tsx +++ b/pages/collections/[id].tsx @@ -19,12 +19,15 @@ import useModalStore from "@/store/modals"; import useLinks from "@/hooks/useLinks"; import usePermissions from "@/hooks/usePermissions"; import NoLinksFound from "@/components/NoLinksFound"; +import { useTheme } from "next-themes"; export default function Index() { const { setModal } = useModalStore(); const router = useRouter(); + const { theme } = useTheme(); + const { links } = useLinkStore(); const { collections } = useCollectionStore(); @@ -50,8 +53,17 @@ export default function Index() { return (
-
-
+
+
{activeCollection && (
@@ -84,15 +96,8 @@ export default function Index() { defaultIndex: permissions === true ? 1 : 0, }) } - className="flex justify-center sm:justify-end items-center w-fit mx-auto sm:mr-0 sm:ml-auto group cursor-pointer" + className="hover:opacity-80 duration-100 flex justify-center sm:justify-end items-center w-fit sm:mr-0 sm:ml-auto cursor-pointer" > -
- {permissions === true ? "Manage" : "View"} Team -
{activeCollection?.members .sort((a, b) => (a.userId as number) - (b.userId as number)) .map((e, i) => { @@ -100,7 +105,7 @@ export default function Index() { ); }) @@ -123,7 +128,7 @@ export default function Index() {
setSortDropdown(!sortDropdown)} id="sort-dropdown" - className="inline-flex rounded-md cursor-pointer hover:bg-slate-200 hover:dark:bg-neutral-700 duration-100 p-1" + className="inline-flex rounded-md cursor-pointer hover:bg-black hover:dark:bg-white hover:bg-opacity-10 hover:dark:bg-opacity-10 duration-100 p-1" > setExpandDropdown(!expandDropdown)} id="expand-dropdown" - className="inline-flex rounded-md cursor-pointer hover:bg-slate-200 hover:dark:bg-neutral-700 duration-100 p-1" + className="inline-flex rounded-md cursor-pointer hover:bg-black hover:dark:bg-white hover:bg-opacity-10 hover:dark:bg-opacity-10 duration-100 p-1" > { setModal({ modal: "COLLECTION", diff --git a/pages/subscribe.tsx b/pages/subscribe.tsx index 2868a41..f0c55ca 100644 --- a/pages/subscribe.tsx +++ b/pages/subscribe.tsx @@ -51,7 +51,7 @@ export default function Subscribe() {