mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
initial commit for camera app
This commit is contained in:
1 parent
580fb12e92
commit
5b85efedf1
13 files changed
+334
No files matched your search
@@ -0,0 +1,65 @@
|
||||
import React from 'react'
|
||||
import Modal from '../../../../ui/components/Modal';
|
||||
import { usePhotoMeta } from '../../hooks/usePhotoMeta';
|
||||
import { usePhotoModal } from '../../hooks/usePhotoModal';
|
||||
import useStyles from './modal.styles';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { Button, Paper } from '@material-ui/core';
|
||||
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';
|
||||
|
||||
export const GalleryModal = () => {
|
||||
|
||||
const { meta, setMeta } = usePhotoMeta();
|
||||
const { modal, setModal } = usePhotoModal();
|
||||
const classes = useStyles();
|
||||
|
||||
const { shareModal ,setShareModal } = useShareModal();
|
||||
const { setShareLink } = useShareLink();
|
||||
|
||||
let history = useHistory();
|
||||
|
||||
const _handleClose = () => {
|
||||
setModal(false)
|
||||
setMeta(null);
|
||||
//history.goBack();
|
||||
}
|
||||
|
||||
const handleDeletePhoto = () => {
|
||||
console.log(meta.id)
|
||||
Nui.send('photo:deletePhoto', {
|
||||
id: meta.id
|
||||
})
|
||||
setModal(false)
|
||||
}
|
||||
|
||||
const handleSharePhoto = () => {
|
||||
setShareModal(true)
|
||||
setShareLink(meta.image)
|
||||
}
|
||||
|
||||
if(!meta) return null;
|
||||
|
||||
return (
|
||||
<Paper className={modal ? classes.modal : classes.modalHide}>
|
||||
<ShareModal />
|
||||
<div className={shareModal ? classes.backgroundModal : undefined} />
|
||||
<Button onClick={_handleClose}><ArrowBackIcon /></Button>
|
||||
<div className={classes.image} style={{ backgroundImage: `url(${meta.image})`}} />
|
||||
<div className={classes.actionDiv}>
|
||||
<Button onClick={handleDeletePhoto}>
|
||||
<DeleteIcon fontSize="large" />
|
||||
</Button>
|
||||
<Button onClick={handleSharePhoto}>
|
||||
<ShareIcon fontSize="large" />
|
||||
</Button>
|
||||
</div>
|
||||
</Paper>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user