From 552475dd5c1b0a427bd7f5ba2879d2badbfb3254 Mon Sep 17 00:00:00 2001 From: balibabu Date: Tue, 29 Apr 2025 15:32:50 +0800 Subject: [PATCH] Feat: Adjust the style of the home page #3221 (#7405) ### What problem does this PR solve? Feat: Adjust the style of the home page #3321 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- web/src/layouts/next-header.tsx | 2 +- web/src/pages/datasets/dataset-card.tsx | 17 ++++++++++++++++- web/src/pages/home/applications.tsx | 4 +++- web/src/pages/home/banner.tsx | 11 +++++++++++ web/src/pages/home/chat-list.tsx | 15 +++++++++++++++ web/src/pages/home/datasets.tsx | 11 ++--------- web/src/pages/home/index.tsx | 4 ++-- web/tailwind.config.js | 1 + web/tailwind.css | 4 ++++ 9 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 web/src/pages/home/chat-list.tsx diff --git a/web/src/layouts/next-header.tsx b/web/src/layouts/next-header.tsx index a2e6ff8a2..88defad16 100644 --- a/web/src/layouts/next-header.tsx +++ b/web/src/layouts/next-header.tsx @@ -72,7 +72,7 @@ export function Header() { }, [navigate]); return ( -
+
); } + +export function SeeAllCard() { + const { navigateToDatasetList } = useNavigatePage(); + + return ( + + + See All + + + ); +} diff --git a/web/src/pages/home/applications.tsx b/web/src/pages/home/applications.tsx index 4b1e40a82..0330dcbf3 100644 --- a/web/src/pages/home/applications.tsx +++ b/web/src/pages/home/applications.tsx @@ -5,6 +5,7 @@ import { useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Agents } from './agent-list'; import { ApplicationCard } from './application-card'; +import { ChatList } from './chat-list'; const applications = [ { @@ -70,12 +71,13 @@ export function Applications() { >
- {val === Routes.Agents || + {(val === 'all' || val === Routes.Searches) && [...Array(12)].map((_, i) => { const app = applications[i % 4]; return ; })} {val === Routes.Agents && } + {val === Routes.Chats && }
); diff --git a/web/src/pages/home/banner.tsx b/web/src/pages/home/banner.tsx index 8b33101a6..6b7f03ed9 100644 --- a/web/src/pages/home/banner.tsx +++ b/web/src/pages/home/banner.tsx @@ -37,3 +37,14 @@ export function Banner() {
); } + +export function NextBanner() { + return ( +
+ Welcome to + + RAGFlow + +
+ ); +} diff --git a/web/src/pages/home/chat-list.tsx b/web/src/pages/home/chat-list.tsx new file mode 100644 index 000000000..937d5a079 --- /dev/null +++ b/web/src/pages/home/chat-list.tsx @@ -0,0 +1,15 @@ +import { useFetchNextDialogList } from '@/hooks/chat-hooks'; +import { ApplicationCard } from './application-card'; + +export function ChatList() { + const { data } = useFetchNextDialogList(); + + return data + .slice(0, 10) + .map((x) => ( + + )); +} diff --git a/web/src/pages/home/datasets.tsx b/web/src/pages/home/datasets.tsx index 95bfdc49b..18b7c4c5f 100644 --- a/web/src/pages/home/datasets.tsx +++ b/web/src/pages/home/datasets.tsx @@ -1,9 +1,8 @@ import { RenameDialog } from '@/components/rename-dialog'; -import { Button } from '@/components/ui/button'; import { CardSkeleton } from '@/components/ui/skeleton'; import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks'; import { useFetchNextKnowledgeListByPage } from '@/hooks/use-knowledge-request'; -import { DatasetCard } from '../datasets/dataset-card'; +import { DatasetCard, SeeAllCard } from '../datasets/dataset-card'; import { useRenameDataset } from '../datasets/use-rename-dataset'; export function Datasets() { @@ -37,13 +36,7 @@ export function Datasets() { ))} )} - + {datasetRenameVisible && ( { return (
- +
diff --git a/web/tailwind.config.js b/web/tailwind.config.js index e771541cc..680822972 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -44,6 +44,7 @@ module.exports = { 'background-badge': 'var(--background-badge)', 'text-badge': 'var(--text-badge)', + 'text-title': 'var(--text-title)', primary: { DEFAULT: 'hsl(var(--primary))', diff --git a/web/tailwind.css b/web/tailwind.css index 0ead42993..9659452cc 100644 --- a/web/tailwind.css +++ b/web/tailwind.css @@ -76,6 +76,8 @@ --background-badge: rgba(22, 22, 24, 0.5); --text-badge: rgba(151, 154, 171, 1); + + --text-title: rgba(22, 22, 24, 1); } .dark { @@ -172,6 +174,8 @@ --sidebar-accent-foreground: 240 4.8% 95.9%; --sidebar-border: 240 3.7% 15.9%; --sidebar-ring: 217.2 91.2% 59.8%; + + --text-title: rgba(255, 255, 255, 1); } }