Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

rename users hook to user

daniel31x13be5400f7cb02
diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx
index f57fcc06..bb3a3dd6 100644
--- a/components/CollectionCard.tsx
+++ b/components/CollectionCard.tsx
@@ -10,7 +10,7 @@ import EditCollectionSharingModal from "./ModalContent/EditCollectionSharingModa
import DeleteCollectionModal from "./ModalContent/DeleteCollectionModal";
import { dropdownTriggerer } from "@/lib/client/utils";
import { useTranslation } from "next-i18next";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
type Props = {
collection: CollectionIncludingMembersAndLinkCount;
diff --git a/components/CollectionListing.tsx b/components/CollectionListing.tsx
index 725c0d64..75b12cc2 100644
--- a/components/CollectionListing.tsx
+++ b/components/CollectionListing.tsx
@@ -16,7 +16,7 @@ import { useRouter } from "next/router";
import toast from "react-hot-toast";
import { useTranslation } from "next-i18next";
import { useCollections, useUpdateCollection } from "@/hooks/store/collections";
-import { useUpdateUser, useUser } from "@/hooks/store/users";
+import { useUpdateUser, useUser } from "@/hooks/store/user";
interface ExtendedTreeItem extends TreeItem {
data: Collection;
diff --git a/components/LinkViews/LinkCard.tsx b/components/LinkViews/LinkCard.tsx
index 189dab4b..e28ee9c2 100644
--- a/components/LinkViews/LinkCard.tsx
+++ b/components/LinkViews/LinkCard.tsx
@@ -20,7 +20,7 @@ import toast from "react-hot-toast";
import LinkTypeBadge from "./LinkComponents/LinkTypeBadge";
import { useTranslation } from "next-i18next";
import { useCollections } from "@/hooks/store/collections";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
type Props = {
link: LinkIncludingShortenedCollectionAndTags;
diff --git a/components/LinkViews/LinkComponents/LinkActions.tsx b/components/LinkViews/LinkComponents/LinkActions.tsx
index 0d0b7eb8..0a3775e2 100644
--- a/components/LinkViews/LinkComponents/LinkActions.tsx
+++ b/components/LinkViews/LinkComponents/LinkActions.tsx
@@ -11,7 +11,7 @@ import useLinkStore from "@/store/links";
import { toast } from "react-hot-toast";
import { dropdownTriggerer } from "@/lib/client/utils";
import { useTranslation } from "next-i18next";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
type Props = {
link: LinkIncludingShortenedCollectionAndTags;
diff --git a/components/LinkViews/LinkList.tsx b/components/LinkViews/LinkList.tsx
index 71c70cfe..9755ad9b 100644
--- a/components/LinkViews/LinkList.tsx
+++ b/components/LinkViews/LinkList.tsx
@@ -16,7 +16,7 @@ import toast from "react-hot-toast";
import LinkTypeBadge from "./LinkComponents/LinkTypeBadge";
import { useTranslation } from "next-i18next";
import { useCollections } from "@/hooks/store/collections";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
type Props = {
link: LinkIncludingShortenedCollectionAndTags;
diff --git a/components/LinkViews/LinkMasonry.tsx b/components/LinkViews/LinkMasonry.tsx
index 8313eb35..ca05f1a3 100644
--- a/components/LinkViews/LinkMasonry.tsx
+++ b/components/LinkViews/LinkMasonry.tsx
@@ -20,7 +20,7 @@ import toast from "react-hot-toast";
import LinkTypeBadge from "./LinkComponents/LinkTypeBadge";
import { useTranslation } from "next-i18next";
import { useCollections } from "@/hooks/store/collections";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
type Props = {
link: LinkIncludingShortenedCollectionAndTags;
diff --git a/components/ModalContent/EditCollectionSharingModal.tsx b/components/ModalContent/EditCollectionSharingModal.tsx
index fd2207ef..158f817f 100644
--- a/components/ModalContent/EditCollectionSharingModal.tsx
+++ b/components/ModalContent/EditCollectionSharingModal.tsx
@@ -10,7 +10,7 @@ import Modal from "../Modal";
import { dropdownTriggerer } from "@/lib/client/utils";
import { useTranslation } from "next-i18next";
import { useUpdateCollection } from "@/hooks/store/collections";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
type Props = {
onClose: Function;
diff --git a/components/ModalContent/PreservedFormatsModal.tsx b/components/ModalContent/PreservedFormatsModal.tsx
index e83d7496..30bd7b64 100644
--- a/components/ModalContent/PreservedFormatsModal.tsx
+++ b/components/ModalContent/PreservedFormatsModal.tsx
@@ -19,7 +19,7 @@ import PreservedFormatRow from "@/components/PreserverdFormatRow";
import getPublicUserData from "@/lib/client/getPublicUserData";
import { useTranslation } from "next-i18next";
import { BeatLoader } from "react-spinners";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
type Props = {
onClose: Function;
diff --git a/components/ProfileDropdown.tsx b/components/ProfileDropdown.tsx
index d610277b..2f262c25 100644
--- a/components/ProfileDropdown.tsx
+++ b/components/ProfileDropdown.tsx
@@ -4,7 +4,7 @@ import ProfilePhoto from "./ProfilePhoto";
import Link from "next/link";
import { signOut } from "next-auth/react";
import { useTranslation } from "next-i18next";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
export default function ProfileDropdown() {
const { t } = useTranslation();
diff --git a/hooks/store/users.tsx b/hooks/store/user.tsx
similarity index 100%
rename from hooks/store/users.tsx
rename to hooks/store/user.tsx
diff --git a/hooks/useCollectivePermissions.ts b/hooks/useCollectivePermissions.ts
index aebb8421..e093b645 100644
--- a/hooks/useCollectivePermissions.ts
+++ b/hooks/useCollectivePermissions.ts
@@ -1,7 +1,7 @@
import { Member } from "@/types/global";
import { useEffect, useState } from "react";
import { useCollections } from "./store/collections";
-import { useUser } from "./store/users";
+import { useUser } from "./store/user";
export default function useCollectivePermissions(collectionIds: number[]) {
const { data: collections = [] } = useCollections();
diff --git a/hooks/useInitialData.tsx b/hooks/useInitialData.tsx
index bb2686fd..cf916233 100644
--- a/hooks/useInitialData.tsx
+++ b/hooks/useInitialData.tsx
@@ -2,7 +2,7 @@ import { useEffect } from "react";
import { useSession } from "next-auth/react";
import useTagStore from "@/store/tags";
import useLocalSettingsStore from "@/store/localSettings";
-import { useUser } from "./store/users";
+import { useUser } from "./store/user";
export default function useInitialData() {
const { status, data } = useSession();
diff --git a/hooks/usePermissions.tsx b/hooks/usePermissions.tsx
index c6e806f7..7b6725ab 100644
--- a/hooks/usePermissions.tsx
+++ b/hooks/usePermissions.tsx
@@ -1,7 +1,7 @@
import { Member } from "@/types/global";
import { useEffect, useState } from "react";
import { useCollections } from "./store/collections";
-import { useUser } from "./store/users";
+import { useUser } from "./store/user";
export default function usePermissions(collectionId: number) {
const { data: collections = [] } = useCollections();
diff --git a/layouts/AuthRedirect.tsx b/layouts/AuthRedirect.tsx
index 69e372eb..821065a6 100644
--- a/layouts/AuthRedirect.tsx
+++ b/layouts/AuthRedirect.tsx
@@ -2,7 +2,7 @@ import { ReactNode, useEffect, useState } from "react";
import { useRouter } from "next/router";
import { useSession } from "next-auth/react";
import useInitialData from "@/hooks/useInitialData";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
interface Props {
children: ReactNode;
diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsx
index e1bb1d9c..0c7ad8e5 100644
--- a/pages/collections/[id].tsx
+++ b/pages/collections/[id].tsx
@@ -25,7 +25,7 @@ import getServerSideProps from "@/lib/client/getServerSideProps";
import { useTranslation } from "next-i18next";
import LinkListOptions from "@/components/LinkListOptions";
import { useCollections } from "@/hooks/store/collections";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
export default function Index() {
const { t } = useTranslation();
diff --git a/pages/settings/account.tsx b/pages/settings/account.tsx
index 5783bf15..5c4b109b 100644
--- a/pages/settings/account.tsx
+++ b/pages/settings/account.tsx
@@ -16,7 +16,7 @@ import Button from "@/components/ui/Button";
import { i18n } from "next-i18next.config";
import { useTranslation } from "next-i18next";
import getServerSideProps from "@/lib/client/getServerSideProps";
-import { useUpdateUser, useUser } from "@/hooks/store/users";
+import { useUpdateUser, useUser } from "@/hooks/store/user";
const emailEnabled = process.env.NEXT_PUBLIC_EMAIL_PROVIDER;
diff --git a/pages/settings/password.tsx b/pages/settings/password.tsx
index 2c7c1b31..d63daf4f 100644
--- a/pages/settings/password.tsx
+++ b/pages/settings/password.tsx
@@ -5,7 +5,7 @@ import { toast } from "react-hot-toast";
import TextInput from "@/components/TextInput";
import { useTranslation } from "next-i18next";
import getServerSideProps from "@/lib/client/getServerSideProps";
-import { useUpdateUser, useUser } from "@/hooks/store/users";
+import { useUpdateUser, useUser } from "@/hooks/store/user";
export default function Password() {
const { t } = useTranslation();
diff --git a/pages/settings/preference.tsx b/pages/settings/preference.tsx
index ae5840b2..18baee74 100644
--- a/pages/settings/preference.tsx
+++ b/pages/settings/preference.tsx
@@ -7,7 +7,7 @@ import useLocalSettingsStore from "@/store/localSettings";
import { useTranslation } from "next-i18next";
import getServerSideProps from "@/lib/client/getServerSideProps"; // Import getServerSideProps for server-side data fetching
import { LinksRouteTo } from "@prisma/client";
-import { useUpdateUser, useUser } from "@/hooks/store/users";
+import { useUpdateUser, useUser } from "@/hooks/store/user";
export default function Appearance() {
const { t } = useTranslation();
diff --git a/pages/subscribe.tsx b/pages/subscribe.tsx
index c795da9d..fb2ad3a5 100644
--- a/pages/subscribe.tsx
+++ b/pages/subscribe.tsx
@@ -7,7 +7,7 @@ import { Plan } from "@/types/global";
import Button from "@/components/ui/Button";
import getServerSideProps from "@/lib/client/getServerSideProps";
import { Trans, useTranslation } from "next-i18next";
-import { useUser } from "@/hooks/store/users";
+import { useUser } from "@/hooks/store/user";
const stripeEnabled = process.env.NEXT_PUBLIC_STRIPE === "true";