feat(phone/hooks): implemented clipboard

This commit is contained in:
Christopher committed 2020-12-11 20:42:03 +01:00
1 parent e13b064d73
commit 550eb8f38f
6 files changed
+51 -34

No files matched your search

@@ -1,43 +1,49 @@
import React from 'react'
import Modal from '../../../../ui/components/Modal'
import React, { useRef, useState } from 'react';
import Modal from '../../../../ui/components/Modal';
import { useShareLink } from '../../hooks/useShareLink';
import { useShareModal } from '../../hooks/useShareModal'
import { useShareModal } from '../../hooks/useShareModal';
import { Button } from '@material-ui/core';
import MessageIcon from '@material-ui/icons/Message';
import { useHistory } from 'react-router-dom';
import { useModal } from '../../../twitter/hooks/useModal';
import { setClipboard } from '../../../../os/phone/hooks/useClipboard';
import CloseIcon from '@material-ui/icons/Close';
import useStyles from './modal.styles';
import Nui from '../../../../os/nui-events/utils/Nui';
export const ShareModal = (meta) => {
const classes = useStyles();
const { shareModal, setShareModal } = useShareModal();
const { shareLink, setShareLink } = useShareLink();
const { setModalVisible } = useModal();
const { setShareLink } = useShareLink();
let history = useHistory();
const _handleClose = () => {
setShareModal(false)
setShareLink(null)
}
setShareModal(false);
setShareLink(null);
};
const handleCopyImage = () => {
setClipboard(meta.image);
};
return (
<Modal visible={shareModal} handleClose={_handleClose}>
<div className={classes.shareModal}>
<Button style={{ position: 'absolute', right: 0, width: '10%' }} onClick={_handleClose}><CloseIcon /></Button>
<Button
style={{ position: 'absolute', right: 0, width: '10%' }}
onClick={_handleClose}
>
<CloseIcon />
</Button>
<div className={classes.innerShareModal}>
<h4 style={{ textAlign: 'center', marginTop: 20 }}>Where do you want to share the photo?</h4>
<Button>
{<MessageIcon />} Message
</Button>
<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>
<p>{meta.image}</p>
<Button onClick={handleCopyImage} variant='contained'>
Copy image
</Button>
</div>
</div>
</Modal>
)
}
);
};