cooronx commented on code in PR #466:
URL: https://github.com/apache/casbin-website/pull/466#discussion_r3073091712


##########
src/pages/gallery.js:
##########
@@ -1,56 +1,28 @@
-import React, {useEffect, useState} from "react";
+import React, {useEffect} from "react";
+import Head from "@docusaurus/Head";
 import Layout from "@theme/Layout";
-import Giscus from "@giscus/react";
-import {useColorMode} from "@docusaurus/theme-common";
-import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
+import Link from "@docusaurus/Link";
 
-function GalleryContent() {
-  const {colorMode} = useColorMode();
-  const {i18n} = useDocusaurusContext();
-  const currentLanguage = i18n.currentLocale;
-  const [galleryUrl, setGalleryUrl] = useState("");
+const GALLERY_URL = "https://editor.casbin.org/gallery";;
 
+function Gallery() {
   useEffect(() => {
-    
setGalleryUrl(`https://editor.casbin.org/gallery?theme=${colorMode}&lang=${currentLanguage}`);
-  }, [colorMode, currentLanguage]);
-
-  return (
-    <>
-      <div className="editor-container">
-        <iframe
-          src={galleryUrl}
-          className="editor-iframe"
-          title="Apache Casbin Gallery"
-        />
-      </div>
-      <div className="comments-container">
-        <Giscus
-          id="comments"
-          repo="casbin/casbin"
-          repoId="MDEwOlJlcG9zaXRvcnk4NzYxNzUwOA=="
-          category="Docs comments"
-          categoryId="DIC_kwDOBTjv5M4CRIiA"
-          mapping="pathname"
-          strict="0"
-          reactionsEnabled="1"
-          emitMetadata="0"
-          inputPosition="top"
-          theme={colorMode}
-          lang={currentLanguage}
-          loading="lazy"
-        />
-      </div>
-    </>
-  );
-}
+    window.location.replace(GALLERY_URL);
+  }, []);
 
-function Gallery() {
   return (
-    <Layout
-      title="Gallery"
-      description="Apache Casbin Online Gallery"
-    >
-      <GalleryContent />
+    <Layout title="Redirecting to Gallery" description="Redirecting to the 
Apache Casbin authorization model gallery">
+      <Head>
+        <meta httpEquiv="refresh" content={`0;url=${GALLERY_URL}`} />
+        <link rel="canonical" href={GALLERY_URL} />
+      </Head>

Review Comment:
   we do have netlify.toml, but we deployed at asf-site



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to