diff --git a/components/Links/Links.tsx b/components/Links/Links.tsx
index 61b8b4e..96f1017 100644
--- a/components/Links/Links.tsx
+++ b/components/Links/Links.tsx
@@ -6,7 +6,6 @@ import LinkItem from "./LinkItem";
import styles from "./links.module.scss";
export default function Links({ category }: { category: Category }) {
- console.log("render", category);
if (category === null) {
return (
diff --git a/components/SideMenu/Categories/CategoryItem.tsx b/components/SideMenu/Categories/CategoryItem.tsx
index 8a25c63..bd9dac8 100644
--- a/components/SideMenu/Categories/CategoryItem.tsx
+++ b/components/SideMenu/Categories/CategoryItem.tsx
@@ -32,8 +32,8 @@ export default function CategoryItem({
}, [category.id, categoryActive.id]);
return (
-
-
+
+
{category.name}
— {category.links.length}
diff --git a/components/SideMenu/SideMenu.tsx b/components/SideMenu/SideMenu.tsx
index 913575b..c2f2b3f 100644
--- a/components/SideMenu/SideMenu.tsx
+++ b/components/SideMenu/SideMenu.tsx
@@ -1,4 +1,3 @@
-import { Session } from "next-auth";
import LinkTag from "next/link";
import BlockWrapper from "../BlockWrapper/BlockWrapper";
@@ -15,14 +14,12 @@ interface SideMenuProps {
favorites: Link[];
handleSelectCategory: (category: Category) => void;
categoryActive: Category;
- session: Session;
}
export default function SideMenu({
categories,
favorites,
handleSelectCategory,
categoryActive,
- session,
}: SideMenuProps) {
return (
@@ -40,7 +37,7 @@ export default function SideMenu({
-
+
);
diff --git a/components/SideMenu/UserCard/UserCard.tsx b/components/SideMenu/UserCard/UserCard.tsx
index 8ee9a2d..4badeb5 100644
--- a/components/SideMenu/UserCard/UserCard.tsx
+++ b/components/SideMenu/UserCard/UserCard.tsx
@@ -1,21 +1,21 @@
-import { Session } from "next-auth";
-import { signOut } from "next-auth/react";
+import { signOut, useSession } from "next-auth/react";
import Image from "next/image";
import { FiLogOut } from "react-icons/fi";
import styles from "./user-card.module.scss";
-export default function UserCard({ session }: { session: Session }) {
+export default function UserCard() {
+ const { data } = useSession({ required: true });
return (
- {session.user.name}
+ {data.user.name}