diff --git a/app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx b/app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx index b34efa53e6..3251af8b36 100644 --- a/app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx +++ b/app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx @@ -22,6 +22,8 @@ import { } from "actions/helpActions"; import { Icon } from "@blueprintjs/core"; import moment from "moment"; +import { getCurrentUser } from "selectors/usersSelectors"; +import { User } from "constants/userConstants"; const { algolia, @@ -308,6 +310,7 @@ type Props = { dispatch: any; hideSearch?: boolean; hideMinimizeBtn?: boolean; + user?: User; }; type State = { showResults: boolean }; @@ -356,6 +359,17 @@ class DocumentationSearch extends React.Component { showResults: props.defaultRefinement.length > 0, }; } + componentDidMount() { + const { user } = this.props; + if (cloudHosting && intercomAppID && window.Intercom) { + window.Intercom("boot", { + app_id: intercomAppID, + user_id: user?.username, + name: user?.name, + email: user?.email, + }); + } + } onSearchValueChange = (event: SyntheticEvent) => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: No types available @@ -439,6 +453,7 @@ class DocumentationSearch extends React.Component { const mapStateToProps = (state: AppState) => ({ defaultRefinement: getDefaultRefinement(state), + user: getCurrentUser(state), }); export default connect(mapStateToProps)(DocumentationSearch); diff --git a/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx b/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx index 51b04fff1c..f71ff00a4f 100644 --- a/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx +++ b/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx @@ -13,12 +13,10 @@ import { getAppsmithConfigs } from "configs"; import { LayersContext } from "constants/Layers"; import { connect } from "react-redux"; import { AppState } from "reducers"; -import { getCurrentUser } from "selectors/usersSelectors"; -import { User } from "constants/userConstants"; import AnalyticsUtil from "utils/AnalyticsUtil"; import { HELP_MODAL_HEIGHT, HELP_MODAL_WIDTH } from "constants/HelpConstants"; -const { algolia, cloudHosting, intercomAppID } = getAppsmithConfigs(); +const { algolia } = getAppsmithConfigs(); const HelpButton = styled.button<{ highlight: boolean; layer: number; @@ -59,25 +57,12 @@ const CloseIcon = HelpIcons.CLOSE_ICON; type Props = { isHelpModalOpen: boolean; dispatch: any; - user?: User; page: string; }; class HelpModal extends React.Component { static contextType = LayersContext; - componentDidMount() { - const { user } = this.props; - if (cloudHosting && intercomAppID && window.Intercom) { - window.Intercom("boot", { - app_id: intercomAppID, - user_id: user?.username, - name: user?.name, - email: user?.email, - }); - } - } - /** * closes help modal * @@ -152,7 +137,6 @@ class HelpModal extends React.Component { const mapStateToProps = (state: AppState) => ({ isHelpModalOpen: getHelpModalOpen(state), - user: getCurrentUser(state), }); export default connect(mapStateToProps)(HelpModal);