Browse Source

fix: replace next/image with img element for performance improvement

Shun Miyazawa 8 months ago
parent
commit
1fb6305e5d
1 changed files with 2 additions and 4 deletions
  1. 2 4
      packages/ui/src/components/UserPicture.tsx

+ 2 - 4
packages/ui/src/components/UserPicture.tsx

@@ -1,7 +1,6 @@
 import type { IUser, Ref } from '@growi/core';
 import { pagePathUtils } from '@growi/core/dist/utils';
 import dynamic from 'next/dynamic';
-import Image from 'next/image';
 import { useRouter } from 'next/router';
 import {
   forwardRef,
@@ -182,9 +181,8 @@ export const UserPicture = memo((userProps: Props): JSX.Element => {
     .filter(Boolean)
     .join(' ');
 
-  const imgElement = (
-    <Image src={src} alt={displayName} className={className} />
-  );
+  // biome-ignore lint/performance/noImgElement: ignore
+  const imgElement = <img src={src} alt={displayName} className={className} />;
   const baseProps = { displayName, size, children: imgElement };
 
   if (username == null || noLink) {