Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pblvrt committed Oct 25, 2023
1 parent 34935d5 commit 5040ceb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client'
import React, { useContext, useState } from 'react'
import React, { useContext, useEffect, useState } from 'react'
import { ModalContext } from '@/components/context/ModalContext'
import { IEvent } from '@/server/model/event'
import useLocalStorage from '@/components/hooks/useLocalStorage'
Expand Down Expand Up @@ -64,11 +64,16 @@ const ReserveSpotModal = ({ event }: { event: IEvent }) => {

const ReserveSpotButton = ({ event }: props) => {
const { openModal } = useContext(ModalContext)
const [user, setUser] = useLocalStorage<SignUp>(event.id, {
email: '',
isSignedUp: false,
})
const [user, setUser] = useState<SignUp>()

useEffect(() => {
if (window !== undefined) {
const item = window.localStorage.getItem(event.id)
if (item !== null) {
setUser(JSON.parse(item))
}
}
}, [])
if (user && user.isSignedUp) {
return <div className="text-center p-2 border bg-accent text-white rounded text-lg hoover:text-accent w-[200px]">{"you're"} signed up!</div>
}
Expand Down
2 changes: 1 addition & 1 deletion app/[organization]/[event]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Layout = async ({
}

return (
<div className="flex flex-col overflow-hidden h-full">
<div className="flex flex-col overflow-hidden h-full z-1">
<main className={`flex w-full overflow-scroll ml-auto bg-background`}>
<ColorComponent
event={event.toJson()}
Expand Down
4 changes: 2 additions & 2 deletions components/Layout/NavbarTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function NavbarTop() {
</div>
<div className="flex flex-row items-center justify-end w-full">
{menuVisible && <Navbar pages={pages} />}
{components.length > 1 &&
{components.length > 0 &&
components.map((component, index) => {
return (
<div className="w-full px-2" key={index}>
Expand All @@ -81,7 +81,7 @@ export default function NavbarTop() {
fgColor="#000"
className={`"h-8 w-8"`}
/>
{pages.length > 0 && <NavBarButton isNavVisible={menuVisible} setIsNavVisible={setMenuVisible} />}
{pages.length > 1 && <NavBarButton isNavVisible={menuVisible} setIsNavVisible={setMenuVisible} />}
</div>
</div>
</header>
Expand Down

0 comments on commit 5040ceb

Please sign in to comment.