mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Bind the route to the navigation bar in the head #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
21
web/src/hooks/logic-hooks/navigate-hooks.ts
Normal file
21
web/src/hooks/logic-hooks/navigate-hooks.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { Routes } from '@/routes';
|
||||
import { useCallback } from 'react';
|
||||
import { useNavigate } from 'umi';
|
||||
|
||||
export const useNavigatePage = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const navigateToDatasetList = useCallback(() => {
|
||||
navigate(Routes.Datasets);
|
||||
}, [navigate]);
|
||||
|
||||
const navigateToDataset = useCallback(() => {
|
||||
navigate(Routes.Dataset);
|
||||
}, [navigate]);
|
||||
|
||||
const navigateToHome = useCallback(() => {
|
||||
navigate(Routes.Home);
|
||||
}, [navigate]);
|
||||
|
||||
return { navigateToDatasetList, navigateToDataset, navigateToHome };
|
||||
};
|
||||
Reference in New Issue
Block a user