From eef7f7ccf52fcbd6af03cecc75bdf0265f1dd677 Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Mon, 9 Jun 2025 15:41:28 +0800 Subject: [PATCH] useDocLink --- web/app/education-apply/education-apply-page.tsx | 5 +++-- web/app/education-apply/verify-state-modal.tsx | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/web/app/education-apply/education-apply-page.tsx b/web/app/education-apply/education-apply-page.tsx index d63ef4f882..97aa3a5d8b 100644 --- a/web/app/education-apply/education-apply-page.tsx +++ b/web/app/education-apply/education-apply-page.tsx @@ -25,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' +import { useDocLink } from '@/i18n/language' const EducationApplyAge = () => { const { t } = useTranslation() const locale = getLocaleOnClient() @@ -42,6 +42,7 @@ const EducationApplyAge = () => { const updateEducationStatus = useInvalidateEducationStatus() const { notify } = useToastContext() const router = useRouter() + const docLink = useDocLink() const handleModalConfirm = () => { setShowModal(undefined) @@ -158,7 +159,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 14a72eb7df..af206b64f5 100644 --- a/web/app/education-apply/verify-state-modal.tsx +++ b/web/app/education-apply/verify-state-modal.tsx @@ -6,7 +6,7 @@ import { } from '@remixicon/react' import Button from '@/app/components/base/button' import { getLocaleOnClient } from '@/i18n' -import { getDocLink } from '@/context/i18n' +import { useDocLink } from '@/i18n/language' export type IConfirm = { className?: string @@ -34,8 +34,8 @@ function Confirm({ const locale = getLocaleOnClient() const dialogRef = useRef(null) const [isVisible, setIsVisible] = useState(isShow) - - const docLink = getDocLink('/getting-started/dify-for-education') + const dl = useDocLink() + const docLink = dl('/getting-started/dify-for-education') const handleClick = () => { window.open(docLink, '_blank', 'noopener,noreferrer')