Skip to content

Commit bc65fbc

Browse files
authored
2023 Updates (#85)
* dcke 22 * #84 2023 updates
1 parent c1c5132 commit bc65fbc

File tree

17 files changed

+359
-36
lines changed

17 files changed

+359
-36
lines changed

.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ NEXT_PUBLIC_FIREBASE_PUBLIC_KEY=
1313
NEXT_PUBLIC_FIREBASE_SERVER_KEY=
1414
NEXT_PUBLIC_FIREBASE_APP_ID=
1515
NEXT_PUBLIC_MESSAGING_TOPIC=
16-
NEXT_PUBLIC_GOOGLE_TAG=
16+
NEXT_PUBLIC_GOOGLE_TAG=
17+
18+
NEXT_PUBLIC_EVENT_SLUG_2022=

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,6 @@ module.exports = {
8484
],
8585
'@next/next/no-img-element': 'off',
8686
'react/prop-types': 'off',
87+
'sonarjs/cognitive-complexity': 'off',
8788
},
8889
}

components/home/Banner.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ export const Banner = () => {
44
<div className="w-full flex flex-col md:flex-row items-center min-h-screen justify-between">
55
<div className="mt-32 md:mt-0">
66
<h1 className="font-light text-3xl md:text-4xl black px-0">
7-
<span className="lowercase">WELCOME TO</span> <br />
7+
<span className="lowercase">see you at</span> <br />
88
<span className="font-black text-4xl md:text-5xl">
9-
DROIDCONKE22
9+
DROIDCONKE23
1010
</span>
1111
</h1>
1212
<div className="mt-12 md:mt-8 text-3xl md:text-4xl lowercase font-light">
@@ -30,17 +30,17 @@ export const Banner = () => {
3030
target="_blank"
3131
rel="noopener noreferrer"
3232
>
33-
get your ticket
33+
get your early bird ticket
3434
</a>
3535

36-
<a
36+
{/* <a
3737
href="https://bit.ly/speakatdroidconke22"
3838
target="_blank"
3939
rel="noopener noreferrer"
4040
className="btn-accent mt-3 md:mt-0"
4141
>
4242
submit a talk
43-
</a>
43+
</a> */}
4444
</div>
4545
<div className="flex flex-wrap mt-8 md:mt-10 items-center">
4646
<img
@@ -49,7 +49,7 @@ export const Banner = () => {
4949
alt="droid alt"
5050
/>
5151
<div className="text-accent dark:text-accent-dark font-black text-base md:text-xl -mt-1">
52-
<span>16TH - 18TH</span> <br />
52+
<span>08TH - 10TH</span> <br />
5353
NOVEMBER
5454
</div>
5555
</div>

components/home/Sponsor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export const Sponsor = () => {
99
<div className="text-left md:text-center">
1010
<h2 className="title-w lowercase">
1111
<span>sponsor</span>{' '}
12-
<span className="font-medium"> droidconke22</span>
12+
<span className="font-medium"> droidconke23</span>
1313
</h2>
1414
<div className="w-full">
1515
<h6 className="mt-4 text-lighter dark:text-lighter-dark text-xl md:text-2xl">
16-
By sponsoring droidconke22 you support and bring together{' '}
16+
By sponsoring droidconke23 you support and bring together{' '}
1717
<br className="hidden md:block" />
1818
the Android developer community.
1919
</h6>

components/layouts/components/Footer.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const Footer = () => {
2222
target="_blank"
2323
rel="noreferrer"
2424
>
25-
Get Your Ticket
25+
Get your early bird Ticket
2626
</a>
2727
</div>
2828
</div>
@@ -36,18 +36,17 @@ export const Footer = () => {
3636
</span>
3737
<ul className="list-unstyled mt-3">
3838
<p className="text-white dark:text-white-dark text-base">
39-
United States International University - Africa, Nairobi,
40-
Kenya
39+
To Be Announced
4140
</p>
4241

43-
<a
42+
{/* <a
4443
href="https://goo.gl/maps/ZKyyQbFUM4miuiuL9"
4544
target="_blank"
4645
className="text-white dark:text-white-dark text-base"
4746
rel="noreferrer"
4847
>
4948
<i className="fa fa-map-marker" /> View Map location
50-
</a>
49+
</a> */}
5150
</ul>
5251
</div>
5352
{showExtraInfo && (

components/layouts/components/NavBar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { AuthContext } from '../../../context/AuthContext'
66
import { ThemeContext } from '../../../context/ThemeContext'
77
import { Login } from '../../auth/Login'
88
import { ToggleTheme } from './ToggleTheme'
9+
import { PastEventsDropdown } from './PastEventsDropdown'
910

1011
export const NavBar = () => {
1112
const { isDarkTheme, isEventReady } = useContext(ThemeContext)
@@ -122,6 +123,9 @@ export const NavBar = () => {
122123
</a>
123124
</Link>
124125
</li>
126+
<li className="mr-3">
127+
<PastEventsDropdown />
128+
</li>
125129
</ul>
126130
</div>
127131
<div className="w-full md:w-3/12 flex md:justify-end mt-4 md:mt-0 px-4 md:px-0">
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import { useState } from 'react'
2+
import Link from 'next/link'
3+
import { useRouter } from 'next/router'
4+
import useComponentVisible from '../../../hooks/useComponentVisible'
5+
6+
/* eslint-disable jsx-a11y/anchor-is-valid */
7+
export const PastEventsDropdown = () => {
8+
const [showMenu, setShowMenu] = useState(false)
9+
const { ref, isComponentVisible, setIsComponentVisible } =
10+
useComponentVisible(true)
11+
const router = useRouter()
12+
13+
return (
14+
<div className="relative inline-block text-left">
15+
<div>
16+
<button
17+
type="button"
18+
className="inline-flex w-full justify-center gap-x-1.5 px-3"
19+
id="menu-button"
20+
aria-expanded="true"
21+
aria-haspopup="true"
22+
onClick={() => {
23+
setShowMenu(!showMenu)
24+
setIsComponentVisible(true)
25+
}}
26+
>
27+
<span
28+
className={
29+
// eslint-disable-next-line sonarjs/no-duplicate-string
30+
router.pathname.includes('past-events')
31+
? 'active-link -ml-3'
32+
: 'link -ml-3'
33+
}
34+
>
35+
Past Events
36+
</span>
37+
<svg
38+
className={`-ml-5 mt-2 h-5 w-5 ${
39+
router.pathname.includes('past-events')
40+
? 'text-primary dark:text-accent'
41+
: 'text-black dark:text-white'
42+
}`}
43+
viewBox="0 0 20 20"
44+
fill="currentColor"
45+
aria-hidden="true"
46+
>
47+
<path
48+
fillRule="evenodd"
49+
d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
50+
clipRule="evenodd"
51+
/>
52+
</svg>
53+
</button>
54+
</div>
55+
56+
{/* <!--
57+
Dropdown menu, show/hide based on menu state.
58+
59+
Entering: "transition ease-out duration-100"
60+
From: "transform opacity-0 scale-95"
61+
To: "transform opacity-100 scale-100"
62+
Leaving: "transition ease-in duration-75"
63+
From: "transform opacity-100 scale-100"
64+
To: "transform opacity-0 scale-95"
65+
--> */}
66+
{showMenu && isComponentVisible && (
67+
<div
68+
className="md:absolute md:right-0 z-10 mt-2 mb-2 ml-2 md:-mt-1 w-40 origin-top-right rounded-md bg-lighter dark:bg-black shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none py-1"
69+
role="menu"
70+
aria-orientation="vertical"
71+
aria-labelledby="menu-button"
72+
tabIndex={-1}
73+
ref={ref}
74+
>
75+
<div className="py-1 text-sm" role="none">
76+
<Link href="/past-events/2022">
77+
<a
78+
className={
79+
router.pathname === '/past-events/2022'
80+
? 'active-link'
81+
: 'link'
82+
}
83+
>
84+
droidconKe 2022
85+
</a>
86+
</Link>
87+
</div>
88+
</div>
89+
)}
90+
</div>
91+
)
92+
}

components/sessions/SessionGridCard.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ import { NoSessions } from './NoSessions'
88
export const SessionGridCard = ({
99
schedules,
1010
activeTab,
11+
from,
1112
}: {
1213
schedules: Schedule[]
1314
activeTab: number
15+
// eslint-disable-next-line react/require-default-props
16+
from?: string
1417
}) => {
1518
return (
1619
<>
@@ -32,7 +35,11 @@ export const SessionGridCard = ({
3235
alt={schedule.title}
3336
/>
3437
) : (
35-
<Link href={`/sessions/${schedule.slug}`}>
38+
<Link
39+
href={`/sessions/${schedule.slug}${
40+
from ? `?from=${from}` : ''
41+
}`}
42+
>
3643
<a>
3744
<img
3845
className="object-cover md:object-cover"
@@ -57,7 +64,11 @@ export const SessionGridCard = ({
5764
{schedule.title}
5865
</p>
5966
) : (
60-
<Link href={`/sessions/${schedule.slug}`}>
67+
<Link
68+
href={`/sessions/${schedule.slug}${
69+
from ? `?from=${from}` : ''
70+
}`}
71+
>
6172
<a>
6273
<p className="text-sm mt-2 font-bold dark:text-white-dark">
6374
{schedule.is_keynote ? 'Keynote: ' : ''}{' '}

components/sessions/SessionListCard.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ import { NoSessions } from './NoSessions'
88
const SessionListCard = ({
99
schedules,
1010
activeTab,
11+
from,
1112
}: {
1213
schedules: Schedule[]
1314
activeTab: number
15+
// eslint-disable-next-line react/require-default-props
16+
from?: string
1417
}) => {
1518
return (
1619
<>
@@ -39,7 +42,11 @@ const SessionListCard = ({
3942
{schedule.title}
4043
</h4>
4144
) : (
42-
<Link href={`/sessions/${schedule.slug}`}>
45+
<Link
46+
href={`/sessions/${schedule.slug}${
47+
from ? `?from=${from}` : ''
48+
}`}
49+
>
4350
<a>
4451
<h4 className="font-bold md:text-xl dark:text-white">
4552
{schedule.is_keynote ? 'Keynote: ' : ''}{' '}

hooks/useComponentVisible.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { useState, useEffect, useRef } from 'react'
2+
3+
export default function useComponentVisible(initialIsVisible: boolean) {
4+
const [isComponentVisible, setIsComponentVisible] = useState(initialIsVisible)
5+
const ref = useRef(null)
6+
7+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8+
const handleClickOutside = (event: any) => {
9+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
10+
// @ts-ignore
11+
if (ref.current && !ref.current.contains(event.target)) {
12+
setIsComponentVisible(false)
13+
}
14+
}
15+
16+
useEffect(() => {
17+
document.addEventListener('click', handleClickOutside, true)
18+
return () => {
19+
document.removeEventListener('click', handleClickOutside, true)
20+
}
21+
}, [])
22+
23+
return { ref, isComponentVisible, setIsComponentVisible }
24+
}

0 commit comments

Comments
 (0)