mirror of
https://github.com/vale981/Vulcan
synced 2025-03-12 05:26:38 -04:00
24 lines
647 B
JavaScript
24 lines
647 B
JavaScript
![]() |
import { Components, replaceComponent, getSetting, withCurrentUser, Head } from 'meteor/vulcan:core';
|
||
|
import React from 'react';
|
||
|
import Intercom from 'react-intercom';
|
||
|
|
||
|
const IntercomWrapper = ({ currentUser }) => {
|
||
|
const appId = getSetting('intercom.appId');
|
||
|
|
||
|
if (!appId) {
|
||
|
console.warn('Please add intercom.appId to your public settings or disable the vulcan:intercom package.');
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
return <Intercom
|
||
|
appID={appId}
|
||
|
email={currentUser.email}
|
||
|
name={currentUser.displayName}
|
||
|
_id={currentUser._id}
|
||
|
profileUrl={currentUser.pageUrl}
|
||
|
/>;
|
||
|
|
||
|
}
|
||
|
|
||
|
Head.components.push([IntercomWrapper, withCurrentUser]);
|