zioinfo-mail/app/node_modules/@react-navigation/native/lib/module/useLinkBuilder.js
DESKTOP-TKLFCPR\ython 11c670f2a0 refactor: 101.79.17.164 → zioinfo.co.kr 전체 도메인 변환 + Manager UI 배포
- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스)
- Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포
- 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 10:09:17 +09:00

54 lines
1.7 KiB
JavaScript

import { getPathFromState, NavigationHelpersContext } from '@react-navigation/core';
import * as React from 'react';
import LinkingContext from './LinkingContext';
const getRootStateForNavigate = (navigation, state) => {
const parent = navigation.getParent();
if (parent) {
const parentState = parent.getState();
return getRootStateForNavigate(parent, {
index: 0,
routes: [{
...parentState.routes[parentState.index],
state: state
}]
});
}
return state;
};
/**
* Build destination link for a navigate action.
* Useful for showing anchor tags on the web for buttons that perform navigation.
*/
export default function useLinkBuilder() {
const navigation = React.useContext(NavigationHelpersContext);
const linking = React.useContext(LinkingContext);
const buildLink = React.useCallback((name, params) => {
const {
options
} = linking;
if ((options === null || options === void 0 ? void 0 : options.enabled) === false) {
return undefined;
}
const state = navigation ? getRootStateForNavigate(navigation, {
index: 0,
routes: [{
name,
params
}]
}) :
// If we couldn't find a navigation object in context, we're at root
// So we'll construct a basic state object to use
{
index: 0,
routes: [{
name,
params
}]
};
const path = options !== null && options !== void 0 && options.getPathFromState ? options.getPathFromState(state, options === null || options === void 0 ? void 0 : options.config) : getPathFromState(state, options === null || options === void 0 ? void 0 : options.config);
return path;
}, [linking, navigation]);
return buildLink;
}
//# sourceMappingURL=useLinkBuilder.js.map