diff --git a/app/components/list/NewsList.tsx b/app/components/list/NewsList.tsx index 6e3f68c..bdc5959 100644 --- a/app/components/list/NewsList.tsx +++ b/app/components/list/NewsList.tsx @@ -2,21 +2,22 @@ import React from 'react'; import { mockNewsData } from './NewsData'; // 导入新闻数据 interface NewsProps { - title?: string; - description?: string; - time?: string; + title?: string; + description?: string; + time?: string; type?: string; url?: string; } const NewsItem: React.FC = ({ title = '', time = '', url = '' }) => { return ( -
-
url && window.open(url)} - className="flex items-center justify-between hover:text-blue-500 - cursor-pointer w-96"> -

{title}

-

{time}

+
+
url && window.open(url)} + className="flex items-center justify-between hover:text-blue-600 cursor-pointer transition duration-300 ease-in-out" + > +

{title}

+

{time}

); @@ -25,16 +26,40 @@ const NewsItem: React.FC = ({ title = '', time = '', url = '' }) => { // 使用新闻数据渲染列表 const NewsList: React.FC = () => { return ( -
-
    - {mockNewsData.map((news) => ( - - ))} -
+
+
+ {/* 科技新闻 */} +
+
+

科技新闻

+ +
+
    + {mockNewsData.map((news, index) => ( + + ))} +
+
+ + {/* 社会新闻 */} +
+
+

社会新闻

+ +
+
    + {mockNewsData.map((news, index) => ( + + ))} +
+
+
); }; - - export default NewsList; \ No newline at end of file