mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +00:00
fix(image meta): fixed share modal isssue
This commit is contained in:
1 parent
900b35ff88
commit
b58d0283c6
3 files changed
+20
-14
No files matched your search
@@ -9,7 +9,6 @@ import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
import DeleteIcon from '@material-ui/icons/Delete';
|
||||
import ShareIcon from '@material-ui/icons/Share';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useImagePrompt } from '../../../twitter/hooks/useImagePrompt';
|
||||
import { useShareModal } from '../../hooks/useShareModal';
|
||||
import { ShareModal } from './ShareModal';
|
||||
import { useShareLink } from '../../hooks/useShareLink';
|
||||
@@ -23,12 +22,10 @@ export const GalleryModal = () => {
|
||||
const { shareModal ,setShareModal } = useShareModal();
|
||||
const { setShareLink } = useShareLink();
|
||||
|
||||
let history = useHistory();
|
||||
|
||||
const _handleClose = () => {
|
||||
setModal(false)
|
||||
setMeta(null);
|
||||
//history.goBack();
|
||||
}
|
||||
|
||||
const handleDeletePhoto = () => {
|
||||
@@ -48,7 +45,7 @@ export const GalleryModal = () => {
|
||||
|
||||
return (
|
||||
<Paper className={modal ? classes.modal : classes.modalHide}>
|
||||
<ShareModal />
|
||||
<ShareModal key={meta.id} {...meta}/>
|
||||
<div className={shareModal ? classes.backgroundModal : undefined} />
|
||||
<Button onClick={_handleClose}><ArrowBackIcon /></Button>
|
||||
<div className={classes.image} style={{ backgroundImage: `url(${meta.image})`}} />
|
||||
|
||||
@@ -3,15 +3,16 @@ import Modal from '../../../../ui/components/Modal'
|
||||
import { useShareLink } from '../../hooks/useShareLink';
|
||||
import { useShareModal } from '../../hooks/useShareModal'
|
||||
import { Button } from '@material-ui/core';
|
||||
import TwitterIcon from '@material-ui/icons/Twitter';
|
||||
import MessageIcon from '@material-ui/icons/Message';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useModal } from '../../../twitter/hooks/useModal';
|
||||
import CloseIcon from '@material-ui/icons/Close';
|
||||
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faAd } from "@fortawesome/free-solid-svg-icons";
|
||||
import useStyles from './modal.styles';
|
||||
|
||||
export const ShareModal = () => {
|
||||
|
||||
export const ShareModal = (meta) => {
|
||||
const classes = useStyles();
|
||||
const { shareModal, setShareModal } = useShareModal();
|
||||
const { shareLink, setShareLink } = useShareLink();
|
||||
const { setModalVisible } = useModal();
|
||||
@@ -26,16 +27,15 @@ export const ShareModal = () => {
|
||||
|
||||
return (
|
||||
<Modal visible={shareModal} handleClose={_handleClose}>
|
||||
<div style={{ marginBottom: 50 }}>
|
||||
<div className={classes.shareModal}>
|
||||
<Button style={{ position: 'absolute', right: 0, width: '10%' }} onClick={_handleClose}><CloseIcon /></Button>
|
||||
<div style={{ marginTop: 40 }}>
|
||||
<div className={classes.innerShareModal}>
|
||||
<h4 style={{ textAlign: 'center', marginTop: 20 }}>Where do you want to share the photo?</h4>
|
||||
<Button>
|
||||
{<TwitterIcon />} Twitter
|
||||
</Button>
|
||||
<Button>
|
||||
{<FontAwesomeIcon icon={faAd} fixedWidth size="2x"/>} Advert
|
||||
{<MessageIcon />} Message
|
||||
</Button>
|
||||
<h4>Or just copy the image here:</h4>
|
||||
<p>{meta.image}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
@@ -33,6 +33,15 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||
marginTop: 15,
|
||||
display: 'flex',
|
||||
justifyContent: 'space-evenly'
|
||||
},
|
||||
|
||||
// share modal
|
||||
shareModal: {
|
||||
marginBottom: 50
|
||||
},
|
||||
innerShareModal: {
|
||||
marginTop: 40,
|
||||
textAlign: 'center'
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
Reference in new issue
Block a user