mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 08:58:09 +08:00
refactor: route next/navigation through compat re-export (#33636)
This commit is contained in:
@ -8,7 +8,7 @@ const mockReplace = vi.fn()
|
||||
const mockPush = vi.fn()
|
||||
const mockInstalledAppsData = { installed_apps: [] as const }
|
||||
|
||||
vi.mock('next/navigation', () => ({
|
||||
vi.mock('@/next/navigation', () => ({
|
||||
useRouter: () => ({
|
||||
replace: mockReplace,
|
||||
push: mockPush,
|
||||
|
||||
@ -19,7 +19,7 @@ vi.mock('@emoji-mart/data', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('next/navigation', () => ({
|
||||
vi.mock('@/next/navigation', () => ({
|
||||
useParams: () => ({}),
|
||||
}))
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ let mockIsPending = false
|
||||
let mockInstalledApps: InstalledApp[] = []
|
||||
let mockMediaType: string = MediaType.pc
|
||||
|
||||
vi.mock('next/navigation', () => ({
|
||||
vi.mock('@/next/navigation', () => ({
|
||||
useSelectedLayoutSegments: () => mockSegments,
|
||||
useRouter: () => ({
|
||||
push: mockPush,
|
||||
|
||||
@ -3,7 +3,7 @@ import AppNavItem from '../index'
|
||||
|
||||
const mockPush = vi.fn()
|
||||
|
||||
vi.mock('next/navigation', () => ({
|
||||
vi.mock('@/next/navigation', () => ({
|
||||
useRouter: () => ({
|
||||
push: mockPush,
|
||||
}),
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
import type { AppIconType } from '@/types/app'
|
||||
|
||||
import { useHover } from 'ahooks'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import * as React from 'react'
|
||||
import { useRef } from 'react'
|
||||
import AppIcon from '@/app/components/base/app-icon'
|
||||
import ItemOperation from '@/app/components/explore/item-operation'
|
||||
import { useRouter } from '@/next/navigation'
|
||||
import { cn } from '@/utils/classnames'
|
||||
|
||||
export type IAppNavItemProps = {
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
'use client'
|
||||
import { useBoolean } from 'ahooks'
|
||||
import { useSelectedLayoutSegments } from 'next/navigation'
|
||||
import * as React from 'react'
|
||||
import { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@ -8,6 +7,7 @@ import Confirm from '@/app/components/base/confirm'
|
||||
import Divider from '@/app/components/base/divider'
|
||||
import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
|
||||
import Link from '@/next/link'
|
||||
import { useSelectedLayoutSegments } from '@/next/navigation'
|
||||
import { useGetInstalledApps, useUninstallApp, useUpdateAppPinStatus } from '@/service/use-explore'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import Toast from '../../base/toast'
|
||||
|
||||
Reference in New Issue
Block a user