mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
* feat(frontend): add navigateToLink button for CopyTextField. close #372. * chore(frontend): remove unused props for CopyTextField.
This commit is contained in:
parent
eb7216b4b1
commit
d7750086b5
4 changed files with 30 additions and 11 deletions
|
@ -1,7 +1,8 @@
|
||||||
import { ActionIcon, TextInput } from "@mantine/core";
|
import { ActionIcon, TextInput, Tooltip } from "@mantine/core";
|
||||||
import { useClipboard } from "@mantine/hooks";
|
import { useClipboard } from "@mantine/hooks";
|
||||||
import { useRef, useState } from "react";
|
import { useRef, useState } from "react";
|
||||||
import { TbCheck, TbCopy } from "react-icons/tb";
|
import { TbCheck, TbCopy } from "react-icons/tb";
|
||||||
|
import { IoOpenOutline } from "react-icons/io5";
|
||||||
import useTranslate from "../../hooks/useTranslate.hook";
|
import useTranslate from "../../hooks/useTranslate.hook";
|
||||||
import toast from "../../utils/toast.util";
|
import toast from "../../utils/toast.util";
|
||||||
|
|
||||||
|
@ -37,12 +38,27 @@ function CopyTextField(props: { link: string }) {
|
||||||
setTextClicked(true);
|
setTextClicked(true);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
rightSectionWidth={62}
|
||||||
rightSection={
|
rightSection={
|
||||||
window.isSecureContext && (
|
<>
|
||||||
<ActionIcon onClick={copyLink}>
|
<Tooltip
|
||||||
{checkState ? <TbCheck /> : <TbCopy />}
|
label={t("common.text.navigate-to-link")}
|
||||||
</ActionIcon>
|
position="top"
|
||||||
)
|
offset={-2}
|
||||||
|
openDelay={200}
|
||||||
|
>
|
||||||
|
<a href={props.link}>
|
||||||
|
<ActionIcon>
|
||||||
|
<IoOpenOutline />
|
||||||
|
</ActionIcon>
|
||||||
|
</a>
|
||||||
|
</Tooltip>
|
||||||
|
{window.isSecureContext && (
|
||||||
|
<ActionIcon onClick={copyLink}>
|
||||||
|
{checkState ? <TbCheck /> : <TbCopy />}
|
||||||
|
</ActionIcon>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -282,11 +282,12 @@ const CreateUploadModalBody = ({
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
{ options.maxExpirationInHours == 0 && <Checkbox
|
{options.maxExpirationInHours == 0 && (
|
||||||
label={t("upload.modal.expires.never-long")}
|
<Checkbox
|
||||||
{...form.getInputProps("never_expires")}
|
label={t("upload.modal.expires.never-long")}
|
||||||
/>
|
{...form.getInputProps("never_expires")}
|
||||||
}
|
/>
|
||||||
|
)}
|
||||||
<Text
|
<Text
|
||||||
italic
|
italic
|
||||||
size="xs"
|
size="xs"
|
||||||
|
|
|
@ -526,6 +526,7 @@ export default {
|
||||||
"common.button.generate": "Generate",
|
"common.button.generate": "Generate",
|
||||||
"common.button.done": "Done",
|
"common.button.done": "Done",
|
||||||
"common.text.link": "Link",
|
"common.text.link": "Link",
|
||||||
|
"common.text.navigate-to-link": "Go to the link",
|
||||||
"common.text.or": "or",
|
"common.text.or": "or",
|
||||||
"common.button.go-back": "Go back",
|
"common.button.go-back": "Go back",
|
||||||
"common.notify.copied": "Your link was copied to the clipboard",
|
"common.notify.copied": "Your link was copied to the clipboard",
|
||||||
|
|
|
@ -404,6 +404,7 @@ export default {
|
||||||
"common.button.generate": "生成",
|
"common.button.generate": "生成",
|
||||||
"common.button.done": "完成",
|
"common.button.done": "完成",
|
||||||
"common.text.link": "链接",
|
"common.text.link": "链接",
|
||||||
|
"common.text.navigate-to-link": "访问链接",
|
||||||
"common.text.or": "或",
|
"common.text.or": "或",
|
||||||
"common.button.go-back": "返回",
|
"common.button.go-back": "返回",
|
||||||
"common.notify.copied": "已复制到剪贴板",
|
"common.notify.copied": "已复制到剪贴板",
|
||||||
|
|
Loading…
Add table
Reference in a new issue