images fix
This commit is contained in:
@@ -59,7 +59,7 @@ export interface NewsItem {
|
||||
id: number
|
||||
title: string
|
||||
content: string
|
||||
image: string
|
||||
titleImage: string
|
||||
slug: string
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,12 @@ const News: React.FC<NewsProps> = ({ news }) => {
|
||||
<div className="flex flex-col bg-white rounded-2xl shadow-md overflow-hidden hover:shadow-2xl transition-shadow duration-500 p-6">
|
||||
<div className="relative h-[200px]">
|
||||
<Image
|
||||
src={item.image}
|
||||
src={
|
||||
item.titleImage.startsWith('http')
|
||||
? item.titleImage
|
||||
: `http://127.0.0.1:8000${item.titleImage}` ||
|
||||
'/placeholder-image.jpg'
|
||||
}
|
||||
alt={item.title}
|
||||
fill
|
||||
className="object-cover rounded-2xl"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
'use client'
|
||||
import { useState } from 'react'
|
||||
import React, { useState } from 'react'
|
||||
|
||||
interface ShowMoreProps {
|
||||
text?: string
|
||||
|
||||
@@ -10,6 +10,16 @@ const nextConfig: NextConfig = {
|
||||
protocol: 'https',
|
||||
hostname: 'via.placeholder.com',
|
||||
},
|
||||
{
|
||||
protocol: 'http', // для локал девеломпента
|
||||
hostname: '127.0.0.1',
|
||||
port: '8000',
|
||||
pathname: '/media/uploads/**',
|
||||
},
|
||||
{
|
||||
protocol: 'https',
|
||||
hostname: 'tripwb.com',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user