update /getting-started/dify-for-education in education-apply-page.tsx and verify-state-modal.tsx

pull/20801/head
Bowen Liang 12 months ago
parent 633dcb86cf
commit e923f6c09f

@ -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 = () => {
<div className='mb-4 mt-5 h-[1px] bg-gradient-to-r from-[rgba(16,24,40,0.08)]'></div>
<a
className='system-xs-regular flex items-center text-text-accent'
href={docLink}
href={getDocLink('/getting-started/dify-for-education')}
target='_blank'
>
{t('education.learn')}

@ -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<HTMLDivElement>(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')

Loading…
Cancel
Save