Add external link warning

This commit is contained in:
Ryan Alexander
2021-08-29 09:56:20 +10:00
parent 9d09a30fa3
commit 8354758cae
4 changed files with 46 additions and 0 deletions

View 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>
);
}