From 47fe218d00de695c40d7d6ce64c4b2604e5531ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Thu, 23 Sep 2021 21:21:46 +0200 Subject: [PATCH] Add Telegram link --- components/rezo-menu.js | 10 ++++++---- pages/index.js | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/components/rezo-menu.js b/components/rezo-menu.js index 8e11b62..1bfec3f 100644 --- a/components/rezo-menu.js +++ b/components/rezo-menu.js @@ -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}) => ( - handleClose(id)}> + {data.map(({id, tit, icon, link}) => ( + handleClose(id, link)}> {icon} diff --git a/pages/index.js b/pages/index.js index 3423635..259c311 100644 --- a/pages/index.js +++ b/pages/index.js @@ -6,6 +6,7 @@ import {makeStyles} from '@material-ui/core/styles' import GroupIcon from '@material-ui/icons/Group' import MusicNoteIcon from '@material-ui/icons/MusicNote' import {Pleroma, Peertube} from '@icons-pack/react-simple-icons' +import TelegramIcon from '@material-ui/icons/Telegram' import KatKayLa from '../components/kat-kay-la' import HeadLayout from '../components/head-layout' @@ -25,6 +26,12 @@ const useStyles = makeStyles(theme => ({ })) const REZO = [ + { + id: 'telegram', + tit: 'Telegram', + icon: , + link: 'https://t.me/OrganisationKA' + }, { id: 'mizik', tit: 'Mizik',