From d7750086b5b796cfc70d8dc0c7d0ab4bd1996ca0 Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Tue, 9 Jan 2024 22:50:42 +0800 Subject: [PATCH] feat(frontend): add navigateToLink button for CopyTextField. close #372. (#376) * feat(frontend): add navigateToLink button for CopyTextField. close #372. * chore(frontend): remove unused props for CopyTextField. --- .../src/components/upload/CopyTextField.tsx | 28 +++++++++++++++---- .../upload/modals/showCreateUploadModal.tsx | 11 ++++---- frontend/src/i18n/translations/en-US.ts | 1 + frontend/src/i18n/translations/zh-CN.ts | 1 + 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/upload/CopyTextField.tsx b/frontend/src/components/upload/CopyTextField.tsx index 00d9572..134fbd6 100644 --- a/frontend/src/components/upload/CopyTextField.tsx +++ b/frontend/src/components/upload/CopyTextField.tsx @@ -1,7 +1,8 @@ -import { ActionIcon, TextInput } from "@mantine/core"; +import { ActionIcon, TextInput, Tooltip } from "@mantine/core"; import { useClipboard } from "@mantine/hooks"; import { useRef, useState } from "react"; import { TbCheck, TbCopy } from "react-icons/tb"; +import { IoOpenOutline } from "react-icons/io5"; import useTranslate from "../../hooks/useTranslate.hook"; import toast from "../../utils/toast.util"; @@ -37,12 +38,27 @@ function CopyTextField(props: { link: string }) { setTextClicked(true); } }} + rightSectionWidth={62} rightSection={ - window.isSecureContext && ( - - {checkState ? : } - - ) + <> + + + + + + + + {window.isSecureContext && ( + + {checkState ? : } + + )} + } /> ); diff --git a/frontend/src/components/upload/modals/showCreateUploadModal.tsx b/frontend/src/components/upload/modals/showCreateUploadModal.tsx index c83790d..249e831 100644 --- a/frontend/src/components/upload/modals/showCreateUploadModal.tsx +++ b/frontend/src/components/upload/modals/showCreateUploadModal.tsx @@ -282,11 +282,12 @@ const CreateUploadModalBody = ({ /> - { options.maxExpirationInHours == 0 && - } + {options.maxExpirationInHours == 0 && ( + + )}