mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
Add external link warning
This commit is contained in:
32
src/context/intermediate/modals/ExternalLinkPrompt.tsx
Normal file
32
src/context/intermediate/modals/ExternalLinkPrompt.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Text } from "preact-i18n";
|
||||
|
||||
import Modal from "../../../components/ui/Modal";
|
||||
|
||||
interface Props {
|
||||
onClose: () => void;
|
||||
link: string;
|
||||
}
|
||||
|
||||
export function ExternalLinkModal({ onClose, link }: Props) {
|
||||
return (
|
||||
<Modal
|
||||
visible={true}
|
||||
onClose={onClose}
|
||||
title={<Text id={"app.special.modals.external_links.title"} />}
|
||||
actions={[
|
||||
{
|
||||
onClick: ()=>{window.open(link, "_blank");},
|
||||
confirmation: true,
|
||||
children: "Continue",
|
||||
},
|
||||
{
|
||||
onClick: onClose,
|
||||
confirmation: false,
|
||||
children: "Cancel",
|
||||
},
|
||||
]}>
|
||||
<Text id={"app.special.modals.external_links.short"} /> <br />
|
||||
<a>{link}</a>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user