Skip to content

Commit

Permalink
Add navigation for HelpRequests page
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanL06 committed Oct 23, 2024
1 parent a608d83 commit 0e6aa05
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
19 changes: 19 additions & 0 deletions components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
IoClose,
IoMenu,
IoChatboxEllipsesOutline,
IoDocumentTextOutline,
} from 'react-icons/io5'
import { HiOutlineDocumentPlus } from 'react-icons/hi2'
import { Tooltip } from 'react-tooltip'
Expand Down Expand Up @@ -203,6 +204,24 @@ const Navbar = ({
</Tooltip>
</button>
)}
{customClaims.admin && (
<button // Help Requests
onClick={() => {
setTab(5)
closeDrawer()
}}
className={`${basicStyle} ${
tab === 5 ? ' text-indigo-500 bg-indigo-100' : ''
} tooltip-help-requests`}>
<IoDocumentTextOutline size={30} />
<Tooltip
anchorSelect=".tooltip-help-requests"
place="bottom"
delayShow={500}>
Help Requests
</Tooltip>
</button>
)}
</div>
<div className="self-end">
{(customClaims.admin || customClaims.agency) && (
Expand Down
20 changes: 11 additions & 9 deletions pages/dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { db, auth } from '../config/firebase'
import LanguageSwitcher from '../components/LanguageSwitcher'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import Head from 'next/head'
import HelpRequests from '../components/HelpRequests'
const tabList = [
'Home',
'Profile',
Expand All @@ -38,20 +39,20 @@ const Dashboard = () => {
const router = useRouter()

const [agencyUpdateSubmitted, setAgencyUpdateSubmitted] = useState(0)
const [newReportModal,setNewReportModal] = useState(false)
const [newReportSubmitted,setNewReportSubmitted] = useState(0)

const [newReportModal,setNewReportModal] = useState(false)
const [newReportSubmitted,setNewReportSubmitted] = useState(0)

const handleNewReportSubmit = () => {
// increment the newReportSubmitted
setNewReportSubmitted((prevState) => prevState + 1)
setNewReportModal(false)
setNewReportSubmitted((prevState) => prevState + 1)
setNewReportModal(false)
}

const handleNewReportClick = () => {
setNewReportModal(true) // Open the modal when the button is clicked
}

const handleNewReportClick = () => {
setNewReportModal(true) // Open the modal when the button is clicked
}

const handleAgencyUpdateSubmit = () => {
// increment the agencyUpdateSubmitted
setAgencyUpdateSubmitted((prevState) => prevState + 1)
Expand Down Expand Up @@ -108,6 +109,7 @@ const Dashboard = () => {
{tab == 4 && customClaims.admin && (
<Agencies handleAgencyUpdateSubmit={handleAgencyUpdateSubmit} />
)}
{tab == 5 && customClaims.admin && <HelpRequests />}
</div>
{/* Render the NewReportModal */}
{newReportModal && (
Expand Down

0 comments on commit 0e6aa05

Please sign in to comment.