mirror of
https://github.com/outline/outline.git
synced 2026-12-02 17:52:07 +03:00
cleanup: hasLink not needed
This commit is contained in:
1 parent
2d16470982
commit
28b6e4ba14
1 file changed
+1
-3
@@ -10,7 +10,6 @@ import { ComponentProps } from "../types";
|
||||
import { ResizeLeft, ResizeRight } from "./ResizeHandle";
|
||||
import useDragResize from "./hooks/useDragResize";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import some from "lodash/some";
|
||||
import find from "lodash/find";
|
||||
|
||||
type Props = ComponentProps & {
|
||||
@@ -71,7 +70,6 @@ const Image = (props: Props) => {
|
||||
}, [node.attrs.width]);
|
||||
|
||||
const sanitizedSrc = sanitizeUrl(src);
|
||||
const hasLink = some(node.attrs.marks ?? [], (mark) => mark.type === "link");
|
||||
const imgLink =
|
||||
find(node.attrs.marks ?? [], (mark) => mark.type === "link")?.attrs.href ??
|
||||
"";
|
||||
@@ -121,7 +119,7 @@ const Image = (props: Props) => {
|
||||
<GlobeIcon />
|
||||
</Button>
|
||||
)}
|
||||
{hasLink && !props.isEditable && (
|
||||
{imgLink && !props.isEditable && (
|
||||
<Button onClick={props.onZoomIn} aria-label={t("Zoom In")}>
|
||||
<ZoomInIcon />
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user