From d7a7d1babca17a8b53c746dc67c5e3013cb317bf Mon Sep 17 00:00:00 2001 From: Arif-tekdi-technologies Date: Tue, 15 Oct 2024 15:10:33 +0530 Subject: [PATCH] Issue #PS-2103: Add Workspace UI implementation in admin portal --- src/pages/editor.tsx | 44 ++------------------------------------------ 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/src/pages/editor.tsx b/src/pages/editor.tsx index 2911239c..7a1c4310 100644 --- a/src/pages/editor.tsx +++ b/src/pages/editor.tsx @@ -1,52 +1,12 @@ import React, { useEffect, useState } from "react"; import dynamic from "next/dynamic"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; -import Loader from "@/components/Loader"; -import { useTranslation } from "next-i18next"; // @ts-ignore const Editors = dynamic(() => import("editor/Editor"), { ssr: false }); const Editor = () => { - const { t } = useTranslation(); - const [isAssetsLoaded, setIsAssetsLoaded] = useState(false); - - useEffect(() => { - const loadScriptAndStyles = () => { - if (!document.getElementById("sunbird-editor-css")) { - const link = document.createElement("link"); - link.id = "sunbird-editor-css"; - link.rel = "stylesheet"; - link.href = - "https://cdn.jsdelivr.net/npm/@tekdi/sunbird-questionset-editor-web-component@3.0.1/styles.css"; - document.head.appendChild(link); - } - - if (!document.getElementById("sunbird-editor-script")) { - const script = document.createElement("script"); - script.id = "sunbird-editor-script"; - script.src = - "https://cdn.jsdelivr.net/npm/@tekdi/sunbird-questionset-editor-web-component@3.0.1/sunbird-questionset-editor.js"; - script.async = true; - script.onload = () => setIsAssetsLoaded(true); - document.body.appendChild(script); - } else { - setIsAssetsLoaded(true); - } - }; - - loadScriptAndStyles(); - }, []); - - return ( -
- {isAssetsLoaded ? ( - - ) : ( - - )} -
- ); + return ; }; export default Editor; @@ -58,4 +18,4 @@ export async function getStaticProps({ locale }: any) { ...(await serverSideTranslations(locale, ["common"])), }, }; -} \ No newline at end of file +}