mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-19 04:00:16 +09:00
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 LeftIcon from "@/app/icons/left.svg";
|
||||
import { safeLocalStorage } from "@/app/utils";
|
||||
|
||||
import {
|
||||
trackSettingsPageGuideToCPaymentClick,
|
||||
trackAuthorizationPageButtonToCPaymentClick,
|
||||
} from "../utils/auth-settings-events";
|
||||
const storage = safeLocalStorage();
|
||||
|
||||
export function AuthPage() {
|
||||
@ -22,6 +25,7 @@ export function AuthPage() {
|
||||
const goHome = () => navigate(Path.Home);
|
||||
const goChat = () => navigate(Path.Chat);
|
||||
const goSaas = () => {
|
||||
trackAuthorizationPageButtonToCPaymentClick();
|
||||
window.location.href = SAAS_CHAT_URL;
|
||||
};
|
||||
|
||||
@ -151,11 +155,17 @@ function TopBanner() {
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
>
|
||||
<div className={styles["top-banner-inner"]}>
|
||||
<div className={`${styles["top-banner-inner"]} no-dark`}>
|
||||
<Logo className={styles["top-banner-logo"]}></Logo>
|
||||
<span>
|
||||
{Locale.Auth.TopTips}
|
||||
<a href={SAAS_CHAT_URL} rel="stylesheet">
|
||||
<a
|
||||
href={SAAS_CHAT_URL}
|
||||
rel="stylesheet"
|
||||
onClick={() => {
|
||||
trackSettingsPageGuideToCPaymentClick();
|
||||
}}
|
||||
>
|
||||
{Locale.Settings.Access.SaasStart.ChatNow}
|
||||
<Arrow style={{ marginLeft: "4px" }} />
|
||||
</a>
|
||||
|
@ -21,7 +21,8 @@ import {
|
||||
} from "./artifacts";
|
||||
import { useChatStore } from "../store";
|
||||
import { IconButton } from "./button";
|
||||
|
||||
import { SAAS_CHAT_URL } from "@/app/constant";
|
||||
import { trackConversationGuideToCPaymentClick } from "../utils/auth-settings-events";
|
||||
export function Mermaid(props: { code: string }) {
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const [hasError, setHasError] = useState(false);
|
||||
@ -280,7 +281,13 @@ function _MarkDownContent(props: { content: string }) {
|
||||
const href = aProps.href || "";
|
||||
const isInternal = /^\/#/i.test(href);
|
||||
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 CloudSuccessIcon from "../icons/cloud-success.svg";
|
||||
import CloudFailIcon from "../icons/cloud-fail.svg";
|
||||
|
||||
import { trackSettingsPageGuideToCPaymentClick } from "../utils/auth-settings-events";
|
||||
import {
|
||||
Input,
|
||||
List,
|
||||
@ -706,6 +706,7 @@ export function Settings() {
|
||||
type={"primary"}
|
||||
text={Locale.Settings.Access.SaasStart.ChatNow}
|
||||
onClick={() => {
|
||||
trackSettingsPageGuideToCPaymentClick();
|
||||
window.location.href = SAAS_CHAT_URL;
|
||||
}}
|
||||
/>
|
||||
|
19
app/utils/auth-settings-events.ts
Normal file
19
app/utils/auth-settings-events.ts
Normal file
@ -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
Block a user