dify
This commit is contained in:
29
dify/web/app/(commonLayout)/education-apply/page.tsx
Normal file
29
dify/web/app/(commonLayout)/education-apply/page.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
'use client'
|
||||
|
||||
import {
|
||||
useEffect,
|
||||
useMemo,
|
||||
} from 'react'
|
||||
import {
|
||||
useRouter,
|
||||
useSearchParams,
|
||||
} from 'next/navigation'
|
||||
import EducationApplyPage from '@/app/education-apply/education-apply-page'
|
||||
import { useProviderContext } from '@/context/provider-context'
|
||||
|
||||
export default function EducationApply() {
|
||||
const router = useRouter()
|
||||
const { enableEducationPlan } = useProviderContext()
|
||||
const searchParams = useSearchParams()
|
||||
const token = searchParams.get('token')
|
||||
const showEducationApplyPage = useMemo(() => {
|
||||
return enableEducationPlan && token
|
||||
}, [enableEducationPlan, token])
|
||||
|
||||
useEffect(() => {
|
||||
if (!showEducationApplyPage)
|
||||
router.replace('/')
|
||||
}, [showEducationApplyPage, router])
|
||||
|
||||
return <EducationApplyPage />
|
||||
}
|
||||
Reference in New Issue
Block a user