diff --git a/docusaurus.config.js b/docusaurus.config.js
index a17cb885..5ff24e98 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -513,8 +513,8 @@ const config = {
announcementBar: {
id: 'new_version',
content:
- 'Announcing the release of ScalarDB 3.15!๐ For details on what\'s included in this new version, see the release notes.',
- // 'Announcing the release of ScalarDB X.X!๐ For details on what\'s included in this new version, see the release notes.',
+ 'Announcing the release of ScalarDB 3.15!๐ For details on what\'s included in this new version, see the release notes.',
+ // 'Announcing the release of ScalarDB X.X!๐ For details on what\'s included in this new version, see the release notes.',
backgroundColor: '#2673BB',
textColor: '#FFFFFF',
isCloseable: false,
diff --git a/src/components/Support/SupportDropdownMenu.tsx b/src/components/Support/SupportDropdownMenu.tsx
index b0eb356d..ff8dfdaa 100644
--- a/src/components/Support/SupportDropdownMenu.tsx
+++ b/src/components/Support/SupportDropdownMenu.tsx
@@ -1,14 +1,15 @@
-import React, { useState, useEffect, useRef, lazy, Suspense, MouseEvent } from 'react';
-import { useDoc } from '@docusaurus/plugin-content-docs/client';
+import React, { useState, useEffect, useRef, lazy, Suspense, MouseEvent } from "react";
+import { useDoc } from "@docusaurus/plugin-content-docs/client";
import { useLocation } from "@docusaurus/router";
// Lazy-load AssistantModal.
-const AssistantModal = lazy(() => import('./AssistantModal'));
+const AssistantModal = lazy(() => import("./AssistantModal"));
const SupportDropdownMenu: React.FC = () => {
const [isOpen, setIsOpen] = useState(false);
const [isModalOpen, setIsModalOpen] = useState(false);
const [storedUrl, setStoredUrl] = useState(null);
+ const [githubIssueUrl, setGithubIssueUrl] = useState("#");
const dropdownRef = useRef(null);
const location = useLocation();
@@ -23,14 +24,60 @@ const SupportDropdownMenu: React.FC = () => {
if (typeof window !== "undefined") {
const currentUrl = `https://scalardb.scalar-labs.com${location.pathname}`;
localStorage.setItem("currentUrl", currentUrl);
-
- const savedUrl = localStorage.getItem("currentUrl");
- if (savedUrl) {
- setStoredUrl(savedUrl);
- }
+ setStoredUrl(currentUrl);
}
}, [location]);
+ useEffect(() => {
+ if (typeof window !== "undefined") {
+ const repoUrl = "https://github.com/scalar-labs/docs-scalardb/issues/new";
+ const issueTitle = encodeURIComponent(
+ isJapanese ? `ใใฃใผใใใใฏ: \`${docTitle}\` ใใผใธ` : `Feedback: \`${docTitle}\` page`
+ );
+
+ const issueBody = encodeURIComponent(
+ isJapanese
+ ? `**ใใญใฅใกใณใใใผใธใฎ URL:** ${window.location.href.replace(/#.*$/, '')}
+
+ ## ๆๅพ
ใใใๅไฝ
+
+ ใฉใฎใใใชๅไฝใๆๅพ
ใใพใใใ๏ผ
+
+ ## ๅ้กใฎ่ชฌๆ
+
+ ๅ้กใฎๅ
ๅฎนใใใใใใใ่ชฌๆใใฆใใ ใใใ
+
+ ### ๅ็พๆ้ (่ฉฒๅฝใใๅ ดๅ)
+
+ ๅ้กใๅ็พใงใใๅ ดๅใๆ้ ใ่จ่ผใใฆใใ ใใใ
+
+ ### ในใฏใชใผใณใทใงใใ (่ฉฒๅฝใใๅ ดๅ)
+
+ ่ฉฒๅฝใใๅ ดๅใฏใในใฏใชใผใณใทใงใใใๆทปไปใใฆใใ ใใใ`
+ : `**Documentation page URL:** ${window.location.href.replace(/#.*$/, '')}
+
+ ## Expected behavior
+
+ What did you expect to happen?
+
+ ## Describe the problem
+
+ Please provide a clear and concise description of what the issue is.
+
+ ### Steps to reproduce (if applicable)
+
+ If the issue is reproducible, please list the steps to reproduce it.
+
+ ### Screenshots (if applicable)
+
+ If applicable, add screenshots to help explain your problem.`
+ );
+
+ const issueUrl = `${repoUrl}?title=${issueTitle}&body=${issueBody}&labels=documentation`;
+ setGithubIssueUrl(issueUrl);
+ }
+ }, [isJapanese, docTitle]);
+
const toggleDropdown = () => {
setIsOpen((prev) => !prev);
};
@@ -45,67 +92,23 @@ const SupportDropdownMenu: React.FC = () => {
setIsModalOpen(false);
};
- const handleSupportClick = () => {
+ const handleSupportClick = (event: MouseEvent) => {
+ event.preventDefault();
if (typeof window !== "undefined") {
const finalUrl = storedUrl || `https://scalardb.scalar-labs.com${location.pathname}`;
const reportUrl = `https://support.scalar-labs.com/hc/ja/requests/new?ticket_form_id=8641483507983&tf_11847415366927=${encodeURIComponent(finalUrl)}`;
-
window.open(reportUrl, "_blank");
}
};
- const githubIssueUrl: string = typeof window !== "undefined" ? (() => {
- const repoUrl = "https://github.com/scalar-labs/docs-scalardb/issues/new";
- const issueTitle = encodeURIComponent(
- isJapanese ? `ใใฃใผใใใใฏ: \`${docTitle}\` ใใผใธ` : `Feedback: \`${docTitle}\` page`
- );
-
- const issueBody = encodeURIComponent(
- isJapanese
- ? `**ใใญใฅใกใณใใใผใธใฎ URL:** ${window.location.href.replace(/#.*$/, '')}
-
-## ๆๅพ
ใใใๅไฝ
-
-ใฉใฎใใใชๅไฝใๆๅพ
ใใพใใใ๏ผ
-
-## ๅ้กใฎ่ชฌๆ
-
-ๅ้กใฎๅ
ๅฎนใใใใใใใ่ชฌๆใใฆใใ ใใใ
-
-### ๅ็พๆ้ (่ฉฒๅฝใใๅ ดๅ)
-
-ๅ้กใๅ็พใงใใๅ ดๅใๆ้ ใ่จ่ผใใฆใใ ใใใ
-
-### ในใฏใชใผใณใทใงใใ (่ฉฒๅฝใใๅ ดๅ)
-
-่ฉฒๅฝใใๅ ดๅใฏใในใฏใชใผใณใทใงใใใๆทปไปใใฆใใ ใใใ
-`
- : `**Documentation page URL:** ${window.location.href.replace(/#.*$/, '')}
-
-## Expected behavior
-
-What did you expect to happen?
-
-## Describe the problem
-
-Please provide a clear and concise description of what the issue is.
-
-### Steps to reproduce (if applicable)
-
-If the issue is reproducible, please list the steps to reproduce it.
-
-### Screenshots (if applicable)
-
-If applicable, add screenshots to help explain your problem.
-`
- );
-
- const issueUrl = `${repoUrl}?title=${issueTitle}&body=${issueBody}&labels=documentation`;
-
- console.log("GitHub Issue URL: ", issueUrl); // Debugging line
-
- return issueUrl;
- })() : "#";
+ const handleGitHubClick = (event: MouseEvent) => {
+ event.preventDefault();
+ if (githubIssueUrl !== "#") {
+ window.open(githubIssueUrl, "_blank", "noopener,noreferrer");
+ } else {
+ console.error("GitHub issue URL is not set correctly.");
+ }
+ };
useEffect(() => {
function handleClickOutside(event: MouseEvent | Event) {
@@ -126,32 +129,30 @@ If applicable, add screenshots to help explain your problem.
return (
-
}>