refactor(components): 重构碘搜索相关组件
- 优化 IodRelevant 组件中的加载状态和计数器动画 - 重构 PlaygroundIod 组件,使用新的 PlaygroundIodProvider 组件 - 改进 Context 提供的数据结构,使用更准确的命名
This commit is contained in:
@@ -235,25 +235,28 @@ export const PlaygroundIodRelevant: React.FC<Props> = ({ className }) => {
|
||||
(message) => message.id === currentMessageId
|
||||
)
|
||||
|
||||
const text = (iodSearch && iodLoading) ? '正' : '已'
|
||||
const text2 = (iodSearch && iodLoading) ? '进行' : '完成'
|
||||
const text3 = (iodSearch && iodLoading) ? '……' : ''
|
||||
const loading = (iodSearch && iodLoading)
|
||||
const text = loading ? '正' : '已'
|
||||
const text2 = loading ? '进行' : '完成'
|
||||
const text3 = loading ? '……' : ''
|
||||
const duration = loading ? 2.5 : 0
|
||||
|
||||
return [
|
||||
{
|
||||
title: (
|
||||
<p className="font-extrabold">
|
||||
{text}在
|
||||
<span className="text-[#f00000]">
|
||||
<CountUp end={29} duration={2.5} separator="," />个
|
||||
<CountUp end={29} duration={duration} separator="," />个
|
||||
</span>
|
||||
国家和省部级科学数据中心、
|
||||
<span className="text-[#f00000]">
|
||||
{" "}
|
||||
<CountUp end={55} duration={2.5} separator="," />所
|
||||
<CountUp end={55} duration={duration} separator="," />所
|
||||
</span>
|
||||
高等院校的
|
||||
<span className="text-[#f00000]">
|
||||
<CountUp decimals={1} end={53.7} duration={2.5} separator="," />
|
||||
<CountUp decimals={1} end={53.7} duration={duration} separator="," />
|
||||
万个
|
||||
</span>
|
||||
科学数据集中{text2}搜索{text3}
|
||||
@@ -282,12 +285,12 @@ export const PlaygroundIodRelevant: React.FC<Props> = ({ className }) => {
|
||||
<p className="font-extrabold">
|
||||
{text}在
|
||||
<span className="text-[#f00000]">
|
||||
<CountUp end={138} duration={2.5} separator="," />
|
||||
<CountUp end={138} duration={duration} separator="," />
|
||||
万篇
|
||||
</span>
|
||||
学术论文、
|
||||
<span className="text-[#f00000]">
|
||||
<CountUp end={18.3} decimals={1} duration={2.5} separator="," />
|
||||
<CountUp end={18.3} decimals={1} duration={duration} separator="," />
|
||||
万个
|
||||
</span>
|
||||
数据项目中{text2}搜索{text3}
|
||||
@@ -316,17 +319,17 @@ export const PlaygroundIodRelevant: React.FC<Props> = ({ className }) => {
|
||||
<p className="font-extrabold">
|
||||
{text}在
|
||||
<span className="text-[#f00000]">
|
||||
<CountUp end={763} duration={2.5} separator="," />家
|
||||
<CountUp end={763} duration={duration} separator="," />家
|
||||
</span>
|
||||
高等院校和科研机构、
|
||||
<span className="text-[#f00000]">
|
||||
{" "}
|
||||
<CountUp end={2.1} decimals={1} duration={2.5} separator="," />万
|
||||
<CountUp end={2.1} decimals={1} duration={duration} separator="," />万
|
||||
</span>
|
||||
家科技型企业、
|
||||
<span className="text-[#f00000]">
|
||||
{" "}
|
||||
<CountUp end={2} duration={2.5} separator="," />万
|
||||
<CountUp end={2} duration={duration} separator="," />万
|
||||
</span>
|
||||
科技人才中{text2}搜索{text3}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user