Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
fix(web): tuiguang (#419)
布莱恩·奥夫托·杰森张1e0993a13d28
diff --git a/project/web/src/app/i18n/locales/en/common.json b/project/web/src/app/i18n/locales/en/common.jsonindex ae1a43a9..132dbf16 100644--- a/project/web/src/app/i18n/locales/en/common.json+++ b/project/web/src/app/i18n/locales/en/common.json@@ -11,6 +11,7 @@"subscribe": "Upgrade","balance": "Credits","plugin": "Extension",+ "affiliates": "Affiliates","pluginStatus": {"notInstalled": "Install","noPermission": "Not Authorized",diff --git a/project/web/src/app/i18n/locales/zh-CN/common.json b/project/web/src/app/i18n/locales/zh-CN/common.jsonindex 908bb142..9f6aa5b7 100644--- a/project/web/src/app/i18n/locales/zh-CN/common.json+++ b/project/web/src/app/i18n/locales/zh-CN/common.json@@ -11,6 +11,7 @@"subscribe": "开通订阅","balance": "额度","plugin": "浏览器插件",+ "affiliates": "推广赚钱","pluginStatus": {"notInstalled": "未安装","noPermission": "未授权",diff --git a/project/web/src/app/layout/LayoutSidebar/components/BottomSection/AffiliatesEntry.tsx b/project/web/src/app/layout/LayoutSidebar/components/BottomSection/AffiliatesEntry.tsxnew file mode 100644index 00000000..f26daddf--- /dev/null+++ b/project/web/src/app/layout/LayoutSidebar/components/BottomSection/AffiliatesEntry.tsx@@ -0,0 +1,51 @@+/**+ * AffiliatesEntry - 推广赚钱入口组件+ */++'use client'++import { Share2 } from 'lucide-react'+import { useTransClient } from '@/app/i18n/client'+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from '@/components/ui/tooltip'+import { cn } from '@/lib/utils'+import type { SidebarCommonProps } from '../../types'++const AFFILIATES_URL = 'https://aitoearn.getrewardful.com/signup?_gl=1*15wk8k8*_gcl_au*MjAzNTIwODgyMi4xNzY1MjkwMjc2LjExMjI2NzUyNDguMTc2NjE1MjM5OS4xNzY2MTUzODYz*_ga*OTk1MTc5MzQzLjE3NjUyOTAyNzY.*_ga_YJYFH7ZS27*czE3NjYxNTIzOTIkbzckZzEkdDE3NjYxNTM4OTQkajQ3JGwwJGgxODk3OTAxMTc1'++export function AffiliatesEntry({ collapsed }: SidebarCommonProps) {+ const { t } = useTransClient('common')++ return (+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger asChild>+ <a+ href={AFFILIATES_URL}+ target="_blank"+ rel="noopener noreferrer"+ className={cn(+ 'flex items-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground',+ collapsed ? 'h-9 w-9 justify-center' : 'justify-between px-3 py-2',+ )}+ >+ <div className="flex items-center gap-2">+ <Share2 size={18} className="text-primary" />+ {!collapsed && <span className="text-sm">{t('affiliates')}</span>}+ </div>+ </a>+ </TooltipTrigger>+ {collapsed && (+ <TooltipContent side="right">+ <p>{t('affiliates')}</p>+ </TooltipContent>+ )}+ </Tooltip>+ </TooltipProvider>+ )+}+diff --git a/project/web/src/app/layout/LayoutSidebar/index.tsx b/project/web/src/app/layout/LayoutSidebar/index.tsxindex 898be642..e8cabb83 100644--- a/project/web/src/app/layout/LayoutSidebar/index.tsx+++ b/project/web/src/app/layout/LayoutSidebar/index.tsx@@ -20,6 +20,7 @@ import {IconBar,UserSection,} from './components'+import { AffiliatesEntry } from './components/BottomSection/AffiliatesEntry'import { useSettingsModalStore } from '@/components/SettingsModal/store'/**@@ -100,6 +101,11 @@ const LayoutSidebar = () => {collapsed={collapsed}/>+ {/* 推广赚钱入口 - 在底部功能区横线上方 */}+ <div className="mt-auto pb-1">+ <AffiliatesEntry collapsed={collapsed} />+ </div>+{/* 底部功能区 */}<BottomSectioncollapsed={collapsed}diff --git a/project/web/src/components/Home/HomeChat/index.tsx b/project/web/src/components/Home/HomeChat/index.tsxindex d65315f1..93fcd2c2 100644--- a/project/web/src/components/Home/HomeChat/index.tsx+++ b/project/web/src/components/Home/HomeChat/index.tsx@@ -205,8 +205,8 @@ export function HomeChat({key={key}src={value.icon}alt={value.name}- width={24}- height={24}+ width={20}+ height={20}className="w-6 h-6 rounded-full object-contain cursor-pointer hover:opacity-80 transition-opacity"style={{marginLeft: index > 0 ? '-8px' : '0',