@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
20 lines (19 loc) • 1.08 kB
JavaScript
/**
* CodeAnalizerComment: Updated 2 imports on 2024-09-22 14:49:52
* Update:: import { goToParentSite } to '@mikezimm/fps-core-v7/lib/logic/Links/Navigation;'
* Update:: import { IWebpartBannerProps } to '@mikezimm/fps-core-v7/lib/banner/mainReact/IWebpartBannerProps;'
*/
import * as React from 'react';
import { Icon } from '@fluentui/react/lib/Icon';
import { goToParentSite } from '@mikezimm/fps-core-v7/lib/logic/Links/Navigation';
export function addParentIcon(nearElements, bannerProps) {
const pageContext = bannerProps.context.pageContext;
if (bannerProps.showGoToParent === true &&
pageContext.site.absoluteUrl !== pageContext.web.absoluteUrl) {
let title = 'Go to parent site';
nearElements.push(React.createElement("div", { style: { paddingRight: undefined }, className: '', title: title },
React.createElement(Icon, { iconName: 'Up', onClick: () => goToParentSite(pageContext), style: bannerProps.bannerCmdReactCSS })));
}
return nearElements;
}
//# sourceMappingURL=goParentIcon.js.map