news widget redesign 6
This commit is contained in:
parent
4143b7b4dd
commit
2604e94912
@ -90,7 +90,7 @@ export async function GET() {
|
|||||||
try {
|
try {
|
||||||
console.log('Fetching news from FastAPI server...');
|
console.log('Fetching news from FastAPI server...');
|
||||||
|
|
||||||
const response = await fetch(`${API_URL}/news?limit=10`, {
|
const response = await fetch(`${API_URL}/news?limit=12`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
|
|||||||
@ -99,14 +99,14 @@ export function News() {
|
|||||||
{error ? (
|
{error ? (
|
||||||
<p className="text-center text-red-500">{error}</p>
|
<p className="text-center text-red-500">{error}</p>
|
||||||
) : (
|
) : (
|
||||||
<div className="space-y-2 max-h-[220px] overflow-y-auto pr-1 scrollbar-thin scrollbar-thumb-gray-200 scrollbar-track-transparent">
|
<div className="space-y-1.5 max-h-[calc(100vh-12rem)] overflow-y-auto pr-1 scrollbar-thin scrollbar-thumb-gray-200 scrollbar-track-transparent">
|
||||||
{news.length === 0 ? (
|
{news.length === 0 ? (
|
||||||
<p className="text-center text-gray-500">No news available</p>
|
<p className="text-center text-gray-500">No news available</p>
|
||||||
) : (
|
) : (
|
||||||
news.map((item) => (
|
news.map((item) => (
|
||||||
<div
|
<div
|
||||||
key={item.id}
|
key={item.id}
|
||||||
className="p-2 hover:bg-gray-50/50 rounded-lg transition-colors cursor-pointer border border-gray-100 shadow-sm"
|
className="p-1.5 hover:bg-gray-50/50 rounded-lg transition-colors cursor-pointer border border-gray-100 shadow-sm"
|
||||||
onClick={() => window.open(item.url, '_blank')}
|
onClick={() => window.open(item.url, '_blank')}
|
||||||
>
|
>
|
||||||
<div className="flex items-center justify-between mb-1">
|
<div className="flex items-center justify-between mb-1">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user