Bläddra i källkod

delete unnecessary codes

WNomunomu 2 år sedan
förälder
incheckning
9b30246e51
3 ändrade filer med 0 tillägg och 35 borttagningar
  1. 0 1
      apps/app/next.config.js
  2. 0 2
      apps/app/package.json
  3. 0 32
      apps/app/src/components/Page/ImageZoom.tsx

+ 0 - 1
apps/app/next.config.js

@@ -46,7 +46,6 @@ const getTranspilePackages = () => {
     'emoticon',
     'emoticon',
     'direction', // for hast-util-select
     'direction', // for hast-util-select
     'bcp-47-match', // for hast-util-select
     'bcp-47-match', // for hast-util-select
-    'react-medium-image-zoom',
     ...listPrefixedPackages(['remark-', 'rehype-', 'hast-', 'mdast-', 'micromark-', 'unist-']),
     ...listPrefixedPackages(['remark-', 'rehype-', 'hast-', 'mdast-', 'micromark-', 'unist-']),
   ];
   ];
 
 

+ 0 - 2
apps/app/package.json

@@ -126,7 +126,6 @@
     "lucene-query-parser": "^1.2.0",
     "lucene-query-parser": "^1.2.0",
     "markdown-table": "^1.1.1",
     "markdown-table": "^1.1.1",
     "md5": "^2.2.1",
     "md5": "^2.2.1",
-    "medium-zoom": "^1.0.8",
     "mermaid": "^10.1.0",
     "mermaid": "^10.1.0",
     "method-override": "^3.0.0",
     "method-override": "^3.0.0",
     "migrate-mongo": "^8.2.3",
     "migrate-mongo": "^8.2.3",
@@ -169,7 +168,6 @@
     "react-i18next": "^12.2.0",
     "react-i18next": "^12.2.0",
     "react-image-crop": "^8.3.0",
     "react-image-crop": "^8.3.0",
     "react-markdown": "^8.0.7",
     "react-markdown": "^8.0.7",
-    "react-medium-image-zoom": "^5.1.6",
     "react-multiline-clamp": "^2.0.0",
     "react-multiline-clamp": "^2.0.0",
     "react-scroll": "^1.8.7",
     "react-scroll": "^1.8.7",
     "react-syntax-highlighter": "^15.5.0",
     "react-syntax-highlighter": "^15.5.0",

+ 0 - 32
apps/app/src/components/Page/ImageZoom.tsx

@@ -1,32 +0,0 @@
-import { ComponentProps, useRef } from 'react';
-
-import mediumZoom, { Zoom, ZoomOptions } from 'medium-zoom';
-
-type ImageZoomProps = ComponentProps<'img'> & {
-  options?: ZoomOptions
-}
-
-export function ImageZoom({ options, ...props }: ImageZoomProps) {
-  const zoomRef = useRef<Zoom | null>(null);
-
-  function getZoom() {
-    if (zoomRef.current === null) {
-      zoomRef.current = mediumZoom(options);
-    }
-
-    return zoomRef.current;
-  }
-
-  function attachZoom(image: HTMLImageElement | null) {
-    const zoom = getZoom();
-
-    if (image) {
-      zoom.attach(image);
-    }
-    else {
-      zoom.detach();
-    }
-  }
-
-  return <img {...props} ref={attachZoom} />;
-}