shlink-web-client/src/short-urls/helpers/QrCodeModal.tsx

20 lines
670 B
TypeScript
Raw Normal View History

import { Modal, ModalBody, ModalHeader } from 'reactstrap';
import { ExternalLink } from 'react-external-link';
import { ShortUrlModalProps } from '../data';
import './QrCodeModal.scss';
const QrCodeModal = ({ shortUrl: { shortUrl }, toggle, isOpen }: ShortUrlModalProps) => (
2018-11-01 13:15:09 +01:00
<Modal isOpen={isOpen} toggle={toggle} centered>
<ModalHeader toggle={toggle}>
QR code for <ExternalLink href={shortUrl}>{shortUrl}</ExternalLink>
2018-11-01 13:15:09 +01:00
</ModalHeader>
<ModalBody>
<div className="text-center">
<img src={`${shortUrl}/qr-code`} className="qr-code-modal__img" alt="QR code" />
2018-11-01 13:15:09 +01:00
</div>
</ModalBody>
</Modal>
);
2018-11-01 12:35:51 +01:00
export default QrCodeModal;