diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 6e3b68189..ced91fca5 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -360,11 +360,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
-
-
- -
-
+ +
{ const [isOpen, setIsOpen] = useState(false); const dropdownRef = useRef(null); const buttonRef = useRef(null); + const { t } = useTranslation(); const toggleDropdown = () => { setIsOpen((prev) => !prev); @@ -30,63 +31,45 @@ const Help = () => { }; }, []); - const dropdownPosition = () => { - if (!buttonRef.current) return { top: '100%', left: '0' }; - - const rect = buttonRef.current.getBoundingClientRect(); - const dropdownHeight = 80; // Adjust based on the content height - const spaceBelow = window.innerHeight - rect.bottom; - - const dropdownWidth = 192; // Adjust to fit your design - const spaceRight = window.innerWidth - rect.right; - - let leftPosition = 0; // Default to align with the button - - if (spaceRight < dropdownWidth) { - leftPosition = dropdownWidth - rect.width; - } - - if (spaceBelow >= dropdownHeight) { - return { top: '100%', left: `${leftPosition}px` }; // Open downward - } else { - return { top: `${-dropdownHeight}px`, left: `${leftPosition}px` }; // Open upward - } - }; - return ( -
+
{isOpen && ( )} diff --git a/frontend/src/locale/en.json b/frontend/src/locale/en.json index 76bdea566..335d1e6c8 100644 --- a/frontend/src/locale/en.json +++ b/frontend/src/locale/en.json @@ -10,6 +10,9 @@ "sourceDocs": "Source", "none": "None", "cancel": "Cancel", + "help":"Help", + "emailUs":"Email us", + "documentation":"documentation", "demo": [ { "header": "Learn about DocsGPT", diff --git a/frontend/src/locale/es.json b/frontend/src/locale/es.json index 793efcb97..9358aafa3 100644 --- a/frontend/src/locale/es.json +++ b/frontend/src/locale/es.json @@ -10,6 +10,9 @@ "sourceDocs": "Fuente", "none": "Nada", "cancel": "Cancelar", + "help":"Asistencia", + "emailUs": "Envíanos un correo", + "documentation": "documentación", "demo": [ { "header": "Aprende sobre DocsGPT", diff --git a/frontend/src/locale/jp.json b/frontend/src/locale/jp.json index 725bfeb48..2adc4947d 100644 --- a/frontend/src/locale/jp.json +++ b/frontend/src/locale/jp.json @@ -10,6 +10,9 @@ "sourceDocs": "ソース", "none": "なし", "cancel": "キャンセル", + "help":"ヘルプ", + "emailUs": "メールを送る", + "documentation": "ドキュメント", "demo": [ { "header": "DocsGPTについて学ぶ", diff --git a/frontend/src/locale/zh-TW.json b/frontend/src/locale/zh-TW.json index e91005b51..a826baed1 100644 --- a/frontend/src/locale/zh-TW.json +++ b/frontend/src/locale/zh-TW.json @@ -10,6 +10,9 @@ "sourceDocs": "原始文件", "none": "無", "cancel": "取消", + "help":"聯繫支援", + "emailUs": "寄送電子郵件給我們", + "documentation": "文件", "demo": [ { "header": "了解 DocsGPT", diff --git a/frontend/src/locale/zh.json b/frontend/src/locale/zh.json index 79cf63412..427bddc4c 100644 --- a/frontend/src/locale/zh.json +++ b/frontend/src/locale/zh.json @@ -10,6 +10,9 @@ "sourceDocs": "源", "none": "无", "cancel": "取消", + "help":"联系支持", + "emailUs": "给我们发邮件", + "documentation": "文档", "demo": [ { "header": "了解 DocsGPT",