From 00acd2f45aafbcba1952ac72341c33f594b60690 Mon Sep 17 00:00:00 2001 From: caichi <54824604+caichi-t@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:33:47 +0900 Subject: [PATCH 1/6] fix(web): link to asset and refer to item icons (#1272) * link to assets and reference icon * fix refer icon * i18n --- .../atoms/Icon/Icons/arrowUpRightSlash.svg | 3 + web/src/components/atoms/Icon/icons.ts | 2 + .../Common/LinkAssetModal/LinkAssetModal.tsx | 15 +- .../Common/ResizableProTable/index.tsx | 4 + .../Content/Form/ReferenceFormItem/index.tsx | 13 +- .../molecules/Content/LinkItemModal/index.tsx | 19 +- .../LinkItemRequestModal.tsx | 4 +- web/src/i18n/translations/en.yml | 1113 +++++++++-------- web/src/i18n/translations/ja.yml | 1113 +++++++++-------- 9 files changed, 1141 insertions(+), 1145 deletions(-) create mode 100644 web/src/components/atoms/Icon/Icons/arrowUpRightSlash.svg diff --git a/web/src/components/atoms/Icon/Icons/arrowUpRightSlash.svg b/web/src/components/atoms/Icon/Icons/arrowUpRightSlash.svg new file mode 100644 index 000000000..fafb0dfd5 --- /dev/null +++ b/web/src/components/atoms/Icon/Icons/arrowUpRightSlash.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/src/components/atoms/Icon/icons.ts b/web/src/components/atoms/Icon/icons.ts index 78223bb23..ae9937386 100644 --- a/web/src/components/atoms/Icon/icons.ts +++ b/web/src/components/atoms/Icon/icons.ts @@ -56,6 +56,7 @@ import { import ArrowSquareOut from "./Icons/arrowSquareOut.svg"; import ArrowUpRight from "./Icons/arrowUpRight.svg"; +import ArrowUpRightSlash from "./Icons/arrowUpRightSlash.svg"; import Asset from "./Icons/asset.svg"; import Boolean from "./Icons/boolean.svg"; import CheckSquare from "./Icons/checkSquare.svg"; @@ -124,6 +125,7 @@ export default { asset: Asset, listBullets: ListBullets, arrowUpRight: ArrowUpRight, + arrowUpRightSlash: ArrowUpRightSlash, numberNine: NumberNine, link: Link, linkSolid: LinkSolid, diff --git a/web/src/components/molecules/Common/LinkAssetModal/LinkAssetModal.tsx b/web/src/components/molecules/Common/LinkAssetModal/LinkAssetModal.tsx index c21340cba..774111e9e 100644 --- a/web/src/components/molecules/Common/LinkAssetModal/LinkAssetModal.tsx +++ b/web/src/components/molecules/Common/LinkAssetModal/LinkAssetModal.tsx @@ -1,5 +1,5 @@ import styled from "@emotion/styled"; -import { useState, useRef, useCallback, useMemo } from "react"; +import { useRef, useCallback, useMemo } from "react"; import Button from "@reearth-cms/components/atoms/Button"; import Icon from "@reearth-cms/components/atoms/Icon"; @@ -74,7 +74,6 @@ const LinkAssetModal: React.FC = ({ onUploadAndLink, }) => { const t = useT(); - const [hoveredAssetId, setHoveredAssetId] = useState(); const resetFlag = useRef(false); const options: OptionConfig = useMemo( @@ -127,14 +126,10 @@ const LinkAssetModal: React.FC = ({ width: 48, minWidth: 48, render: (_, asset) => { - const isLink = - (asset.id === linkedAsset?.id && hoveredAssetId !== asset.id) || - (asset.id !== linkedAsset?.id && hoveredAssetId === asset.id); + const isLink = asset.id !== linkedAsset?.id; return (