Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private handleAnchorButtonClick = (e) => {
const isIconClicked = !e.getParameter('text');
const { section, onAnchorSelected } = this.props;
if (isIconClicked) {
this.openModal();
} else if (onAnchorSelected) {
onAnchorSelected(Event.of(this, e.getOriginalEvent(), section));
}
};
private onSubSectionClick = (e) => {
const { section, onSubSectionSelected } = this.props;
const selectedId = e.getParameter('item').dataset.key;
const subSection = section.props.children
.filter((item) => item.props && item.props.isSubSection)
.find((item) => item.props.id === selectedId);
if (this.state.open && subSection) {
onSubSectionSelected(Event.of(this, e.getOriginalEvent(), subSection));
}
this.closeModal();
};