From 8cd7a5663ab9bda647b718b5636fde2832b34542 Mon Sep 17 00:00:00 2001 From: Sujoy Paul Date: Fri, 17 Feb 2023 02:22:45 +0600 Subject: [PATCH 1/5] fixing the self error of jodit-react --- components/Dashboard/UserComps/PrivacyPolicy.js | 14 ++++++++++++-- components/Shared/Navbar/Navbar.js | 3 +++ components/hooks/privateRoute.js | 12 ++++++------ package-lock.json | 14 +++++++------- package.json | 2 +- 5 files changed, 29 insertions(+), 16 deletions(-) diff --git a/components/Dashboard/UserComps/PrivacyPolicy.js b/components/Dashboard/UserComps/PrivacyPolicy.js index 9d1c80f..4ebf474 100644 --- a/components/Dashboard/UserComps/PrivacyPolicy.js +++ b/components/Dashboard/UserComps/PrivacyPolicy.js @@ -1,7 +1,17 @@ -import React, { useEffect, useRef, useState } from 'react'; -import JoditEditor from 'jodit-react'; + +import dynamic from 'next/dynamic'; +import React, { useEffect, useRef, useState, useMemo } from 'react'; + +const JoditEditor = dynamic(() => { + if (typeof window !== 'undefined') { + // Load jodit-react on the client-side + return import('jodit-react'); + } + return null; +}, { ssr: false }); const PrivacyPolicy = () => { + const editor = useRef(null); const [privacyContent, setPrivacyContent] = useState(''); const [termsContent, setTermsContent] = useState(''); diff --git a/components/Shared/Navbar/Navbar.js b/components/Shared/Navbar/Navbar.js index 3665aab..4440e19 100644 --- a/components/Shared/Navbar/Navbar.js +++ b/components/Shared/Navbar/Navbar.js @@ -207,6 +207,9 @@ const Navbar = () => {
  • Dashboard
  • +
  • + Live Session +
  • {' '}