mirror of
https://github.com/langgenius/dify.git
synced 2026-03-20 22:17:58 +08:00
chore: remove uselsess code and refact in site message
This commit is contained in:
@ -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'
|
||||
|
||||
@ -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 = `
|
||||
We’re 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 = `
|
||||
We’re speaking with technical teams to better understand:
|
||||
|
||||
- How you discovered Dify
|
||||
- What resonated — and what didn’t
|
||||
- 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 = `
|
||||
We’re speaking with technical teams to better understand:
|
||||
|
||||
- How you discovered Dify
|
||||
- What resonated — and what didn’t
|
||||
- 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="We’d 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>
|
||||
)
|
||||
}
|
||||
@ -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>
|
||||
|
||||
@ -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[]
|
||||
Reference in New Issue
Block a user