From 80289f1dc3e0e80302c66a68f752afcbcb442d5a Mon Sep 17 00:00:00 2001 From: MyPrototypeWhat Date: Fri, 16 May 2025 19:11:46 +0800 Subject: [PATCH] feat: update store components and add dialog management functionality - Updated package.json to use the latest version of the 'motion' library. - Refactored store components to improve organization and user experience, including the addition of AssistantCard and MiniAppCard components. - Introduced a DialogManager for handling dialog states and interactions. - Enhanced StoreContent and StoreSidebar components to support new item types and improved layout. - Added new JSON data for mini-apps and updated store categories for better accessibility. --- package.json | 2 +- resources/data/store_categories.json | 12 +- resources/data/store_list_mini-app.json | 691 ++++++++++++++++++ .../components/Assistant/AssistantCard.tsx | 39 + .../src/pages/store/components/GridView.tsx | 100 +-- .../src/pages/store/components/ListView.tsx | 6 +- .../store/components/MiniApp/MiniAppCard.tsx | 27 + .../store/components/MiniApp/logoList.ts | 111 +++ .../pages/store/components/StoreContent.tsx | 13 +- .../pages/store/components/StoreSidebar.tsx | 104 ++- .../dialog/DialogManagerContext.tsx | 38 + .../InstallDialog.tsx} | 2 +- .../pages/store/components/dialog/index.tsx | 36 + src/renderer/src/pages/store/index.tsx | 62 +- src/renderer/src/types/cherryStore.ts | 13 +- yarn.lock | 42 +- 16 files changed, 1130 insertions(+), 168 deletions(-) create mode 100644 resources/data/store_list_mini-app.json create mode 100644 src/renderer/src/pages/store/components/Assistant/AssistantCard.tsx create mode 100644 src/renderer/src/pages/store/components/MiniApp/MiniAppCard.tsx create mode 100644 src/renderer/src/pages/store/components/MiniApp/logoList.ts create mode 100644 src/renderer/src/pages/store/components/dialog/DialogManagerContext.tsx rename src/renderer/src/pages/store/components/{ItemDetailDialog.tsx => dialog/InstallDialog.tsx} (99%) create mode 100644 src/renderer/src/pages/store/components/dialog/index.tsx diff --git a/package.json b/package.json index c4b9e0fcb8..c228edc65a 100644 --- a/package.json +++ b/package.json @@ -185,7 +185,7 @@ "lru-cache": "^11.1.0", "lucide-react": "^0.509.0", "mime": "^4.0.4", - "motion": "^12.11.0", + "motion": "^12.12.1", "next-themes": "^0.4.6", "npx-scope-finder": "^1.2.0", "openai": "patch:openai@npm%3A4.96.0#~/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch", diff --git a/resources/data/store_categories.json b/resources/data/store_categories.json index e7a6a68d34..26314d3b6e 100644 --- a/resources/data/store_categories.json +++ b/resources/data/store_categories.json @@ -21,7 +21,7 @@ ] }, { - "id": "assistant", + "id": "Assistant", "title": "助手", "items": [ { @@ -192,12 +192,12 @@ ] }, { - "id": "mini-app", + "id": "Mini-App", "title": "小程序", "items": [] }, { - "id": "knowledge", + "id": "Knowledge", "title": "知识库", "items": [ { @@ -243,7 +243,7 @@ ] }, { - "id": "mcp-server", + "id": "MCP-Server", "title": "MCP 服务器", "items": [ { @@ -333,12 +333,12 @@ ] }, { - "id": "model-provider", + "id": "Model-Provider", "title": "模型服务", "items": [] }, { - "id": "agent", + "id": "Agent", "title": "智能体", "items": [] } diff --git a/resources/data/store_list_mini-app.json b/resources/data/store_list_mini-app.json new file mode 100644 index 0000000000..fd6273d75d --- /dev/null +++ b/resources/data/store_list_mini-app.json @@ -0,0 +1,691 @@ +[ + { + "id": "mini-app-openai", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "ChatGPT", + "description": "", + "author": "openai", + "image": "OpenAiProviderLogo", + "tags": [], + "url": "https://chatgpt.com/", + "bodered": true + }, + { + "id": "mini-app-gemini", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Gemini", + "description": "", + "author": "gemini", + "image": "GeminiAppLogo", + "tags": [], + "url": "https://gemini.google.com/" + }, + { + "id": "mini-app-silicon", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "SiliconFlow", + "description": "", + "author": "silicon", + "image": "SiliconFlowProviderLogo", + "tags": [], + "url": "https://cloud.siliconflow.cn/playground/chat" + }, + { + "id": "mini-app-deepseek", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "DeepSeek", + "description": "", + "author": "deepseek", + "image": "DeepSeekProviderLogo", + "tags": [], + "url": "https://chat.deepseek.com/" + }, + { + "id": "mini-app-yi", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "万知", + "description": "", + "author": "yi", + "image": "WanZhiAppLogo", + "tags": [], + "url": "https://www.wanzhi.com/", + "bodered": true + }, + { + "id": "mini-app-zhipu", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "智谱清言", + "description": "", + "author": "zhipu", + "image": "ZhipuProviderLogo", + "tags": [], + "url": "https://chatglm.cn/main/alltoolsdetail" + }, + { + "id": "mini-app-moonshot", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Kimi", + "description": "", + "author": "moonshot", + "image": "KimiAppLogo", + "tags": [], + "url": "https://kimi.moonshot.cn/" + }, + { + "id": "mini-app-baichuan", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "百小应", + "description": "", + "author": "baichuan", + "image": "BaicuanAppLogo", + "tags": [], + "url": "https://ying.baichuan-ai.com/chat" + }, + { + "id": "mini-app-dashscope", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "通义千问", + "description": "", + "author": "dashscope", + "image": "QwenModelLogo", + "tags": [], + "url": "https://tongyi.aliyun.com/qianwen/" + }, + { + "id": "mini-app-stepfun", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "跃问", + "description": "", + "author": "stepfun", + "image": "YuewenAppLogo", + "tags": [], + "url": "https://yuewen.cn/chats/new", + "bodered": true + }, + { + "id": "mini-app-doubao", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "豆包", + "description": "", + "author": "doubao", + "image": "DoubaoAppLogo", + "tags": [], + "url": "https://www.doubao.com/chat/" + }, + { + "id": "mini-app-cici", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Cici", + "description": "", + "author": "cici", + "image": "CiciAppLogo", + "tags": [], + "url": "https://www.cici.com/chat/" + }, + { + "id": "mini-app-minimax", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "海螺", + "description": "", + "author": "minimax", + "image": "HailuoModelLogo", + "tags": [], + "url": "https://hailuoai.com/" + }, + { + "id": "mini-app-groq", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Groq", + "description": "", + "author": "groq", + "image": "GroqProviderLogo", + "tags": [], + "url": "https://chat.groq.com/" + }, + { + "id": "mini-app-anthropic", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Claude", + "description": "", + "author": "anthropic", + "image": "ClaudeAppLogo", + "tags": [], + "url": "https://claude.ai/" + }, + { + "id": "mini-app-baidu-ai-chat", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "文心一言", + "description": "", + "author": "baidu-ai-chat", + "image": "BaiduAiAppLogo", + "tags": [], + "url": "https://yiyan.baidu.com/" + }, + { + "id": "mini-app-baidu-ai-search", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "百度AI搜索", + "description": "", + "author": "baidu-ai-search", + "image": "BaiduAiSearchLogo", + "tags": [], + "url": "https://chat.baidu.com/", + "bodered": true, + "style": { + "padding": 5 + } + }, + { + "id": "mini-app-tencent-yuanbao", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "腾讯元宝", + "description": "", + "author": "tencent-yuanbao", + "image": "TencentYuanbaoAppLogo", + "tags": [], + "url": "https://yuanbao.tencent.com/chat", + "bodered": true + }, + { + "id": "mini-app-sensetime-chat", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "商量", + "description": "", + "author": "sensetime-chat", + "image": "SensetimeAppLogo", + "tags": [], + "url": "https://chat.sensetime.com/wb/chat", + "bodered": true + }, + { + "id": "mini-app-spark-desk", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "SparkDesk", + "description": "", + "author": "spark-desk", + "image": "SparkDeskAppLogo", + "tags": [], + "url": "https://xinghuo.xfyun.cn/desk" + }, + { + "id": "mini-app-metaso", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "秘塔AI搜索", + "description": "", + "author": "metaso", + "image": "MetasoAppLogo", + "tags": [], + "url": "https://metaso.cn/" + }, + { + "id": "mini-app-poe", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Poe", + "description": "", + "author": "poe", + "image": "PoeAppLogo", + "tags": [], + "url": "https://poe.com" + }, + { + "id": "mini-app-perplexity", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Perplexity", + "description": "", + "author": "perplexity", + "image": "PerplexityAppLogo", + "tags": [], + "url": "https://www.perplexity.ai/" + }, + { + "id": "mini-app-devv", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "DEVV_", + "description": "", + "author": "devv", + "image": "DevvAppLogo", + "tags": [], + "url": "https://devv.ai/" + }, + { + "id": "mini-app-tiangong-ai", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "天工AI", + "description": "", + "author": "tiangong-ai", + "image": "TiangongAiLogo", + "tags": [], + "url": "https://www.tiangong.cn/", + "bodered": true + }, + { + "id": "mini-app-hugging-chat", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "HuggingChat", + "description": "", + "author": "hugging-chat", + "image": "HuggingChatLogo", + "tags": [], + "url": "https://huggingface.co/chat/", + "bodered": true + }, + { + "id": "mini-app-Felo", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Felo", + "description": "", + "author": "Felo", + "image": "FeloAppLogo", + "tags": [], + "url": "https://felo.ai/", + "bodered": true + }, + { + "id": "mini-app-duckduckgo", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "DuckDuckGo", + "description": "", + "author": "duckduckgo", + "image": "DuckDuckGoAppLogo", + "tags": [], + "url": "https://duck.ai" + }, + { + "id": "mini-app-bolt", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "bolt", + "description": "", + "author": "bolt", + "image": "BoltAppLogo", + "tags": [], + "url": "https://bolt.new/", + "bodered": true + }, + { + "id": "mini-app-nm", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "纳米AI", + "description": "", + "author": "nm", + "image": "NamiAiLogo", + "tags": [], + "url": "https://bot.n.cn/", + "bodered": true + }, + { + "id": "mini-app-nm-search", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "纳米AI搜索", + "description": "", + "author": "nm-search", + "image": "NamiAiSearchLogo", + "tags": [], + "url": "https://www.n.cn/", + "bodered": true + }, + { + "id": "mini-app-thinkany", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "ThinkAny", + "description": "", + "author": "thinkany", + "image": "ThinkAnyLogo", + "tags": [], + "url": "https://thinkany.ai/", + "bodered": true, + "style": { + "padding": 5 + } + }, + { + "id": "mini-app-hika", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Hika", + "description": "", + "author": "hika", + "image": "HikaLogo", + "tags": [], + "url": "https://hika.fyi/", + "bodered": true + }, + { + "id": "mini-app-github-copilot", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "GitHub Copilot", + "description": "", + "author": "github-copilot", + "image": "GithubCopilotLogo", + "tags": [], + "url": "https://github.com/copilot" + }, + { + "id": "mini-app-genspark", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Genspark", + "description": "", + "author": "genspark", + "image": "GensparkLogo", + "tags": [], + "url": "https://www.genspark.ai/" + }, + { + "id": "mini-app-grok", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Grok", + "description": "", + "author": "grok", + "image": "GrokAppLogo", + "tags": [], + "url": "https://grok.com", + "bodered": true + }, + { + "id": "mini-app-grok-x", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Grok / X", + "description": "", + "author": "grok-x", + "image": "GrokXAppLogo", + "tags": [], + "url": "https://x.com/i/grok", + "bodered": true + }, + { + "id": "mini-app-qwenlm", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "QwenLM", + "description": "", + "author": "qwenlm", + "image": "QwenlmAppLogo", + "tags": [], + "url": "https://qwenlm.ai/" + }, + { + "id": "mini-app-flowith", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Flowith", + "description": "", + "author": "flowith", + "image": "FlowithAppLogo", + "tags": [], + "url": "https://www.flowith.io/", + "bodered": true + }, + { + "id": "mini-app-3mintop", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "3MinTop", + "description": "", + "author": "3mintop", + "image": "ThreeMinTopAppLogo", + "tags": [], + "url": "https://3min.top", + "bodered": false + }, + { + "id": "mini-app-aistudio", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "AI Studio", + "description": "", + "author": "aistudio", + "image": "AIStudioLogo", + "tags": [], + "url": "https://aistudio.google.com/" + }, + { + "id": "mini-app-xiaoyi", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "小艺", + "description": "", + "author": "xiaoyi", + "image": "XiaoYiAppLogo", + "tags": [], + "url": "https://xiaoyi.huawei.com/chat/", + "bodered": true + }, + { + "id": "mini-app-notebooklm", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "NotebookLM", + "description": "", + "author": "notebooklm", + "image": "NotebookLMAppLogo", + "tags": [], + "url": "https://notebooklm.google.com/" + }, + { + "id": "mini-app-coze", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Coze", + "description": "", + "author": "coze", + "image": "CozeAppLogo", + "tags": [], + "url": "https://www.coze.com/space", + "bodered": true + }, + { + "id": "mini-app-dify", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Dify", + "description": "", + "author": "dify", + "image": "DifyAppLogo", + "tags": [], + "url": "https://cloud.dify.ai/apps", + "bodered": true, + "style": { + "padding": 5 + } + }, + { + "id": "mini-app-wpslingxi", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "WPS灵犀", + "description": "", + "author": "wpslingxi", + "image": "WPSLingXiLogo", + "tags": [], + "url": "https://copilot.wps.cn/", + "bodered": true + }, + { + "id": "mini-app-lechat", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "LeChat", + "description": "", + "author": "lechat", + "image": "LeChatLogo", + "tags": [], + "url": "https://chat.mistral.ai/chat", + "bodered": true + }, + { + "id": "mini-app-abacus", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Abacus", + "description": "", + "author": "abacus", + "image": "AbacusLogo", + "tags": [], + "url": "https://apps.abacus.ai/chatllm", + "bodered": true + }, + { + "id": "mini-app-lambdachat", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Lambda Chat", + "description": "", + "author": "lambdachat", + "image": "LambdaChatLogo", + "tags": [], + "url": "https://lambda.chat/", + "bodered": true + }, + { + "id": "mini-app-monica", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Monica", + "description": "", + "author": "monica", + "image": "MonicaLogo", + "tags": [], + "url": "https://monica.im/home/", + "bodered": true + }, + { + "id": "mini-app-you", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "You", + "description": "", + "author": "you", + "image": "YouLogo", + "tags": [], + "url": "https://you.com/" + }, + { + "id": "mini-app-zhihu", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "知乎直答", + "description": "", + "author": "zhihu", + "image": "ZhihuAppLogo", + "tags": [], + "url": "https://zhida.zhihu.com/", + "bodered": true + }, + { + "id": "mini-app-dangbei", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "当贝AI", + "description": "", + "author": "dangbei", + "image": "DangbeiLogo", + "tags": [], + "url": "https://ai.dangbei.com/", + "bodered": true + }, + { + "id": "mini-app-zai", + "type": "Mini-App", + "categoryId": "mini-app", + "subcategoryId": "", + "title": "Z.ai", + "description": "", + "author": "zai", + "image": "ZaiAppLogo", + "tags": [], + "url": "https://chat.z.ai/", + "bodered": true, + "style": { + "padding": 10 + } + } +] diff --git a/src/renderer/src/pages/store/components/Assistant/AssistantCard.tsx b/src/renderer/src/pages/store/components/Assistant/AssistantCard.tsx new file mode 100644 index 0000000000..e0e87fec47 --- /dev/null +++ b/src/renderer/src/pages/store/components/Assistant/AssistantCard.tsx @@ -0,0 +1,39 @@ +import { AssistantItem } from '@renderer/types/cherryStore' +import { Badge } from '@renderer/ui/badge' +import { Card, CardContent, CardHeader, CardTitle } from '@renderer/ui/card' +import { BlurFade } from '@renderer/ui/third-party/BlurFade' +import { cn } from '@renderer/utils' + +import { useDialogManager } from '../dialog/DialogManagerContext' + +export default function AssistantCard({ item }: { item: AssistantItem }) { + const { openDialog } = useDialogManager() + + const handleCardClick = () => { + openDialog('install', item) + } + + return ( + + + +
+ {item.icon} +
+
+ + {item.title} +

{item.author}

+
+ {item.tags.map((tag) => ( + + {tag} + + ))} +
+

{item.description}

+
+
+
+ ) +} diff --git a/src/renderer/src/pages/store/components/GridView.tsx b/src/renderer/src/pages/store/components/GridView.tsx index fc09e8436c..6cd07d042a 100644 --- a/src/renderer/src/pages/store/components/GridView.tsx +++ b/src/renderer/src/pages/store/components/GridView.tsx @@ -1,70 +1,46 @@ -import { CherryStoreItem } from '@renderer/types/cherryStore' -import { Badge } from '@renderer/ui/badge' -import { Card, CardContent, CardHeader, CardTitle } from '@renderer/ui/card' -import { BlurFade } from '@renderer/ui/third-party/BlurFade' -import { cn } from '@renderer/utils' -import { useState } from 'react' +import { AssistantItem, CherryStoreItem, CherryStoreType, MiniAppItem } from '@renderer/types/cherryStore' +import { Fragment, useMemo } from 'react' -import { ItemDetailDialog } from './ItemDetailDialog' +import AssistantCard from './Assistant/AssistantCard' +import MiniAppCard from './MiniApp/MiniAppCard' -export function GridView({ items }: { items: CherryStoreItem[] }) { - const [selectedItemForDetail, setSelectedItemForDetail] = useState(null) - const [isDetailDialogOpen, setIsDetailDialogOpen] = useState(false) +interface GridViewProps { + items: CherryStoreItem[] + selectedCategory: string + className?: string +} - const handleCardClick = (item: CherryStoreItem) => { - setSelectedItemForDetail(item) - setIsDetailDialogOpen(true) +const CardComponent = (selectedCategory: string, item: CherryStoreItem) => { + switch (selectedCategory) { + case CherryStoreType.ASSISTANT: + return + case CherryStoreType.MINI_APP: + return + default: + return null } +} + +export function GridView({ items, selectedCategory }: GridViewProps) { + const effectiveGridClass = useMemo(() => { + let gridClass = 'columns-4 gap-4 ' + + switch (selectedCategory) { + case CherryStoreType.ASSISTANT: + gridClass += '2xl:columns-6' + break + case CherryStoreType.MINI_APP: + gridClass = 'grid grid-cols-8 gap-4 2xl:grid-cols-10' + break + } + return gridClass + }, [selectedCategory]) return ( - <> -
- {items.map((item) => ( - - handleCardClick(item)}> - - {item.icon ? ( -
- {item.icon} -
- ) : ( -
- {item.title} -
- )} -
- - {item.title} -

{item.author}

-
- {item.tags.map((tag) => ( - - {tag} - - ))} -
-

- {item.description} -

-
-
-
- ))} -
- setIsDetailDialogOpen(false)} - /> - +
+ {items.map((item) => ( + {CardComponent(selectedCategory, item)} + ))} +
) } diff --git a/src/renderer/src/pages/store/components/ListView.tsx b/src/renderer/src/pages/store/components/ListView.tsx index 42f8fd7004..ccae16190c 100644 --- a/src/renderer/src/pages/store/components/ListView.tsx +++ b/src/renderer/src/pages/store/components/ListView.tsx @@ -3,7 +3,7 @@ import { Badge } from '@renderer/ui/badge' import { Card } from '@renderer/ui/card' import { useState } from 'react' -import { ItemDetailDialog } from './ItemDetailDialog' +// import { ItemDetailDialog } from './ItemDetailDialog' export function ListView({ items }: { items: CherryStoreItem[] }) { const [selectedItemForDetail, setSelectedItemForDetail] = useState(null) @@ -73,11 +73,11 @@ export function ListView({ items }: { items: CherryStoreItem[] }) { ))} - setIsDetailDialogOpen(false)} - /> + /> */} ) } diff --git a/src/renderer/src/pages/store/components/MiniApp/MiniAppCard.tsx b/src/renderer/src/pages/store/components/MiniApp/MiniAppCard.tsx new file mode 100644 index 0000000000..ade49d5c89 --- /dev/null +++ b/src/renderer/src/pages/store/components/MiniApp/MiniAppCard.tsx @@ -0,0 +1,27 @@ +import { useMinappPopup } from '@renderer/hooks/useMinappPopup' +import { MiniAppItem } from '@renderer/types/cherryStore' +import { BlurFade } from '@renderer/ui/third-party/BlurFade' + +import logoList from './logoList' +export default function MiniAppCard({ item }: { item: MiniAppItem }) { + const { openMinappKeepAlive } = useMinappPopup() + const handleClick = () => { + openMinappKeepAlive({ + id: item.id, + name: item.title, + url: item.url, + logo: item.image, + style: item.style + }) + } + return ( + +
+ {item.title} +
+

{item.title}

+
+
+
+ ) +} diff --git a/src/renderer/src/pages/store/components/MiniApp/logoList.ts b/src/renderer/src/pages/store/components/MiniApp/logoList.ts new file mode 100644 index 0000000000..0142901bf6 --- /dev/null +++ b/src/renderer/src/pages/store/components/MiniApp/logoList.ts @@ -0,0 +1,111 @@ +import ThreeMinTopAppLogo from '@renderer/assets/images/apps/3mintop.png?url' +import AbacusLogo from '@renderer/assets/images/apps/abacus.webp?url' +import AIStudioLogo from '@renderer/assets/images/apps/aistudio.svg?url' +import BaiduAiAppLogo from '@renderer/assets/images/apps/baidu-ai.png?url' +import BaiduAiSearchLogo from '@renderer/assets/images/apps/baidu-ai-search.webp?url' +import BaicuanAppLogo from '@renderer/assets/images/apps/baixiaoying.webp?url' +import BoltAppLogo from '@renderer/assets/images/apps/bolt.svg?url' +import CiciAppLogo from '@renderer/assets/images/apps/cici.webp?url' +import CozeAppLogo from '@renderer/assets/images/apps/coze.webp?url' +import DangbeiLogo from '@renderer/assets/images/apps/dangbei.jpg?url' +import DevvAppLogo from '@renderer/assets/images/apps/devv.png?url' +import DifyAppLogo from '@renderer/assets/images/apps/dify.svg?url' +import DoubaoAppLogo from '@renderer/assets/images/apps/doubao.png?url' +import DuckDuckGoAppLogo from '@renderer/assets/images/apps/duckduckgo.webp?url' +import FeloAppLogo from '@renderer/assets/images/apps/felo.png?url' +import FlowithAppLogo from '@renderer/assets/images/apps/flowith.svg?url' +import GeminiAppLogo from '@renderer/assets/images/apps/gemini.png?url' +import GensparkLogo from '@renderer/assets/images/apps/genspark.jpg?url' +import GithubCopilotLogo from '@renderer/assets/images/apps/github-copilot.webp?url' +import GrokAppLogo from '@renderer/assets/images/apps/grok.png?url' +import GrokXAppLogo from '@renderer/assets/images/apps/grok-x.png?url' +import HikaLogo from '@renderer/assets/images/apps/hika.webp?url' +import HuggingChatLogo from '@renderer/assets/images/apps/huggingchat.svg?url' +import KimiAppLogo from '@renderer/assets/images/apps/kimi.webp?url' +import LambdaChatLogo from '@renderer/assets/images/apps/lambdachat.webp?url' +import LeChatLogo from '@renderer/assets/images/apps/lechat.png?url' +import MetasoAppLogo from '@renderer/assets/images/apps/metaso.webp?url' +import MonicaLogo from '@renderer/assets/images/apps/monica.webp?url' +import NamiAiLogo from '@renderer/assets/images/apps/nm.png?url' +import NamiAiSearchLogo from '@renderer/assets/images/apps/nm-search.webp?url' +import NotebookLMAppLogo from '@renderer/assets/images/apps/notebooklm.svg?url' +import PerplexityAppLogo from '@renderer/assets/images/apps/perplexity.webp?url' +import PoeAppLogo from '@renderer/assets/images/apps/poe.webp?url' +import ZhipuProviderLogo from '@renderer/assets/images/apps/qingyan.png?url' +import QwenlmAppLogo from '@renderer/assets/images/apps/qwenlm.webp?url' +import SensetimeAppLogo from '@renderer/assets/images/apps/sensetime.png?url' +import SparkDeskAppLogo from '@renderer/assets/images/apps/sparkdesk.webp?url' +import ThinkAnyLogo from '@renderer/assets/images/apps/thinkany.webp?url' +import TiangongAiLogo from '@renderer/assets/images/apps/tiangong.png?url' +import WanZhiAppLogo from '@renderer/assets/images/apps/wanzhi.jpg?url' +import WPSLingXiLogo from '@renderer/assets/images/apps/wpslingxi.webp?url' +import XiaoYiAppLogo from '@renderer/assets/images/apps/xiaoyi.webp?url' +import YouLogo from '@renderer/assets/images/apps/you.jpg?url' +import TencentYuanbaoAppLogo from '@renderer/assets/images/apps/yuanbao.webp?url' +import YuewenAppLogo from '@renderer/assets/images/apps/yuewen.png?url' +import ZaiAppLogo from '@renderer/assets/images/apps/zai.png?url' +import ZhihuAppLogo from '@renderer/assets/images/apps/zhihu.png?url' +import ClaudeAppLogo from '@renderer/assets/images/models/claude.png?url' +import HailuoModelLogo from '@renderer/assets/images/models/hailuo.png?url' +import QwenModelLogo from '@renderer/assets/images/models/qwen.png?url' +import DeepSeekProviderLogo from '@renderer/assets/images/providers/deepseek.png?url' +import GroqProviderLogo from '@renderer/assets/images/providers/groq.png?url' +import OpenAiProviderLogo from '@renderer/assets/images/providers/openai.png?url' +import SiliconFlowProviderLogo from '@renderer/assets/images/providers/silicon.png?url' + +export default { + ThreeMinTopAppLogo, + AbacusLogo, + AIStudioLogo, + BaiduAiAppLogo, + BaiduAiSearchLogo, + BaicuanAppLogo, + BoltAppLogo, + CiciAppLogo, + CozeAppLogo, + DangbeiLogo, + DevvAppLogo, + DifyAppLogo, + DoubaoAppLogo, + DuckDuckGoAppLogo, + FeloAppLogo, + FlowithAppLogo, + GeminiAppLogo, + GensparkLogo, + GithubCopilotLogo, + GrokAppLogo, + GrokXAppLogo, + HikaLogo, + HuggingChatLogo, + KimiAppLogo, + LambdaChatLogo, + LeChatLogo, + MetasoAppLogo, + MonicaLogo, + NamiAiLogo, + NamiAiSearchLogo, + NotebookLMAppLogo, + PerplexityAppLogo, + PoeAppLogo, + QwenlmAppLogo, + SensetimeAppLogo, + SparkDeskAppLogo, + ThinkAnyLogo, + TiangongAiLogo, + WanZhiAppLogo, + WPSLingXiLogo, + XiaoYiAppLogo, + YouLogo, + TencentYuanbaoAppLogo, + YuewenAppLogo, + ZaiAppLogo, + ZhihuAppLogo, + ClaudeAppLogo, + HailuoModelLogo, + QwenModelLogo, + DeepSeekProviderLogo, + GroqProviderLogo, + OpenAiProviderLogo, + SiliconFlowProviderLogo, + ZhipuProviderLogo +} diff --git a/src/renderer/src/pages/store/components/StoreContent.tsx b/src/renderer/src/pages/store/components/StoreContent.tsx index 4847a1809a..c3213b3104 100644 --- a/src/renderer/src/pages/store/components/StoreContent.tsx +++ b/src/renderer/src/pages/store/components/StoreContent.tsx @@ -1,10 +1,11 @@ import { CherryStoreItem } from '@renderer/types/cherryStore' import { Button } from '@renderer/ui/button' -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@renderer/ui/dropdown-menu' import { Input } from '@renderer/ui/input' import { cn } from '@renderer/utils' -import { Filter, Grid3X3, List, Search } from 'lucide-react' +import { Grid3X3, List, Search } from 'lucide-react' +import React from 'react' // Import React for ComponentType +// Import the card components // Define the type for a store item based on store_list.json import { GridView } from './GridView' import { ListView } from './ListView' @@ -21,6 +22,7 @@ interface StoreContentProps { export function StoreContent({ viewMode, searchQuery, + selectedCategory, // This prop will drive the component choice items, onSearchQueryChange, onViewModeChange @@ -42,19 +44,18 @@ export function StoreContent({ onChange={(e) => onSearchQueryChange(e.target.value)} /> - + {/* - {/* Add actual filtering logic later */} Most Popular Newest Highest Rated - + */}