Add link and pixel selectors to top nav
This commit is contained in:
1 parent
dd2d6bca45
commit
a1f3ad89f6
6 files changed
+255
-17
No files matched your search
@@ -8,6 +8,8 @@ export function useNavigation() {
|
||||
const searchParams = useSearchParams();
|
||||
const [, teamId] = pathname.match(/\/teams\/([a-f0-9-]+)/) || [];
|
||||
const [, websiteId] = pathname.match(/\/websites\/([a-f0-9-]+)/) || [];
|
||||
const [, linkId] = pathname.match(/\/links\/([a-f0-9-]+)/) || [];
|
||||
const [, pixelId] = pathname.match(/\/pixels\/([a-f0-9-]+)/) || [];
|
||||
const [queryParams, setQueryParams] = useState(Object.fromEntries(searchParams));
|
||||
|
||||
const updateParams = (params?: Record<string, string | number>) => {
|
||||
@@ -36,6 +38,8 @@ export function useNavigation() {
|
||||
query: queryParams,
|
||||
teamId,
|
||||
websiteId,
|
||||
linkId,
|
||||
pixelId,
|
||||
updateParams,
|
||||
replaceParams,
|
||||
renderUrl,
|
||||
|
||||
Reference in new issue
Block a user