首页优化搜索框样式以及增加tooltip提示信息

This commit is contained in:
谢思 2025-11-12 13:53:05 +08:00
parent 48b03d1a35
commit 048cf3d025
2 changed files with 22 additions and 5 deletions

View File

@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";
import axios from "axios";
import { Divider, Input, Pagination, Popover, Spin } from "antd";
import { Divider, Input, Pagination, Popover, Spin, Tooltip } from "antd";
import { Link } from "react-router-dom";
import Nodata from "../../../Nodata";
import { getImageUrl } from "../../../../common/UrlTool";
@ -183,7 +183,7 @@ function ProjectHomePage(props) {
placeholder="输入名称关键字"
size="middle"
onSearch={(value) => { setPage(1); setSearch(value); }}
className="mlat"
className="mlat custom-search"
style={{ width: "320px", marginLeft: "auto" }}
allowClear
/>
@ -234,16 +234,16 @@ function ProjectHomePage(props) {
<div className="df a-i-center" style={{ flex: 1 }}>
{i.lesson_url && <img src={getImageUrl(`${i.lesson_url}`)} alt="" className="author_img" />}
<div className="flex1">
<Link to={url}><div className="task-hide font-16 color-19 hover-light" style={{marginTop: '-5px'}}>{i.name}</div></Link>
<Link to={url}><div className="task-hide font-16 color-19 hover-light" style={{marginTop: '-5px'}} title={i.name}>{i.name}</div></Link>
{/* 项目标签 */}
{i.topics && <div className='proListTopics mt3'>
{/* {i.author && i.author.login === "gh_mirrors" && i.topics && !i.topics.length && <span className='proListTopic mr15 font-13 task-hide'>华中科技大学</span>} */}
{i.topics.slice(0, 2).map(item => <Link to={`/explore/topic/${item.id}/${encodeURIComponent(item.name)}`} className='proListTopic mr15 font-13 task-hide'>{item.name}</Link>)}
{i.topics.slice(0, 2).map(item => <Tooltip title={item.name}><Link to={`/explore/topic/${item.id}/${encodeURIComponent(item.name)}`} className='proListTopic mr15 font-13 task-hide'>{item.name}</Link></Tooltip>)}
</div>}
</div>
</div>
{i.description && <div className="task-hide color-424 mt10">
{i.description}
<Tooltip title={i.description}>{i.description}</Tooltip>
</div>}
</div>
})}

View File

@ -103,6 +103,23 @@
position: relative;
top: -140px;
z-index: 3;
.custom-search {
.ant-input-search-icon svg{
display: none;
}
.ant-input-search-icon {
position: relative;
&::after {
content: "\e817"; // 替换为您的图标 Unicode
font-family: "iconfont" !important;
font-size: 14px;
color:#2149d4;
}
}
}
}
.cate_list {