add maidian
This commit is contained in:
parent
248d27680d
commit
77f037a3c4
|
@ -13,7 +13,10 @@ import BotIcon from "../icons/bot.svg";
|
||||||
import { getClientConfig } from "../config/client";
|
import { getClientConfig } from "../config/client";
|
||||||
import LeftIcon from "@/app/icons/left.svg";
|
import LeftIcon from "@/app/icons/left.svg";
|
||||||
import { safeLocalStorage } from "@/app/utils";
|
import { safeLocalStorage } from "@/app/utils";
|
||||||
|
import {
|
||||||
|
trackSettingsPageGuideToCPaymentClick,
|
||||||
|
trackAuthorizationPageButtonToCPaymentClick,
|
||||||
|
} from "../utils/auth-settings-events";
|
||||||
const storage = safeLocalStorage();
|
const storage = safeLocalStorage();
|
||||||
|
|
||||||
export function AuthPage() {
|
export function AuthPage() {
|
||||||
|
@ -22,6 +25,7 @@ export function AuthPage() {
|
||||||
const goHome = () => navigate(Path.Home);
|
const goHome = () => navigate(Path.Home);
|
||||||
const goChat = () => navigate(Path.Chat);
|
const goChat = () => navigate(Path.Chat);
|
||||||
const goSaas = () => {
|
const goSaas = () => {
|
||||||
|
trackAuthorizationPageButtonToCPaymentClick();
|
||||||
window.location.href = SAAS_CHAT_URL;
|
window.location.href = SAAS_CHAT_URL;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -151,11 +155,17 @@ function TopBanner() {
|
||||||
onMouseEnter={handleMouseEnter}
|
onMouseEnter={handleMouseEnter}
|
||||||
onMouseLeave={handleMouseLeave}
|
onMouseLeave={handleMouseLeave}
|
||||||
>
|
>
|
||||||
<div className={styles["top-banner-inner"]}>
|
<div className={`${styles["top-banner-inner"]} no-dark`}>
|
||||||
<Logo className={styles["top-banner-logo"]}></Logo>
|
<Logo className={styles["top-banner-logo"]}></Logo>
|
||||||
<span>
|
<span>
|
||||||
{Locale.Auth.TopTips}
|
{Locale.Auth.TopTips}
|
||||||
<a href={SAAS_CHAT_URL} rel="stylesheet">
|
<a
|
||||||
|
href={SAAS_CHAT_URL}
|
||||||
|
rel="stylesheet"
|
||||||
|
onClick={() => {
|
||||||
|
trackSettingsPageGuideToCPaymentClick();
|
||||||
|
}}
|
||||||
|
>
|
||||||
{Locale.Settings.Access.SaasStart.ChatNow}
|
{Locale.Settings.Access.SaasStart.ChatNow}
|
||||||
<Arrow style={{ marginLeft: "4px" }} />
|
<Arrow style={{ marginLeft: "4px" }} />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -21,7 +21,8 @@ import {
|
||||||
} from "./artifacts";
|
} from "./artifacts";
|
||||||
import { useChatStore } from "../store";
|
import { useChatStore } from "../store";
|
||||||
import { IconButton } from "./button";
|
import { IconButton } from "./button";
|
||||||
|
import { SAAS_CHAT_URL } from "@/app/constant";
|
||||||
|
import { trackConversationGuideToCPaymentClick } from "../utils/auth-settings-events";
|
||||||
export function Mermaid(props: { code: string }) {
|
export function Mermaid(props: { code: string }) {
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
const [hasError, setHasError] = useState(false);
|
const [hasError, setHasError] = useState(false);
|
||||||
|
@ -280,7 +281,13 @@ function _MarkDownContent(props: { content: string }) {
|
||||||
const href = aProps.href || "";
|
const href = aProps.href || "";
|
||||||
const isInternal = /^\/#/i.test(href);
|
const isInternal = /^\/#/i.test(href);
|
||||||
const target = isInternal ? "_self" : aProps.target ?? "_blank";
|
const target = isInternal ? "_self" : aProps.target ?? "_blank";
|
||||||
return <a {...aProps} target={target} />;
|
const handleClick = () => {
|
||||||
|
if (href === SAAS_CHAT_URL) {
|
||||||
|
trackConversationGuideToCPaymentClick();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return <a {...aProps} target={target} onClick={handleClick} />;
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -19,7 +19,7 @@ import ConfirmIcon from "../icons/confirm.svg";
|
||||||
import ConnectionIcon from "../icons/connection.svg";
|
import ConnectionIcon from "../icons/connection.svg";
|
||||||
import CloudSuccessIcon from "../icons/cloud-success.svg";
|
import CloudSuccessIcon from "../icons/cloud-success.svg";
|
||||||
import CloudFailIcon from "../icons/cloud-fail.svg";
|
import CloudFailIcon from "../icons/cloud-fail.svg";
|
||||||
|
import { trackSettingsPageGuideToCPaymentClick } from "../utils/auth-settings-events";
|
||||||
import {
|
import {
|
||||||
Input,
|
Input,
|
||||||
List,
|
List,
|
||||||
|
@ -706,6 +706,7 @@ export function Settings() {
|
||||||
type={"primary"}
|
type={"primary"}
|
||||||
text={Locale.Settings.Access.SaasStart.ChatNow}
|
text={Locale.Settings.Access.SaasStart.ChatNow}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
trackSettingsPageGuideToCPaymentClick();
|
||||||
window.location.href = SAAS_CHAT_URL;
|
window.location.href = SAAS_CHAT_URL;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { sendGAEvent } from "@next/third-parties/google";
|
||||||
|
|
||||||
|
export function trackConversationGuideToCPaymentClick() {
|
||||||
|
sendGAEvent("event", "ConversationGuideToCPaymentClick", { value: 1 });
|
||||||
|
}
|
||||||
|
|
||||||
|
export function trackAuthorizationPageButtonToCPaymentClick() {
|
||||||
|
sendGAEvent("event", "AuthorizationPageButtonToCPaymentClick", { value: 1 });
|
||||||
|
}
|
||||||
|
|
||||||
|
export function trackAuthorizationPageBannerToCPaymentClick() {
|
||||||
|
sendGAEvent("event", "AuthorizationPageBannerToCPaymentClick", {
|
||||||
|
value: 1,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function trackSettingsPageGuideToCPaymentClick() {
|
||||||
|
sendGAEvent("event", "SettingsPageGuideToCPaymentClick", { value: 1 });
|
||||||
|
}
|
Loading…
Reference in New Issue