fix(profile, image): fix wallet responsive layout on mobile and replace img tags with next/image
This commit is contained in:
1 parent
897867c633
commit
68fbd7d183
5 files changed
+121
-109
No files matched your search
@@ -18,6 +18,7 @@ export interface BlogPost {
|
||||
}
|
||||
|
||||
import { useRouter } from 'next/navigation';
|
||||
import Image from 'next/image';
|
||||
|
||||
export default function BlogPage({ blogs = [] }: { blogs: BlogPost[] }) {
|
||||
const router = useRouter();
|
||||
@@ -58,8 +59,8 @@ export default function BlogPage({ blogs = [] }: { blogs: BlogPost[] }) {
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
className="bg-white rounded-[3.5rem] border border-medical-gray-200 shadow-2xl overflow-hidden"
|
||||
>
|
||||
<div className="aspect-video w-full overflow-hidden">
|
||||
<img src={selectedPost.image} alt={selectedPost.title} className="w-full h-full object-cover" />
|
||||
<div className="aspect-video w-full overflow-hidden relative">
|
||||
<Image src={selectedPost.image} alt={selectedPost.title} fill className="w-full h-full object-cover" unoptimized />
|
||||
</div>
|
||||
<div className="p-12">
|
||||
<div className="flex items-center gap-4 text-xs font-bold text-canina-blue mb-8">
|
||||
@@ -114,8 +115,8 @@ export default function BlogPage({ blogs = [] }: { blogs: BlogPost[] }) {
|
||||
onClick={() => router.push(`/shop/${p.slug || p.id}`)}
|
||||
className="bg-white/10 border border-white/20 p-4 rounded-3xl flex items-center gap-4 cursor-pointer hover:bg-white/20 transition-all group"
|
||||
>
|
||||
<div className="w-16 h-16 bg-white rounded-2xl p-2 shrink-0 group-hover:scale-110 transition-transform">
|
||||
<img src={p.image} alt={p.name} className="w-full h-full object-contain" />
|
||||
<div className="w-16 h-16 bg-white rounded-2xl p-2 shrink-0 group-hover:scale-110 transition-transform relative overflow-hidden">
|
||||
<Image src={p.image} alt={p.name} fill className="w-full h-full object-contain p-2" unoptimized />
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-[10px] font-black opacity-50 uppercase tracking-widest">{p.category}</div>
|
||||
@@ -135,8 +136,8 @@ export default function BlogPage({ blogs = [] }: { blogs: BlogPost[] }) {
|
||||
onClick={() => router.push(`/blog/${p.slug}`)}
|
||||
className="flex items-center gap-4 cursor-pointer group"
|
||||
>
|
||||
<div className="w-16 h-16 rounded-2xl overflow-hidden shrink-0">
|
||||
<img src={p.image} className="w-full h-full object-cover group-hover:scale-110 transition-transform" />
|
||||
<div className="w-16 h-16 rounded-2xl overflow-hidden shrink-0 relative">
|
||||
<Image src={p.image} alt={p.title} fill className="w-full h-full object-cover group-hover:scale-110 transition-transform" unoptimized />
|
||||
</div>
|
||||
<div className="text-sm font-black text-medical-gray-900 group-hover:text-canina-blue transition-colors line-clamp-2">
|
||||
{p.title}
|
||||
@@ -195,11 +196,13 @@ export default function BlogPage({ blogs = [] }: { blogs: BlogPost[] }) {
|
||||
className="bg-white rounded-[3.5rem] overflow-hidden border border-medical-gray-200 shadow-2xl flex flex-col lg:flex-row cursor-pointer group"
|
||||
onClick={() => router.push(`/blog/${blogs[0].slug}`)}
|
||||
>
|
||||
<div className="lg:w-1/2 aspect-video lg:aspect-auto">
|
||||
<img
|
||||
<div className="lg:w-1/2 aspect-video lg:aspect-auto relative overflow-hidden">
|
||||
<Image
|
||||
src={blogs[0].image}
|
||||
alt={blogs[0].title}
|
||||
fill
|
||||
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-700"
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
<div className="lg:w-1/2 p-12 flex flex-col justify-center">
|
||||
@@ -248,11 +251,13 @@ export default function BlogPage({ blogs = [] }: { blogs: BlogPost[] }) {
|
||||
className="bg-white rounded-[3rem] overflow-hidden border border-medical-gray-200 shadow-xl group hover:shadow-2xl transition-all cursor-pointer"
|
||||
onClick={() => router.push(`/blog/${post.slug}`)}
|
||||
>
|
||||
<div className="aspect-[16/9] overflow-hidden">
|
||||
<img
|
||||
<div className="aspect-[16/9] overflow-hidden relative">
|
||||
<Image
|
||||
src={post.image}
|
||||
alt={post.title}
|
||||
fill
|
||||
className="w-full h-full object-cover group-hover:scale-110 transition-transform duration-700"
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
<div className="p-8">
|
||||
@@ -262,10 +267,10 @@ export default function BlogPage({ blogs = [] }: { blogs: BlogPost[] }) {
|
||||
{post.date}
|
||||
</div>
|
||||
</div>
|
||||
<h3 className="text-xl font-black text-medical-gray-900 mb-4 group-hover:text-canina-blue transition-colors">
|
||||
<h3 className="text-xl font-black text-medical-gray-900 mb-4 group-hover:text-canina-blue transition-colors line-clamp-2 leading-snug">
|
||||
{post.title}
|
||||
</h3>
|
||||
<p className="text-sm text-medical-gray-500 mb-8 leading-relaxed line-clamp-2">
|
||||
<p className="text-sm text-medical-gray-500 line-clamp-3 leading-relaxed mb-6">
|
||||
{post.excerpt}
|
||||
</p>
|
||||
<div className="flex items-center gap-2 text-medical-gray-900 font-bold group">
|
||||
@@ -380,7 +385,9 @@ export default function BlogPage({ blogs = [] }: { blogs: BlogPost[] }) {
|
||||
onClick={() => router.push(`/shop/${p.slug || p.id}`)}
|
||||
className="bg-white/10 border border-white/20 p-6 rounded-3xl cursor-pointer hover:bg-white/20 transition-all text-center group"
|
||||
>
|
||||
<img src={p.image} alt={p.name} className="w-20 h-20 mx-auto mb-4 object-contain group-hover:scale-110 transition-transform" />
|
||||
<div className="w-20 h-20 mx-auto mb-4 relative overflow-hidden">
|
||||
<Image src={p.image} alt={p.name} fill className="w-full h-full object-contain group-hover:scale-110 transition-transform" unoptimized />
|
||||
</div>
|
||||
<h5 className="text-[10px] font-black">{p.name}</h5>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user