diff --git a/.env b/.env
index f56fd6f..e02a63f 100644
--- a/.env
+++ b/.env
@@ -12,11 +12,11 @@ GOOGLE_CLIENT_SECRET=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
DATABASE_URL="postgres://postgres:postgrespwd@localhost:5432/thetiptop"
# Email (magic link)
-EMAIL_SERVER_USER=2bfdbee5372880
-EMAIL_SERVER_PASSWORD=af828174d7f2ad
-EMAIL_SERVER_HOST=smtp.mailtrap.io
-EMAIL_SERVER_PORT=2525
-EMAIL_FROM=thetiptop@test.com
+EMAIL_SERVER_USER=contact@dsp-archiwebo21-ad-ec-cb-mt.fr
+EMAIL_SERVER_PASSWORD=Acem@2022a
+EMAIL_SERVER_HOST=mail50.lwspanel.com
+EMAIL_SERVER_PORT=587
+EMAIL_FROM=contact@dsp-archiwebo21-ad-ec-cb-mt.fr
DATABASE_URL="postgres://postgres:postgrespwd@127.0.0.1:5454/thetiptop"
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 7a73a41..297b8d0 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,2 +1,7 @@
{
+ "workbench.colorCustomizations": {
+ "activityBar.background": "#4C1F25",
+ "titleBar.activeBackground": "#6A2C34",
+ "titleBar.activeForeground": "#FEFCFC"
+ }
}
\ No newline at end of file
diff --git a/components/Loader.tsx b/components/Loader.tsx
new file mode 100644
index 0000000..f4a2535
--- /dev/null
+++ b/components/Loader.tsx
@@ -0,0 +1,15 @@
+import styles from '../styles/Loader.module.css'
+import { MoonLoader } from 'react-spinners'
+
+const Loader = () => {
+ return (
+
+
+
+ );
+}
+
+export default Loader;
\ No newline at end of file
diff --git a/components/NavBar.tsx b/components/NavBar.tsx
index b14f948..ce5faab 100644
--- a/components/NavBar.tsx
+++ b/components/NavBar.tsx
@@ -1,4 +1,4 @@
-import React, { useRef } from "react";
+import React, { useEffect, useRef, useState } from "react";
import logo from '../public/images/thetiptop_logo.webp';
import Link from "next/link";
import { useRouter } from "next/router";
@@ -7,12 +7,13 @@ import style from '../styles/NavBar.module.css';
import Image from 'next/image';
import { FiArrowRight } from 'react-icons/fi';
+import { MdAdminPanelSettings } from 'react-icons/md';
+import { BiExit } from 'react-icons/bi'
const NavBar = () => {
const navRef = useRef();
- const router = useRouter();
- const { data: session, status } = useSession();
- console.log('role', session)
+ const [isAdmin, setIsAdmin] = useState(false)
+ const { data: session } = useSession();
const closeNav = () => {
navRef.current.style.height = "0%";
@@ -26,9 +27,17 @@ const NavBar = () => {
signOut()
}
+ const checkRole = () => {
+ const isAdmin = ['SELLER', 'ADMIN', 'SUPERADMIN'].includes(session?.user['role']);
+ return isAdmin ? setIsAdmin(true) : setIsAdmin(false);
+ }
+
+ useEffect(() => {
+ checkRole();
+ }, [session?.user['role']])
+
let visitor = (