diff --git a/.env b/.env
index 046c07c..7602b9d 100644
--- a/.env
+++ b/.env
@@ -1 +1 @@
-DATABASE_URL="mysql://hp_user:oxU9ExgAHXktIhQZ@79.143.186.18:3306/Superpipo"
\ No newline at end of file
+DATABASE_URL="mysql://root:@localhost:3306/superpipo"
\ No newline at end of file
diff --git a/components/AuthRequired.tsx b/components/AuthRequired.tsx
new file mode 100644
index 0000000..b27318e
--- /dev/null
+++ b/components/AuthRequired.tsx
@@ -0,0 +1,20 @@
+import { useSession } from 'next-auth/react'
+import { useRouter } from 'next/router';
+
+export default function Auth({ children }) {
+ const router = useRouter();
+ const { status } = useSession({
+ required: true,
+ onUnauthenticated: () => router.push(`/signin?info=${encodeURI('Vous devez être connecté pour accéder à cette page')}`)
+ });
+
+ if (status === 'loading') {
+ return (
+
+
Chargement de la session en cours
+
+ );
+ }
+
+ return children;
+}
\ No newline at end of file
diff --git a/components/Categories/Categories.tsx b/components/Categories/Categories.tsx
index d8ea1e4..25f19ab 100644
--- a/components/Categories/Categories.tsx
+++ b/components/Categories/Categories.tsx
@@ -1,6 +1,11 @@
+import LinkTag from 'next/link';
+
import styles from '../../styles/home/categories.module.scss';
import { Category } from '../../types';
+import EditSVG from '../../public/icons/edit.svg';
+import RemoveSVG from '../../public/icons/remove.svg';
+
interface CategoriesProps {
categories: Category[];
categoryActive: Category;
@@ -35,7 +40,28 @@ function CategoryItem({ category, categoryActive, handleSelectCategory }: Catego
return (
- {category.name} — {category.links.length}
+
+ {category.name}
+ — {category.links.length}
+
+
)
+}
+
+function MenuOptions({ id }: { id: number; }): JSX.Element {
+ return (
+
+ )
}
\ No newline at end of file
diff --git a/components/Categories/SideMenu.tsx b/components/Categories/SideMenu.tsx
index 58bb1ab..174bb05 100644
--- a/components/Categories/SideMenu.tsx
+++ b/components/Categories/SideMenu.tsx
@@ -1,12 +1,13 @@
import { Session } from 'next-auth';
import LinkTag from 'next/link';
-import styles from '../../styles/home/categories.module.scss';
-import { Category, Link } from '../../types';
import Categories from './Categories';
import Favorites from './Favorites';
import UserCard from './UserCard';
+import styles from '../../styles/home/categories.module.scss';
+import { Category, Link } from '../../types';
+
interface SideMenuProps {
categories: Category[];
favorites: Link[];
diff --git a/components/Categories/UserCard.tsx b/components/Categories/UserCard.tsx
index 1a0a7bf..df7242d 100644
--- a/components/Categories/UserCard.tsx
+++ b/components/Categories/UserCard.tsx
@@ -1,6 +1,7 @@
import { Session } from 'next-auth';
import { signOut } from 'next-auth/react';
import Image from 'next/image';
+
import styles from '../../styles/home/categories.module.scss';
export default function UserCard({ session }: { session: Session; }) {
@@ -15,7 +16,7 @@ export default function UserCard({ session }: { session: Session; }) {
/>
{session.user.name}
-