mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* placeholders for address and txs * placeholder for explorer link * move phalcon link * change api endpoint for demo * Fixing upstream header too large * ready flags and navigation events * add ENV --------- Co-authored-by: Nick Zenchik <[email protected]>
25 lines
782 B
TypeScript
25 lines
782 B
TypeScript
import { usePathname } from 'next/navigation';
|
|
import { useRouter } from 'next/router';
|
|
import React from 'react';
|
|
|
|
import config from 'configs/app';
|
|
import getQueryParamString from 'lib/router/getQueryParamString';
|
|
|
|
export default function useNotifyOnNavigation() {
|
|
const router = useRouter();
|
|
const pathname = usePathname();
|
|
const tab = getQueryParamString(router.query.tab);
|
|
|
|
React.useEffect(() => {
|
|
if (config.features.metasuites.isEnabled) {
|
|
window.postMessage({ source: 'APP_ROUTER', type: 'PATHNAME_CHANGED' }, window.location.origin);
|
|
}
|
|
}, [ pathname ]);
|
|
|
|
React.useEffect(() => {
|
|
if (config.features.metasuites.isEnabled) {
|
|
window.postMessage({ source: 'APP_ROUTER', type: 'TAB_CHANGED' }, window.location.origin);
|
|
}
|
|
}, [ tab ]);
|
|
}
|