Add Telegram link
This commit is contained in:
@@ -46,11 +46,13 @@ export default function RezoMenu({data}) {
|
||||
setAnchorElement(event.currentTarget)
|
||||
}
|
||||
|
||||
const handleClose = rezo => {
|
||||
const handleClose = (rezo, link) => {
|
||||
setAnchorElement(null)
|
||||
if (typeof rezo === 'string') {
|
||||
if (typeof rezo === 'string' && !link) {
|
||||
const url = `https://${rezo}.${siteDomain}`
|
||||
router.push(url)
|
||||
} else if (typeof rezo === 'string' && link) {
|
||||
window.open(link, '_blank')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,8 +77,8 @@ export default function RezoMenu({data}) {
|
||||
open={Boolean(anchorElement)}
|
||||
onClose={handleClose}
|
||||
>
|
||||
{data.map(({id, tit, icon}) => (
|
||||
<StyledMenuItem key={id} onClick={() => handleClose(id)}>
|
||||
{data.map(({id, tit, icon, link}) => (
|
||||
<StyledMenuItem key={id} onClick={() => handleClose(id, link)}>
|
||||
<ListItemIcon>
|
||||
{icon}
|
||||
</ListItemIcon>
|
||||
|
||||
Reference in New Issue
Block a user