improve(public): ensure to use next/image
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
|
import NextImage from 'next/image';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Button } from './ui/button';
|
import { Button } from './ui/button';
|
||||||
|
|
||||||
@@ -28,15 +29,19 @@ function LivePreview() {
|
|||||||
function Image({ src }: { src: string }) {
|
function Image({ src }: { src: string }) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<img
|
<NextImage
|
||||||
className="w-full h-full block dark:hidden"
|
className="w-full h-full block dark:hidden"
|
||||||
src={`/${src}-light.png`}
|
src={`/${src}-light.png`}
|
||||||
alt={`${src} light`}
|
alt={`${src} light`}
|
||||||
|
width={1200}
|
||||||
|
height={800}
|
||||||
/>
|
/>
|
||||||
<img
|
<NextImage
|
||||||
className="w-full h-full hidden dark:block"
|
className="w-full h-full hidden dark:block"
|
||||||
src={`/${src}-dark.png`}
|
src={`/${src}-dark.png`}
|
||||||
alt={`${src} dark`}
|
alt={`${src} dark`}
|
||||||
|
width={1200}
|
||||||
|
height={800}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import Image from 'next/image';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
const PROFILES = [
|
const PROFILES = [
|
||||||
@@ -74,7 +75,13 @@ export function ProfilesFeature() {
|
|||||||
className="w-full flex-shrink-0 p-8"
|
className="w-full flex-shrink-0 p-8"
|
||||||
>
|
>
|
||||||
<div className="col md:row justify-center md:justify-start items-center gap-4">
|
<div className="col md:row justify-center md:justify-start items-center gap-4">
|
||||||
<img src={profile.avatar} className="size-32 rounded-full" />
|
<Image
|
||||||
|
src={profile.avatar}
|
||||||
|
className="size-32 rounded-full"
|
||||||
|
width={128}
|
||||||
|
height={128}
|
||||||
|
alt={profile.name}
|
||||||
|
/>
|
||||||
<div>
|
<div>
|
||||||
<div className="text-3xl font-semibold">{profile.name}</div>
|
<div className="text-3xl font-semibold">{profile.name}</div>
|
||||||
<div className="text-muted-foreground text-center md:text-left">
|
<div className="text-muted-foreground text-center md:text-left">
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { cn } from '@/lib/utils';
|
|||||||
import NumberFlow from '@number-flow/react';
|
import NumberFlow from '@number-flow/react';
|
||||||
import { AnimatePresence, motion } from 'framer-motion';
|
import { AnimatePresence, motion } from 'framer-motion';
|
||||||
import { ArrowUpIcon } from 'lucide-react';
|
import { ArrowUpIcon } from 'lucide-react';
|
||||||
|
import Image from 'next/image';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
const TRAFFIC_SOURCES = [
|
const TRAFFIC_SOURCES = [
|
||||||
{
|
{
|
||||||
icon: 'https://api.openpanel.dev/misc/favicon?url=https%3A%2F%2Fgoogle.com',
|
icon: 'https://api.openpanel.dev/misc/favicon?url=https%3A%2F%2Fgoogle.com',
|
||||||
@@ -164,10 +164,12 @@ function BarCell({
|
|||||||
<div className="relative row justify-between ">
|
<div className="relative row justify-between ">
|
||||||
<div className="row gap-2 items-center font-medium">
|
<div className="row gap-2 items-center font-medium">
|
||||||
{icon.startsWith('http') ? (
|
{icon.startsWith('http') ? (
|
||||||
<img
|
<Image
|
||||||
alt="serie icon"
|
alt="serie icon"
|
||||||
className="max-h-4 rounded-[2px] object-contain"
|
className="max-h-4 rounded-[2px] object-contain"
|
||||||
src={icon}
|
src={icon}
|
||||||
|
width={16}
|
||||||
|
height={16}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="text-2xl">{icon}</div>
|
<div className="text-2xl">{icon}</div>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export function TwitterCard({
|
|||||||
<div className="row gap-4">
|
<div className="row gap-4">
|
||||||
<div className="size-12 rounded-full bg-muted overflow-hidden shrink-0">
|
<div className="size-12 rounded-full bg-muted overflow-hidden shrink-0">
|
||||||
{avatarUrl && (
|
{avatarUrl && (
|
||||||
<img src={avatarUrl} alt={name} width={48} height={48} />
|
<Image src={avatarUrl} alt={name} width={48} height={48} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col gap-1">
|
<div className="col gap-1">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const withMDX = createMDX();
|
|||||||
const config = {
|
const config = {
|
||||||
reactStrictMode: false,
|
reactStrictMode: false,
|
||||||
images: {
|
images: {
|
||||||
domains: ['localhost', 'openpanel.dev'],
|
domains: ['localhost', 'openpanel.dev', 'api.openpanel.dev'],
|
||||||
},
|
},
|
||||||
serverExternalPackages: ['@hyperdx/node-opentelemetry'],
|
serverExternalPackages: ['@hyperdx/node-opentelemetry'],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user