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