From 901562754d02104e0baaee71dd75ee564af3eb22 Mon Sep 17 00:00:00 2001 From: muhammad-ahmed Date: Thu, 29 Aug 2024 11:16:15 +0800 Subject: [PATCH] ahmed/DAPI-710/fix--internal-link-navigate-with-translation --- src/components/Footer/index.tsx | 35 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 6dfc82eac..b946f10d5 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -14,14 +14,19 @@ const Footer = () => { i18n: { currentLocale }, } = useDocusaurusContext(); - const external_links = React.useMemo(() => { + const footer_links = React.useMemo(() => { const is_en = currentLocale === 'en'; - const get_url = (path: string) => - `https://deriv.com${!is_en ? `/${currentLocale}` : ''}/${path}`; + const get_url = (path: string, isExternal = true) => { + const pathInfo = `${!is_en ? `/${currentLocale}` : ''}/${path}`; + return isExternal ? `https://deriv.com${pathInfo}` : pathInfo; + }; return { root: get_url(''), who_we_are: get_url('who-we-are'), contact_us: get_url('contact-us'), + documentation: get_url('docs/intro', false), + dashboard: get_url('dashboard', false), + api_explorer: get_url('api-explorer', false), }; }, [currentLocale]); @@ -31,17 +36,17 @@ const Footer = () => { content: (