style(search): align search page with proto2 surfaces

This commit is contained in:
zetaloop
2026-02-25 04:41:29 +08:00
parent 14717f1340
commit e7eb86bf7e
+19 -18
View File
@@ -110,7 +110,7 @@ function PlayerCard({ player }: { player: Player }) {
return ( return (
<Link href={`/player/${player.id}`} className="block h-full"> <Link href={`/player/${player.id}`} className="block h-full">
<Card className="h-full hover:shadow-md transition-shadow duration-200 overflow-hidden flex flex-col"> <Card className="h-full overflow-hidden flex flex-col p-0 gap-0">
<CardHeader className="p-4 pb-2 flex flex-row items-start justify-between space-y-0"> <CardHeader className="p-4 pb-2 flex flex-row items-start justify-between space-y-0">
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<Avatar className="h-12 w-12 border-2 border-background shadow-sm"> <Avatar className="h-12 w-12 border-2 border-background shadow-sm">
@@ -121,12 +121,12 @@ function PlayerCard({ player }: { player: Player }) {
<h3 className="font-semibold text-base leading-none mb-1">{player.user.nickname}</h3> <h3 className="font-semibold text-base leading-none mb-1">{player.user.nickname}</h3>
<div className="flex items-center gap-1 text-xs text-muted-foreground"> <div className="flex items-center gap-1 text-xs text-muted-foreground">
{player.shopName ? ( {player.shopName ? (
<span className="flex items-center gap-0.5 text-blue-600 bg-blue-50 px-1.5 py-0.5 rounded"> <span className="flex items-center gap-0.5 text-blue-600 bg-blue-50 px-1.5 py-0.5 rounded-full">
<Store className="w-3 h-3" /> <Store className="w-3 h-3" />
{player.shopName} {player.shopName}
</span> </span>
) : ( ) : (
<span className="flex items-center gap-0.5 text-gray-600 bg-gray-100 px-1.5 py-0.5 rounded"> <span className="flex items-center gap-0.5 text-gray-600 bg-gray-100 px-1.5 py-0.5 rounded-full">
<User className="w-3 h-3" /> <User className="w-3 h-3" />
</span> </span>
@@ -163,7 +163,7 @@ function PlayerCard({ player }: { player: Player }) {
{player.tags.slice(0, 2).map((tag) => ( {player.tags.slice(0, 2).map((tag) => (
<span <span
key={tag} key={tag}
className="text-[10px] px-1.5 py-0.5 bg-muted rounded text-muted-foreground" className="text-[10px] px-1.5 py-0.5 bg-muted rounded-full text-muted-foreground"
> >
{tag} {tag}
</span> </span>
@@ -179,7 +179,7 @@ function PlayerCard({ player }: { player: Player }) {
<span className="text-lg font-bold text-primary">¥{minPrice}</span> <span className="text-lg font-bold text-primary">¥{minPrice}</span>
<span className="text-xs text-muted-foreground">/{unit}</span> <span className="text-xs text-muted-foreground">/{unit}</span>
</div> </div>
<Button size="sm" variant="ghost" className="h-8 px-3 text-xs"> <Button size="sm" variant="ghost" className="h-8 px-3 text-xs rounded-full">
</Button> </Button>
</CardFooter> </CardFooter>
@@ -193,7 +193,7 @@ type ShopSearchItem = Extract<SearchResultItem, { type: "shop" }>
function ShopCard({ item }: { item: ShopSearchItem }) { function ShopCard({ item }: { item: ShopSearchItem }) {
return ( return (
<Link href={`/shop/${item.shop.id}`} className="block h-full"> <Link href={`/shop/${item.shop.id}`} className="block h-full">
<Card className="h-full hover:shadow-md transition-shadow duration-200 overflow-hidden flex flex-col"> <Card className="h-full overflow-hidden flex flex-col p-0 gap-0">
<CardHeader className="p-4 pb-2 flex flex-row items-start justify-between space-y-0"> <CardHeader className="p-4 pb-2 flex flex-row items-start justify-between space-y-0">
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<Avatar className="h-12 w-12 border-2 border-background shadow-sm"> <Avatar className="h-12 w-12 border-2 border-background shadow-sm">
@@ -203,7 +203,7 @@ function ShopCard({ item }: { item: ShopSearchItem }) {
<div> <div>
<h3 className="font-semibold text-base leading-none mb-1">{item.shop.name}</h3> <h3 className="font-semibold text-base leading-none mb-1">{item.shop.name}</h3>
<div className="flex items-center gap-1 text-xs text-muted-foreground"> <div className="flex items-center gap-1 text-xs text-muted-foreground">
<span className="flex items-center gap-0.5 text-blue-600 bg-blue-50 px-1.5 py-0.5 rounded"> <span className="flex items-center gap-0.5 text-blue-600 bg-blue-50 px-1.5 py-0.5 rounded-full">
<Store className="w-3 h-3" /> <Store className="w-3 h-3" />
</span> </span>
@@ -244,7 +244,7 @@ function ShopCard({ item }: { item: ShopSearchItem }) {
<span className="text-lg font-bold text-primary">¥{item.minPrice}</span> <span className="text-lg font-bold text-primary">¥{item.minPrice}</span>
<span className="text-xs text-muted-foreground">/{item.unit}</span> <span className="text-xs text-muted-foreground">/{item.unit}</span>
</div> </div>
<Button size="sm" variant="ghost" className="h-8 px-3 text-xs"> <Button size="sm" variant="ghost" className="h-8 px-3 text-xs rounded-full">
</Button> </Button>
</CardFooter> </CardFooter>
@@ -354,7 +354,7 @@ function FilterSection({
</h3> </h3>
<Select value={minRating} onValueChange={onRatingChange}> <Select value={minRating} onValueChange={onRatingChange}>
<SelectTrigger className="h-9"> <SelectTrigger className="h-9 rounded-lg">
<SelectValue placeholder="选择评分" /> <SelectValue placeholder="选择评分" />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
@@ -562,11 +562,11 @@ function SearchPageContent() {
<div className="flex items-center gap-2 w-full md:w-auto"> <div className="flex items-center gap-2 w-full md:w-auto">
<div className="relative flex-1 md:w-80"> <div className="relative flex-1 md:w-80">
<Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" /> <Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<Input <Input
type="search" type="search"
placeholder="搜索陪玩、游戏、标签..." placeholder="搜索陪玩、游戏、标签..."
className="pl-9" className="pl-9 rounded-full bg-muted/50 border-transparent focus-visible:bg-background"
value={searchQuery} value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)} onChange={(e) => setSearchQuery(e.target.value)}
/> />
@@ -574,7 +574,7 @@ function SearchPageContent() {
<Sheet> <Sheet>
<SheetTrigger asChild> <SheetTrigger asChild>
<Button variant="outline" size="icon" className="md:hidden shrink-0"> <Button variant="outline" size="icon" className="md:hidden shrink-0 rounded-full">
<Filter className="h-4 w-4" /> <Filter className="h-4 w-4" />
</Button> </Button>
</SheetTrigger> </SheetTrigger>
@@ -598,7 +598,7 @@ function SearchPageContent() {
</div> </div>
<SheetFooter> <SheetFooter>
<SheetClose asChild> <SheetClose asChild>
<Button className="w-full"> {total} </Button> <Button className="w-full rounded-full"> {total} </Button>
</SheetClose> </SheetClose>
</SheetFooter> </SheetFooter>
</SheetContent> </SheetContent>
@@ -653,7 +653,7 @@ function SearchPageContent() {
variant={sortBy === "composite" ? "secondary" : "ghost"} variant={sortBy === "composite" ? "secondary" : "ghost"}
size="sm" size="sm"
onClick={() => setSortAndSync("composite")} onClick={() => setSortAndSync("composite")}
className="whitespace-nowrap" className="whitespace-nowrap rounded-full"
> >
</Button> </Button>
@@ -661,7 +661,7 @@ function SearchPageContent() {
variant={sortBy === "rating" ? "secondary" : "ghost"} variant={sortBy === "rating" ? "secondary" : "ghost"}
size="sm" size="sm"
onClick={() => setSortAndSync("rating")} onClick={() => setSortAndSync("rating")}
className="whitespace-nowrap" className="whitespace-nowrap rounded-full"
> >
</Button> </Button>
@@ -669,7 +669,7 @@ function SearchPageContent() {
variant={sortBy === "orders" ? "secondary" : "ghost"} variant={sortBy === "orders" ? "secondary" : "ghost"}
size="sm" size="sm"
onClick={() => setSortAndSync("orders")} onClick={() => setSortAndSync("orders")}
className="whitespace-nowrap" className="whitespace-nowrap rounded-full"
> >
</Button> </Button>
@@ -677,7 +677,7 @@ function SearchPageContent() {
variant={sortBy.startsWith("price") ? "secondary" : "ghost"} variant={sortBy.startsWith("price") ? "secondary" : "ghost"}
size="sm" size="sm"
onClick={() => setSortAndSync(sortBy === "price_asc" ? "price_desc" : "price_asc")} onClick={() => setSortAndSync(sortBy === "price_asc" ? "price_desc" : "price_asc")}
className="whitespace-nowrap gap-1" className="whitespace-nowrap gap-1 rounded-full"
> >
<SlidersHorizontal className="w-3 h-3" /> <SlidersHorizontal className="w-3 h-3" />
@@ -721,7 +721,7 @@ function SearchPageContent() {
</p> </p>
<Button <Button
variant="outline" variant="outline"
className="mt-4" className="mt-4 rounded-full"
onClick={() => { onClick={() => {
clearAllFilters() clearAllFilters()
}} }}
@@ -736,6 +736,7 @@ function SearchPageContent() {
<Button <Button
variant="outline" variant="outline"
size="lg" size="lg"
className="rounded-full px-8"
onClick={() => { onClick={() => {
const currentLimit = numberParam(searchParams.get("limit"), DEFAULT_LIMIT) const currentLimit = numberParam(searchParams.get("limit"), DEFAULT_LIMIT)
replaceUrl((params) => { replaceUrl((params) => {