diff --git a/web/app/education-apply/education-apply-page.tsx b/web/app/education-apply/education-apply-page.tsx index 980e36eb93..d63ef4f882 100644 --- a/web/app/education-apply/education-apply-page.tsx +++ b/web/app/education-apply/education-apply-page.tsx @@ -1,7 +1,6 @@ 'use client' import { - useMemo, useState, } from 'react' import { useTranslation } from 'react-i18next' @@ -26,7 +25,7 @@ import { EDUCATION_VERIFYING_LOCALSTORAGE_ITEM } from '@/app/education-apply/con import { getLocaleOnClient } from '@/i18n' import { noop } from 'lodash-es' import DifyLogo from '../components/base/logo/dify-logo' - +import { getDocLink } from '@/context/i18n' const EducationApplyAge = () => { const { t } = useTranslation() const locale = getLocaleOnClient() @@ -44,14 +43,6 @@ const EducationApplyAge = () => { const { notify } = useToastContext() const router = useRouter() - const docLink = useMemo(() => { - if (locale === 'zh-Hans') - return 'https://docs.dify.ai/zh-hans/getting-started/dify-for-education' - if (locale === 'ja-JP') - return 'https://docs.dify.ai/ja-jp/getting-started/dify-for-education' - return 'https://docs.dify.ai/getting-started/dify-for-education' - }, [locale]) - const handleModalConfirm = () => { setShowModal(undefined) onPlanInfoChanged() @@ -167,7 +158,7 @@ const EducationApplyAge = () => {
{t('education.learn')} diff --git a/web/app/education-apply/verify-state-modal.tsx b/web/app/education-apply/verify-state-modal.tsx index aace6a3bb1..14a72eb7df 100644 --- a/web/app/education-apply/verify-state-modal.tsx +++ b/web/app/education-apply/verify-state-modal.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useRef, useState } from 'react' +import React, { useEffect, useRef, useState } from 'react' import { createPortal } from 'react-dom' import { useTranslation } from 'react-i18next' import { @@ -6,6 +6,7 @@ import { } from '@remixicon/react' import Button from '@/app/components/base/button' import { getLocaleOnClient } from '@/i18n' +import { getDocLink } from '@/context/i18n' export type IConfirm = { className?: string @@ -34,13 +35,7 @@ function Confirm({ const dialogRef = useRef(null) const [isVisible, setIsVisible] = useState(isShow) - const docLink = useMemo(() => { - if (locale === 'zh-Hans') - return 'https://docs.dify.ai/zh-hans/getting-started/dify-for-education' - if (locale === 'ja-JP') - return 'https://docs.dify.ai/ja-jp/getting-started/dify-for-education' - return 'https://docs.dify.ai/getting-started/dify-for-education' - }, [locale]) + const docLink = getDocLink('/getting-started/dify-for-education') const handleClick = () => { window.open(docLink, '_blank', 'noopener,noreferrer')