pull/20801/head
Bowen Liang 12 months ago
parent 090c9f730c
commit d0a4c564c6

@ -3,13 +3,11 @@ import type { FC } from 'react'
import React from 'react' import React from 'react'
import { ArrowTopRightOnSquareIcon } from '@heroicons/react/24/outline' import { ArrowTopRightOnSquareIcon } from '@heroicons/react/24/outline'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useContext } from 'use-context-selector' import { useDocLink } from '@/context/i18n'
import type { AppMode } from '@/types/app' import type { AppMode } from '@/types/app'
import I18n from '@/context/i18n'
import Button from '@/app/components/base/button' import Button from '@/app/components/base/button'
import Modal from '@/app/components/base/modal' import Modal from '@/app/components/base/modal'
import Tag from '@/app/components/base/tag' import Tag from '@/app/components/base/tag'
import { LanguagesSupported } from '@/i18n/language'
type IShareLinkProps = { type IShareLinkProps = {
isShow: boolean isShow: boolean
@ -43,7 +41,7 @@ const CustomizeModal: FC<IShareLinkProps> = ({
mode, mode,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const { locale } = useContext(I18n) const docLink = useDocLink()
const isChatApp = mode === 'chat' || mode === 'advanced-chat' const isChatApp = mode === 'chat' || mode === 'advanced-chat'
return <Modal return <Modal
@ -101,10 +99,7 @@ const CustomizeModal: FC<IShareLinkProps> = ({
className='mt-2' className='mt-2'
onClick={() => onClick={() =>
window.open( window.open(
`https://docs.dify.ai/${locale !== LanguagesSupported[1] docLink('/guides/application-publishing/developing-with-apis'),
? 'user-guide/launching-dify-apps/developing-with-apis'
: `${locale.toLowerCase()}/guides/application-publishing/developing-with-apis`
}`,
'_blank', '_blank',
) )
} }

Loading…
Cancel
Save