mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Layout updates.
This commit is contained in:
parent
e4c5f42189
commit
476dd52875
23 changed files with 97 additions and 86 deletions
|
|
@ -10,7 +10,7 @@ export * from './useFormat';
|
|||
export * from './useLanguageNames';
|
||||
export * from './useLocale';
|
||||
export * from './useMessages';
|
||||
export * from './usePageQuery';
|
||||
export * from './useNavigation';
|
||||
export * from './useReport';
|
||||
export * from './useReports';
|
||||
export * from './useRequireLogin';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { useMemo } from 'react';
|
|||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { buildUrl } from 'next-basics';
|
||||
|
||||
export function usePageQuery() {
|
||||
export function useNavigation() {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const params = useSearchParams();
|
||||
|
|
@ -17,11 +17,11 @@ export function usePageQuery() {
|
|||
return obj;
|
||||
}, [params]);
|
||||
|
||||
function resolveUrl(params, reset) {
|
||||
return buildUrl(pathname, { ...(reset ? {} : query) });
|
||||
function makeUrl(params, reset) {
|
||||
return reset ? pathname : buildUrl(pathname, { ...query, ...params });
|
||||
}
|
||||
|
||||
return { pathname, query, resolveUrl, router };
|
||||
return { pathname, query, router, makeUrl };
|
||||
}
|
||||
|
||||
export default usePageQuery;
|
||||
export default useNavigation;
|
||||
Loading…
Add table
Add a link
Reference in a new issue