diff --git a/src/containers/BuildSchedule/CourseClass.js b/src/containers/BuildSchedule/CourseClass.js index bdf8118..cb5b472 100644 --- a/src/containers/BuildSchedule/CourseClass.js +++ b/src/containers/BuildSchedule/CourseClass.js @@ -1,6 +1,6 @@ import React from "react"; import styled from "styled-components"; -// import { useMixpanel } from "hooks/useMixpanel"; +import { useMixpanel } from "hooks/useMixpanel"; import { useSelector, useDispatch } from "react-redux"; import { addSchedule, removeSchedule } from "redux/modules/schedules"; import { useColorModeValue } from "@chakra-ui/react"; @@ -100,8 +100,7 @@ function CourseClass({ course, courseClass }) { dispatch(removeSchedule(item)); } else { dispatch(addSchedule(item)); - // TODO: Re-enable mixpanel or change to other analytics - // useMixpanel.track("select_course"); + useMixpanel.track("select_course"); } }; diff --git a/src/containers/BuildSchedule/SelectMajor.js b/src/containers/BuildSchedule/SelectMajor.js index da612a8..d8cd2ad 100644 --- a/src/containers/BuildSchedule/SelectMajor.js +++ b/src/containers/BuildSchedule/SelectMajor.js @@ -1,5 +1,5 @@ import React from "react"; -// import { useMixpanel } from "hooks/useMixpanel"; +import { useMixpanel } from "hooks/useMixpanel"; import { Flex } from "@chakra-ui/react"; import FACULTIES from "utils/faculty-base-additional-info.json"; import { useForm } from "react-hook-form"; @@ -29,13 +29,11 @@ function SelectMajor({ theme, isMobile, setMajorSelected, show }) { } useEffect(() => { - // TODO: Re-enable mixpanel or change to other analytics - // if (selectedFaculty) useMixpanel.track("select_faculty"); + if (selectedFaculty) useMixpanel.track("select_faculty"); }, [selectedFaculty]); useEffect(() => { - // TODO: Re-enable mixpanel or change to other analytics - // if (selectedMajorName) useMixpanel.track("select_prodi");/ + if (selectedMajorName) useMixpanel.track("select_prodi"); }, [selectedMajorName]); return ( diff --git a/src/containers/BuildSchedule/index.js b/src/containers/BuildSchedule/index.js index c2a1356..b3e363b 100644 --- a/src/containers/BuildSchedule/index.js +++ b/src/containers/BuildSchedule/index.js @@ -1,6 +1,6 @@ import React, { useEffect, useState, useCallback, useRef } from "react"; import { useSelector, useDispatch } from "react-redux"; -// import { useMixpanel } from "hooks/useMixpanel"; +import { useMixpanel } from "hooks/useMixpanel"; import { Button, useColorModeValue, @@ -97,15 +97,13 @@ function BuildSchedule() { } }); - // TODO: Re-enable mixpanel or change to other analytics - // useEffect(() => { - // useMixpanel.track("open_buat_jadwal"); - // }, []); + useEffect(() => { + useMixpanel.track("open_buat_jadwal"); + }, []); useEffect(() => { if (isInitialMount.current) isInitialMount.current = false; - // TODO: Re-enable mixpanel or change to other analytics - // else useMixpanel.track("search_course"); + else useMixpanel.track("search_course"); }, [value]); return ( diff --git a/src/containers/Contributors/index.js b/src/containers/Contributors/index.js index f509699..4d9e89e 100644 --- a/src/containers/Contributors/index.js +++ b/src/containers/Contributors/index.js @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useState } from "react"; -// import { useMixpanel } from "hooks/useMixpanel"; +import { useMixpanel } from "hooks/useMixpanel"; import { Text, Box, Button, Flex, useColorModeValue } from "@chakra-ui/react"; import { ChevronLeftIcon } from "@chakra-ui/icons"; import { Link } from "react-router-dom"; @@ -36,8 +36,7 @@ const Contributors = () => { }, [fetchContributors]); useEffect(() => { - // TODO: Re-enable mixpanel or change to other analytics - // useMixpanel.track("open_contributors"); + useMixpanel.track("open_contributors"); }, []); const MergeContributors = (contributors, otherContributors) => { @@ -91,8 +90,7 @@ const Contributors = () => { avatar={user.avatar_url} github={user.html_url} contributions={user.contributions} - // TODO: Re-enable mixpanel or change to other analytics - // onClick={() => useMixpanel.track("see_contributor_detail")} + onClick={() => useMixpanel.track("see_contributor_detail")} /> )); @@ -139,8 +137,7 @@ const Contributors = () => { useMixpanel.track("gabung_discord")} + onClick={() => useMixpanel.track("gabung_discord")} target="_blank" > diff --git a/src/containers/ViewSchedule/Schedule.js b/src/containers/ViewSchedule/Schedule.js index 972b835..1cfa2e7 100644 --- a/src/containers/ViewSchedule/Schedule.js +++ b/src/containers/ViewSchedule/Schedule.js @@ -5,7 +5,7 @@ import { useSelector } from "react-redux"; import { useColorModeValue } from "@chakra-ui/react"; import { useDisclosure } from "@chakra-ui/react"; import DetailsModal from "./DetailsModal"; -// import { useMixpanel } from "hooks/useMixpanel"; +import { useMixpanel } from "hooks/useMixpanel"; const DAYS = ["Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"]; const pad = (val) => { @@ -63,15 +63,13 @@ function Schedule({ ); const handleClickedCourse = (course) => { - // TODO: Re-enable mixpanel or change to other analytics - // useMixpanel.track("open_course_detail"); + useMixpanel.track("open_course_detail"); setSelectedCourse(course); onOpen(); }; const handleCloseModal = () => { - // TODO: Re-enable mixpanel or change to other analytics - // useMixpanel.track("close_course_detail"); + useMixpanel.track("close_course_detail"); onClose(); }; diff --git a/src/services/sso.js b/src/services/sso.js index 39d1ce3..2146716 100644 --- a/src/services/sso.js +++ b/src/services/sso.js @@ -1,5 +1,5 @@ import config from "config"; -// import { useMixpanel } from "hooks/useMixpanel"; +import { useMixpanel } from "hooks/useMixpanel"; const { SSO_UI_URL, DOMAIN, BASE_URL } = config; @@ -7,13 +7,11 @@ const loginUrl = `${SSO_UI_URL}/login?service=${DOMAIN}${BASE_URL}`; const logoutUrl = `${SSO_UI_URL}/logout?url=${DOMAIN}${BASE_URL}`; export function redirectToSSOLogin() { - // TODO: Re-enable mixpanel or change to other analytics - // useMixpanel.track("login"); + useMixpanel.track("login"); window.location.replace(loginUrl); } export function redirectToSSOLogout() { - // TODO: Re-enable mixpanel or change to other analytics - // useMixpanel.track("logout"); + useMixpanel.track("logout"); window.location.replace(logoutUrl); } diff --git a/src/utils/auth.js b/src/utils/auth.js index 2d001dc..bfdcbdd 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,5 +1,5 @@ import { setupAxiosInstance, validateToken } from "services/api"; -// import { useMixpanel } from "hooks/useMixpanel"; +import { useMixpanel } from "hooks/useMixpanel"; export function persistAuth(auth) { if (!auth) { @@ -7,8 +7,7 @@ export function persistAuth(auth) { } else { setupAxiosInstance(auth.token); localStorage.setItem("auth", JSON.stringify(auth)); - // TODO: Re-enable mixpanel or change to other analytics - // useMixpanel.track("login_successful"); + useMixpanel.track("login_successful"); } }