feat: Modify the layout of news items Add the function of expanding or contracting after clicking on them
This commit is contained in:
parent
460c523633
commit
0590864b6f
4 changed files with 118 additions and 40 deletions
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import ContextItem from "./ContextItem";
|
||||
|
||||
import ExpandableItems from "./ExpandableItems";
|
||||
interface ContextItemType {
|
||||
name: string;
|
||||
url: string;
|
||||
|
@ -47,9 +47,7 @@ const NewsDetail: React.FC<NewsDetailProperties> = ({ news }) => {
|
|||
<p className="text-black dark:text-white">{section.content}</p>
|
||||
<div className="mt-4">
|
||||
<h3 className="text-black dark:text-white">Related Context:</h3>
|
||||
{section.context.map((item, index_) => (
|
||||
<ContextItem key={index_} item={item} />
|
||||
))}
|
||||
<ExpandableItems context={section.context} />
|
||||
</div>
|
||||
</section>
|
||||
))}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue