feat: add MCP service tag filtering, transaction record viewing, and various optimizations
This commit is contained in:
1 parent
276817e624
commit
d6dea1f1e8
29 files changed
+1367
-87
No files matched your search
@@ -24,11 +24,18 @@ import { Footer } from "./Footer";
|
||||
import { Navigation } from "./Navigation";
|
||||
import { NavigationItem } from "@/shared/components/Navigation";
|
||||
import { Faq } from "@/components/marketplace/Faq";
|
||||
import { TagFilter } from "@/shared/components/marketplace/TagFilter";
|
||||
import { ThemeType } from "@/shared/types/system";
|
||||
|
||||
interface HomeProps {
|
||||
// 状态
|
||||
searchQuery: string;
|
||||
services: ServiceData[];
|
||||
isTagBarDisplay: boolean;
|
||||
availableTags: string[];
|
||||
selectedTag: string;
|
||||
handleTagChange: (tag: string) => void;
|
||||
currentTheme: ThemeType;
|
||||
currentPage: number;
|
||||
total: number;
|
||||
pageSize: number;
|
||||
@@ -50,6 +57,11 @@ interface HomeProps {
|
||||
export const Home: React.FC<HomeProps> = ({
|
||||
searchQuery,
|
||||
services,
|
||||
isTagBarDisplay,
|
||||
availableTags,
|
||||
selectedTag,
|
||||
handleTagChange,
|
||||
currentTheme,
|
||||
currentPage,
|
||||
total,
|
||||
pageSize,
|
||||
@@ -83,9 +95,9 @@ export const Home: React.FC<HomeProps> = ({
|
||||
<h1 className="text-4xl lg:text-5xl font-bold mb-6 text-slate-800">
|
||||
{t(
|
||||
platformConfig.headline ||
|
||||
platformConfig.name ||
|
||||
_DefaultPlatformConfig.headline ||
|
||||
""
|
||||
platformConfig.name ||
|
||||
_DefaultPlatformConfig.headline ||
|
||||
""
|
||||
)}
|
||||
</h1>
|
||||
|
||||
@@ -93,8 +105,8 @@ export const Home: React.FC<HomeProps> = ({
|
||||
<p className="text-xl text-gray-600 max-w-3xl mx-auto leading-relaxed">
|
||||
{t(
|
||||
platformConfig.subheadline ||
|
||||
_DefaultPlatformConfig.subheadline ||
|
||||
""
|
||||
_DefaultPlatformConfig.subheadline ||
|
||||
""
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
@@ -140,6 +152,21 @@ export const Home: React.FC<HomeProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* filter section */}
|
||||
{
|
||||
isTagBarDisplay && (
|
||||
<div className="pt-10">
|
||||
<TagFilter
|
||||
theme={currentTheme}
|
||||
tags={availableTags}
|
||||
selectedTag={selectedTag}
|
||||
onTagChange={handleTagChange}
|
||||
maxWidthPercent={80}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
{/* Server List Section */}
|
||||
{loading ? (
|
||||
<div className="mx-auto h-[200px] flex items-center justify-center">
|
||||
@@ -148,7 +175,7 @@ export const Home: React.FC<HomeProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="bg-gray-50 py-16">
|
||||
<div className={`bg-gray-50 ${isTagBarDisplay ? 'py-10' : 'py-16'}`}>
|
||||
<div className="mx-auto px-6 max-w-7xl">
|
||||
{/* Server Grid */}
|
||||
<div className="flex flex-wrap justify-center gap-4 mb-12">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { Button } from "@nextui-org/react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -8,6 +8,7 @@ import { DynamicLogo } from "@/shared/components/DynamicLogo";
|
||||
import { useAuth } from "@/shared/lib/useAuth";
|
||||
import { NavigationItem } from "@/shared/components/Navigation";
|
||||
import Link from "next/link";
|
||||
import { useSharedStore } from "@/shared/store/share";
|
||||
|
||||
interface NavigationProps {
|
||||
items?: NavigationItem[];
|
||||
@@ -17,6 +18,13 @@ export const Navigation: React.FC<NavigationProps> = ({ items }) => {
|
||||
const { t } = useTranslation();
|
||||
const { handleLogin } = useAuth();
|
||||
|
||||
const [userToken, setUserToken] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const userToken = useSharedStore?.getState?.().user_token
|
||||
setUserToken(userToken);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="fixed top-0 left-0 right-0 z-50">
|
||||
{/* Classic Header */}
|
||||
@@ -26,21 +34,27 @@ export const Navigation: React.FC<NavigationProps> = ({ items }) => {
|
||||
<DynamicLogo alt="Platform Logo" className="h-[32px] text-white" />
|
||||
</div>
|
||||
<div className="flex space-x-2">
|
||||
<Button
|
||||
onPress={handleLogin}
|
||||
variant="light"
|
||||
className="hidden sm:block text-white text-sm px-4 py-1 rounded-sm font-medium"
|
||||
size="sm"
|
||||
>
|
||||
<b className="text-md"> {t("Sign In")}</b>
|
||||
</Button>
|
||||
{
|
||||
!userToken && (
|
||||
<>
|
||||
<Button
|
||||
onPress={handleLogin}
|
||||
variant="light"
|
||||
className="hidden sm:block text-white text-sm px-4 py-1 rounded-sm font-medium"
|
||||
size="sm"
|
||||
>
|
||||
<b className="text-md"> {t("Sign In")}</b>
|
||||
</Button>
|
||||
</>
|
||||
)
|
||||
}
|
||||
<Button
|
||||
color="primary"
|
||||
className="bg-red-600 hover:bg-red-700 text-white text-sm px-4 py-1 rounded-sm font-medium"
|
||||
size="sm"
|
||||
onPress={handleLogin}
|
||||
>
|
||||
{t("Get Started")}
|
||||
{userToken ? t("Dashboard") : t("Get Started")}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user