chore: remove uselsess code and refact in site message

This commit is contained in:
Joel
2026-03-09 15:13:13 +08:00
parent bc0f01228c
commit f1949f2f54
4 changed files with 4 additions and 102 deletions

View File

@ -1,7 +1,7 @@
import type { ReactNode } from 'react'
import * as React from 'react'
import { AppInitializer } from '@/app/components/app-initializer'
import InSiteMessageNotification from '@/app/components/app/in-site-message-notification'
import InSiteMessageNotification from '@/app/components/app/in-site-message/notification'
import AmplitudeProvider from '@/app/components/base/amplitude'
import GA, { GaType } from '@/app/components/base/ga'
import Zendesk from '@/app/components/base/zendesk'

View File

@ -1,98 +0,0 @@
'use client'
import InSiteMessage from '@/app/components/app/in-site-message'
import { MarkdownWithDirective } from '@/app/components/base/markdown-with-directive'
const markdown1 = `
Were refining our messaging for technical teams, like how did you find us and did our positioning truly resonate?
Share your perspective in a 30-minute chat and receive:
::::withIconCardList
:::withIconCardItem {icon="https://assets.dify.ai/images/gift-card.png"}
$100 Amazon gift card
:::
:::withIconCardItem {icon="https://assets.dify.ai/images/dify-swag.png"}
Dify swag
:::
::::
`
const markdown2 = `
Were speaking with technical teams to better understand:
- How you discovered Dify
- What resonated — and what didnt
- How we can improve the experience
::::withIconCardList
:::withIconCardItem {icon="https://assets.dify.ai/images/gift-card.png"}
$100 Amazon gift card
:::
:::withIconCardItem {icon="https://assets.dify.ai/images/dify-swag.png"}
Dify swag
:::
::::
`
const inSiteMessageMain = `
Were speaking with technical teams to better understand:
- How you discovered Dify
- What resonated — and what didnt
- How we can improve the experience
As a thank-you for your time:
::::withIconCardList
:::withIconCardItem {icon="https://assets.dify.ai/images/gift-card.png"}
$100 Amazon gift card
:::
:::withIconCardItem {icon="https://assets.dify.ai/images/dify-swag.png"}
Exclusive Dify swag
:::
::::
`
export default function RemarkDirectiveTestPage() {
return (
<main style={{ padding: 24 }}>
<h1 style={{ fontSize: 20, fontWeight: 600, marginBottom: 16 }}>
remark-directive test page
</h1>
<div>
<MarkdownWithDirective markdown={markdown1} />
</div>
<div className="mt-5">
<MarkdownWithDirective markdown={markdown2} />
</div>
<InSiteMessage
title="Help Shape Dify"
subtitle="Wed love to hear how you evaluate and use Dify"
main={inSiteMessageMain}
actions={[
{ type: 'default', text: 'Not now', action: 'close' },
{
type: 'primary',
text: 'Schedule 30-min Chat',
action: 'link',
data: {
href: 'https://dify.ai',
target: '_blank',
},
},
]}
/>
</main>
)
}

View File

@ -102,7 +102,7 @@ function InSiteMessage({
</div>
</div>
<div className="markdown-body px-4 pb-2 pt-4 text-text-secondary body-md-regular">
<div className="px-4 pb-2 pt-4 text-text-secondary body-md-regular [&_p]:mb-2 [&_ul]:list-disc [&_ul]:pl-5">
<MarkdownWithDirective markdown={main} />
</div>

View File

@ -1,11 +1,11 @@
'use client'
import type { InSiteMessageActionItem } from './in-site-message'
import type { InSiteMessageActionItem } from './index'
import { useQuery } from '@tanstack/react-query'
import { useTranslation } from 'react-i18next'
import { IS_CLOUD_EDITION } from '@/config'
import { consoleClient, consoleQuery } from '@/service/client'
import InSiteMessage from './in-site-message'
import InSiteMessage from './index'
type NotificationBodyPayload = {
actions: InSiteMessageActionItem[]