From 6fdb1ee902dee0bb1670670be4a063b467f266a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E4=BC=9F=E5=BC=BA?= Date: Tue, 16 May 2023 10:42:27 +0800 Subject: [PATCH] feat: explore app list ui --- web/app/(commonLayout)/explore/apps/page.tsx | 31 ++++++++++++++-- web/app/components/explore/app-card/index.tsx | 35 +++++++++++++++++++ .../explore/app-card/style.moudle.css | 0 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 web/app/components/explore/app-card/index.tsx create mode 100644 web/app/components/explore/app-card/style.moudle.css diff --git a/web/app/(commonLayout)/explore/apps/page.tsx b/web/app/(commonLayout)/explore/apps/page.tsx index fd776cf638..883df5cf73 100644 --- a/web/app/(commonLayout)/explore/apps/page.tsx +++ b/web/app/(commonLayout)/explore/apps/page.tsx @@ -1,11 +1,36 @@ import React, { FC } from 'react' +import AppCard from '@/app/components/explore/app-card' export interface IAppsProps { } - +const list = [ + { + id: 1, + name: 'Story Bot', + mode: 'chat', + model_config: { + pre_prompt: 'I need you to play the role of a storyteller, and generate creative and vivid short stories based on the keywords I provide.', + } + }, + { + id: 2, + name: 'Code Translate', + mode: 'completion', + }, +] const Apps: FC = ({ }) => { return ( -
- apps +
+
+
Explore Apps by Dify
+
Use these template apps instantly or customize your own apps based on the templates.
+
+
+ +
) } diff --git a/web/app/components/explore/app-card/index.tsx b/web/app/components/explore/app-card/index.tsx new file mode 100644 index 0000000000..1d1f3ac29c --- /dev/null +++ b/web/app/components/explore/app-card/index.tsx @@ -0,0 +1,35 @@ +'use client' +import Link from 'next/link' +// import { useTranslation } from 'react-i18next' +// import s from './style.module.css' +import AppModeLabel from '@/app/(commonLayout)/apps/AppModeLabel' +import type { App } from '@/types/app' +import AppIcon from '@/app/components/base/app-icon' + +export type AppCardProps = { + app: App +} + +const AppCard = ({ + app, +}: AppCardProps) => { + + return ( + <> + +
+ +
+
{app.name}
+
+
+
{app.model_config?.pre_prompt}
+
+ +
+ + + ) +} + +export default AppCard diff --git a/web/app/components/explore/app-card/style.moudle.css b/web/app/components/explore/app-card/style.moudle.css new file mode 100644 index 0000000000..e69de29bb2