diff --git a/components/layouts/components/NavBar.tsx b/components/layouts/components/NavBar.tsx index 9e711c7..fe5fc12 100644 --- a/components/layouts/components/NavBar.tsx +++ b/components/layouts/components/NavBar.tsx @@ -20,8 +20,8 @@ export const NavBar = () => { setNavVisible((prev) => !prev) } - const showLogin = !isEventReady - const showSessions = !isEventReady + const showLogin = isEventReady + const showSessions = isEventReady useEffect(() => { Router.events.on('beforeHistoryChange', () => { diff --git a/components/sessions/SessionGridCard.tsx b/components/sessions/SessionGridCard.tsx index 5fc352f..c942561 100644 --- a/components/sessions/SessionGridCard.tsx +++ b/components/sessions/SessionGridCard.tsx @@ -22,12 +22,12 @@ export const SessionGridCard = ({
{/* component */} {schedules[key]?.map((schedule: Session) => ( -
-
+
+
{schedule.is_serviceSession ? ( {schedule.title} ) : ( @@ -35,14 +35,14 @@ export const SessionGridCard = ({ {schedule.title} )} -
-

+
+

@ {hour(schedule.start_date_time)} |{' '} {schedule.rooms?.map((venue) => ( @@ -51,30 +51,33 @@ export const SessionGridCard = ({ ))}

{schedule.is_serviceSession ? ( -

+

{schedule.title}

) : ( -

+

{schedule.title}

)} -
+
- {!schedule.is_serviceSession} - {schedule.speakers?.map((speaker) => ( -
- -
- ))} + {!schedule.is_serviceSession && + schedule.speakers?.map((speaker) => ( +
+ +
+ ))}
diff --git a/components/sessions/SpeakersDetails.tsx b/components/sessions/SpeakersDetails.tsx index 27b5500..bef8e0a 100644 --- a/components/sessions/SpeakersDetails.tsx +++ b/components/sessions/SpeakersDetails.tsx @@ -29,15 +29,15 @@ export const SpeakersDetails = ({ session }: { session: Session }) => { showStatus={false} showIndicators={session.speakers.length > 1} > - {session.speakers.map((speaker, index) => { + {session.speakers.map((speaker) => { return ( // eslint-disable-next-line react/no-array-index-key -
+
{speaker.name}
diff --git a/context/AuthContext.tsx b/context/AuthContext.tsx index 1222b4b..4a5a41f 100644 --- a/context/AuthContext.tsx +++ b/context/AuthContext.tsx @@ -18,14 +18,18 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => { useEffect(() => { if (getCookie('token')) { - const getUser = async () => { - await axios.get('/details').then((response) => { - setIsAuthenticated(true) - setCurrentUser(response.data.user) - }) + try { + const getUser = async () => { + await axios.get('/details').then((response) => { + setIsAuthenticated(true) + setCurrentUser(response.data.user) + }) + } + getUser() + } catch (error) { + // eslint-disable-next-line no-console + console.log({ error }) } - - getUser() } }, []) diff --git a/context/ThemeContext.tsx b/context/ThemeContext.tsx index 7e874ef..d8095ec 100644 --- a/context/ThemeContext.tsx +++ b/context/ThemeContext.tsx @@ -15,7 +15,7 @@ const THEME_NAME = 'droidcon_theme' export const ThemeProvider = ({ children }: { children: ReactNode }) => { const [isDarkTheme, setIsDarkTheme] = useState(false) - const isEventReady = false // Boolean(process.env.NEXT_PUBLIC_EVENT_READY) || false + const isEventReady = Boolean(process.env.NEXT_PUBLIC_EVENT_READY) || false useEffect(() => { if (isClient) { diff --git a/next.config.js b/next.config.js index ad4e78c..47b69be 100755 --- a/next.config.js +++ b/next.config.js @@ -47,6 +47,19 @@ module.exports = withPWA({ // method: 'GET', // strategyOptions: { cacheableResponse: { statuses: [0, 200] } }, }, + { + urlPattern: '/^https://res.cloudinary.com/droidconke/*/i', + handler: 'CacheFirst', + options: { + cacheName: 'static-image-assets-1', + expiration: { + maxEntries: 4, + maxAgeSeconds: 7 * 24 * 60 * 60, // 7 days + }, + }, + // method: 'GET', + // strategyOptions: { cacheableResponse: { statuses: [0, 200] } }, + }, { urlPattern: '/^https://sessionize.com/image*/i', handler: 'CacheFirst', diff --git a/pages/sessions/index.tsx b/pages/sessions/index.tsx index 94b258d..612c744 100644 --- a/pages/sessions/index.tsx +++ b/pages/sessions/index.tsx @@ -57,10 +57,7 @@ const Sessions: NextPage = ({
{!loading ? (
-
+
{Object.keys(schedules)?.map((key, i) => { return (