mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-17 17:27:52 +03:00
Passing custom attributes
Passing the slate user id and username as a custom Intercom attribute. Also added the popup toggle in the ApplicationUserControls, so the popup closes when the user opens intercom
This commit is contained in:
parent
b935e1855b
commit
b07bfd0f35
@ -107,12 +107,16 @@ const OpenIntercom = ({ user }) => {
|
||||
|
||||
return (
|
||||
<span
|
||||
style={{ cursor: "pointer" }}
|
||||
style={{ cursor: "pointer", display: "block" }}
|
||||
onClick={() => {
|
||||
onTogglePopup();
|
||||
update({
|
||||
name: user.data.name,
|
||||
username: user.username,
|
||||
email: user.email,
|
||||
customAttributes: {
|
||||
slate_userid: user.id,
|
||||
username: user.username,
|
||||
},
|
||||
});
|
||||
show();
|
||||
}}
|
||||
@ -234,7 +238,13 @@ export class ApplicationUserControlsPopup extends React.Component {
|
||||
],
|
||||
[
|
||||
{
|
||||
text: <OpenIntercom style={{ display: "block" }} user={this.props.viewer} />,
|
||||
text: (
|
||||
<OpenIntercom
|
||||
style={{ display: "block" }}
|
||||
user={this.props.viewer}
|
||||
onTogglePopup={this.props.onTogglePopup}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
text: "Sign out",
|
||||
|
@ -286,8 +286,11 @@ const OpenIntercom = ({ user }) => {
|
||||
onClick={() => {
|
||||
update({
|
||||
name: user.data.name,
|
||||
username: user.username,
|
||||
email: user.email,
|
||||
customAttributes: {
|
||||
slate_userid: user.id,
|
||||
username: user.username
|
||||
}
|
||||
});
|
||||
show()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user