Skip to content

Commit

Permalink
Add useAuthUser hook and triggerGoal function
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 committed Dec 27, 2023
1 parent 723bef3 commit 4efe08c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Components/Facility/DoctorVideoSlideover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { UserAssignedModel } from "../Users/models";
import { SkillObjectModel } from "../Users/models";
import CareIcon from "../../CAREUI/icons/CareIcon";
import { relativeTime } from "../../Utils/utils";
import useAuthUser from "../../Common/hooks/useAuthUser";
import { triggerGoal } from "../../Integrations/Plausible";

export default function DoctorVideoSlideover(props: {
show: boolean;
Expand Down Expand Up @@ -106,6 +108,7 @@ function UserListItem(props: { user: UserAssignedModel }) {
const user = props.user;
const icon =
user.user_type === "Doctor" ? "fa-user-doctor " : " fa-user-nurse";
const authUser = useAuthUser();

return (
<li>
Expand Down Expand Up @@ -155,6 +158,13 @@ function UserListItem(props: { user: UserAssignedModel }) {
{user.video_connect_link && (
<a
href={user.video_connect_link}
onClick={() => {
triggerGoal("Doctor Connect Click", {
medium: "Video Call",
userId: authUser?.id,
targetUserType: user.user_type,
});
}}
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -176,6 +186,13 @@ function UserListItem(props: { user: UserAssignedModel }) {
)}`
: "#"
}
onClick={() => {
triggerGoal("Doctor Connect Click", {
medium: "WhatsApp",
userId: authUser?.id,
targetUserType: user.user_type,
});
}}
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -190,6 +207,13 @@ function UserListItem(props: { user: UserAssignedModel }) {
href={
user.alt_phone_number ? `tel:${user.alt_phone_number}` : "#"
}
onClick={() => {
triggerGoal("Doctor Connect Click", {
medium: "Phone Call",
userId: authUser?.id,
targetUserType: user.user_type,
});
}}
>
<div className="tooltip">
<span className="tooltip-text tooltip-left">
Expand Down

0 comments on commit 4efe08c

Please sign in to comment.