From b46f67ed672f572cbaeb5a0b9c88d9ede002ce5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E4=BC=9F=E5=BC=BA?= Date: Wed, 17 May 2023 15:45:30 +0800 Subject: [PATCH] feat: option btn --- web/app/components/explore/app-card/index.tsx | 38 +++++++++++++++---- .../explore/app-card/style.module.css | 19 ++++++++++ .../explore/app-card/style.moudle.css | 0 web/app/components/explore/app-list/index.tsx | 23 ++++++++++- .../explore/app-list/style.module.css | 12 ++++++ web/i18n/lang/explore.en.ts | 4 ++ web/i18n/lang/explore.zh.ts | 4 ++ 7 files changed, 90 insertions(+), 10 deletions(-) create mode 100644 web/app/components/explore/app-card/style.module.css delete mode 100644 web/app/components/explore/app-card/style.moudle.css create mode 100644 web/app/components/explore/app-list/style.module.css diff --git a/web/app/components/explore/app-card/index.tsx b/web/app/components/explore/app-card/index.tsx index 1d1f3ac29c..a61ed3bc26 100644 --- a/web/app/components/explore/app-card/index.tsx +++ b/web/app/components/explore/app-card/index.tsx @@ -1,10 +1,19 @@ 'use client' -import Link from 'next/link' -// import { useTranslation } from 'react-i18next' -// import s from './style.module.css' +import cn from 'classnames' +import { useTranslation } from 'react-i18next' import AppModeLabel from '@/app/(commonLayout)/apps/AppModeLabel' import type { App } from '@/types/app' import AppIcon from '@/app/components/base/app-icon' +import { PlusIcon } from '@heroicons/react/20/solid' +import Button from '../../base/button' + +import s from './style.module.css' + +const CustomizeBtn = ( + + + +) export type AppCardProps = { app: App @@ -13,10 +22,11 @@ export type AppCardProps = { const AppCard = ({ app, }: AppCardProps) => { + const { t } = useTranslation() return ( - <> - +
+
@@ -25,10 +35,22 @@ const AppCard = ({
{app.model_config?.pre_prompt}
- +
+ +
+
+ + +
- - +
+
) } diff --git a/web/app/components/explore/app-card/style.module.css b/web/app/components/explore/app-card/style.module.css new file mode 100644 index 0000000000..895d200ef6 --- /dev/null +++ b/web/app/components/explore/app-card/style.module.css @@ -0,0 +1,19 @@ +.wrap { + min-width: 312px; +} + +.opWrap { + display: flex; +} + +.mode { + display: none; +} + +.wrap:hover .mode { + display: none; +} + +.wrap:hover .opWrap { + display: flex; +} \ No newline at end of file diff --git a/web/app/components/explore/app-card/style.moudle.css b/web/app/components/explore/app-card/style.moudle.css deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/web/app/components/explore/app-list/index.tsx b/web/app/components/explore/app-list/index.tsx index 738e1c7c56..ab5012e57a 100644 --- a/web/app/components/explore/app-list/index.tsx +++ b/web/app/components/explore/app-list/index.tsx @@ -1,11 +1,12 @@ 'use client' - import React, { FC, useEffect } from 'react' import { useTranslation } from 'react-i18next' import Category from '@/app/components/explore/category' import AppCard from '@/app/components/explore/app-card' import { fetchAppList } from '@/service/explore' +import s from './style.module.css' + const mockList = [ { id: 1, @@ -22,6 +23,24 @@ const mockList = [ mode: 'completion', category: 'news', }, + { + id: 3, + name: 'Code Translate', + mode: 'completion', + category: 'news', + }, + { + id: 4, + name: 'Code Translate', + mode: 'completion', + category: 'news', + }, + { + id: 5, + name: 'Code Translate', + mode: 'completion', + category: 'news', + }, ] const mockCategories = ['music', 'news'] @@ -59,7 +78,7 @@ const Apps: FC = ({ }) => { onChange={setCurrCategory} />
-