diff --git a/netlify/functions/event-reminders-hourly/index.ts b/netlify/functions/event-reminders-hourly/index.ts index d1f87f28..186a6635 100644 --- a/netlify/functions/event-reminders-hourly/index.ts +++ b/netlify/functions/event-reminders-hourly/index.ts @@ -197,77 +197,74 @@ export default async (req: Request) => { emoji: true, }, }, - ...filteredList.reduce[]>( - (list, event) => { - const eventDate = DateTime.fromISO(event.startDateLocalized); + ...filteredList.reduce[]>((list, event) => { + const eventDate = DateTime.fromISO(event.startDateLocalized); - const titleBlock: Record = { - type: 'section', + const titleBlock: Record = { + type: 'section', + text: { + type: 'mrkdwn', + text: `*${ + event.title + }*\n`, + }, + }; + + if ( + event.eventJoinLink && + event.eventJoinLink.substring(0, 4) === 'http' + ) { + titleBlock.accessory = { + type: 'button', text: { - type: 'mrkdwn', - text: `*${ - event.title - }*\n`, + type: 'plain_text', + text: 'Join Event', + emoji: true, }, + value: `join_event_${event.id}`, + url: event.eventJoinLink, + action_id: 'button-join-event', }; + } - if ( - event.eventJoinLink && - event.eventJoinLink.substring(0, 4) === 'http' - ) { - titleBlock.accessory = { - type: 'button', - text: { - type: 'plain_text', - text: 'Join Event', - emoji: true, - }, - value: `join_event_${event.id}`, - url: event.eventJoinLink, - action_id: 'button-join-event', - }; - } - - return [ - ...list, - titleBlock, - { - type: 'section', - text: { - type: 'mrkdwn', - text: `*Location:* ${event.eventJoinLink}`, - }, + return [ + ...list, + titleBlock, + { + type: 'section', + text: { + type: 'mrkdwn', + text: `*Location:* ${event.eventJoinLink}`, }, - ...(event.eventZoomHostCode - ? [ - { - type: 'section', - text: { - type: 'mrkdwn', - text: `*Host Code:* ${event.eventZoomHostCode}`, - }, + }, + ...(event.eventZoomHostCode + ? [ + { + type: 'section', + text: { + type: 'mrkdwn', + text: `*Host Code:* ${event.eventZoomHostCode}`, }, - ] - : []), - { - type: 'section', - text: { - type: 'mrkdwn', - text: `*Announcement posted to:* <#${ - event.eventSlackAnnouncementsChannelId || - DEFAULT_SLACK_EVENT_CHANNEL - }>`, - }, - }, - { - type: 'divider', + }, + ] + : []), + { + type: 'section', + text: { + type: 'mrkdwn', + text: `*Announcement posted to:* <#${ + event.eventSlackAnnouncementsChannelId || + DEFAULT_SLACK_EVENT_CHANNEL + }>`, }, - ]; - }, - [], - ), + }, + { + type: 'divider', + }, + ]; + }, []), ], }; diff --git a/netlify/functions/join-coffee.ts b/netlify/functions/join-coffee.ts index 1758dace..14fb3da6 100644 --- a/netlify/functions/join-coffee.ts +++ b/netlify/functions/join-coffee.ts @@ -12,7 +12,9 @@ export default async (req: Request) => { console.log(`Joining ${day}: ${code}`); const target = - day === 'tuesday' ? requireEnv('ZOOM_TUESDAYS') : requireEnv('ZOOM_THURSDAYS'); + day === 'tuesday' + ? requireEnv('ZOOM_TUESDAYS') + : requireEnv('ZOOM_THURSDAYS'); return Response.redirect(target, 302); }; diff --git a/netlify/functions/slack/index.ts b/netlify/functions/slack/index.ts index af521086..702a4c52 100644 --- a/netlify/functions/slack/index.ts +++ b/netlify/functions/slack/index.ts @@ -48,7 +48,11 @@ class NetlifyReceiver implements Receiver { }); } - const isValid = verifySlackRequest(rawBody, req.headers, this.signingSecret); + const isValid = verifySlackRequest( + rawBody, + req.headers, + this.signingSecret, + ); if (!isValid.valid) { console.log('Failed validation:', isValid.reason); return new Response(isValid.reason, { status: 401 }); diff --git a/src/app/page.tsx b/src/app/page.tsx index 13ed10e7..489a1089 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -27,38 +27,35 @@ export default async function Home() { return ( <> -
-
-

- -

+
+

+ +

-

- An intimate tech community for all,{' '} - - optimized for{' '} - you - -

-
+

+ An intimate tech community for all,{' '} + + optimized for you + +

+
-
-
-

- Virtual Coffee is a tech community where friendships are formed - and support is given to people at all stages of their journey. - Join our laid-back twice-weekly conversations and our online - events to connect with people who share your passion for - technology. -

+
+
+

+ Virtual Coffee is a tech community where friendships are formed and + support is given to people at all stages of their journey. Join our + laid-back twice-weekly conversations and our online events to + connect with people who share your passion for technology. +

-

- Anyone can join! Whether you're thinking about getting into - tech or have been in it for decades. -

-
+

+ Anyone can join! Whether you're thinking about getting into + tech or have been in it for decades. +

+

What we're up to

diff --git a/src/components/Nav.tsx b/src/components/Nav.tsx index 8a5fd407..58b31b0c 100644 --- a/src/components/Nav.tsx +++ b/src/components/Nav.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useState } from 'react'; +import { useState, useEffect, useRef } from 'react'; import Link from 'next/link'; import VirtualCoffeeFull from '@/svg/VirtualCoffeeFull'; @@ -8,11 +8,30 @@ export default function Nav() { const [isOpen, setIsOpen] = useState(false); const [isResourcesOpen, setIsResourcesOpen] = useState(false); + const dropdownRef = useRef(null); + const handleLinkClick = () => { setIsOpen(false); setIsResourcesOpen(false); }; + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if ( + dropdownRef.current && + !dropdownRef.current.contains(event.target as Node) + ) { + setIsResourcesOpen(false); + } + }; + + document.addEventListener('click', handleClickOutside); + + return () => { + document.removeEventListener('click', handleClickOutside); + }; + }, []); + return (