mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
import Modal from '../../../../ui/components/Modal';
|
|
import { Button } from '@material-ui/core';
|
|
import MessageIcon from '@material-ui/icons/Message';
|
|
import { setClipboard } from '../../../../os/phone/hooks/useClipboard';
|
|
|
|
import useStyles from './modal.styles';
|
|
import { useHistory } from 'react-router-dom';
|
|
import { IPhoto } from '../../../../../../typings/photo';
|
|
|
|
interface IShareModalProps {
|
|
meta: IPhoto;
|
|
referal: string;
|
|
onClose(): void;
|
|
}
|
|
|
|
export const ShareModal = ({ meta, onClose, referal }: IShareModalProps) => {
|
|
const classes = useStyles();
|
|
const history = useHistory();
|
|
|
|
const handleCopyImage = () => {
|
|
setClipboard(meta.image);
|
|
history.push(referal);
|
|
};
|
|
|
|
return (
|
|
<Modal visible={!!meta} handleClose={onClose}>
|
|
<div className={classes.shareModal}>
|
|
<div className={classes.innerShareModal}>
|
|
<>
|
|
<h4 style={{ textAlign: 'center', marginTop: 20 }}>
|
|
Where do you want to share the photo?
|
|
</h4>
|
|
<Button>{<MessageIcon />} Message</Button>
|
|
<h4>Or just copy the image here:</h4>
|
|
<Button onClick={handleCopyImage} variant="contained">
|
|
Copy image
|
|
</Button>
|
|
</>
|
|
</div>
|
|
</div>
|
|
</Modal>
|
|
);
|
|
};
|