Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bbrf frontend #14

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
"@material-ui/icons": "^4.11.2",
"@mui/material": "^5.5.3",
"@mui/system": "^5.5.2",
"@mui/x-date-pickers": "^7.22.2",
"@reduxjs/toolkit": "^1.8.1",
"axios": "^1.1.2",
"cross-env": "^7.0.3",
"dayjs": "^1.11.13",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
7 changes: 7 additions & 0 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import AlertPopup from './components/AlertPopup.tsx';
import InviteRegisterPage from './Authentication/InviteRegisterPage.tsx';
import Landing from './Landing/Landing.tsx';
import TempAdminDashboardPage from './AdminDashboard/TempAdminDashboardPage.tsx';
import BirthdayBoxRequestForm from './components/BirthdayBoxRequestForm/BirthdayBoxRequestForm.tsx';
import SuccessPage from './components/BirthdayBoxRequestForm/SuccessPage.tsx';
import ChapterDashboardPage from './Chapters/ChapterDashboardPage.tsx';

function App() {
Expand All @@ -42,6 +44,11 @@ function App() {
<Route path="/login" element={<LoginPage />} />
{/* <Route path="/admin" element={<TempAdminDashboardPage />} /> */}
{/* <Route path="/admin" element={<TempAdminDashboardPage />} /> */}
<Route
path="/request-form/:chapterId"
element={<BirthdayBoxRequestForm />}
/>
<Route path="/success" element={<SuccessPage />} />
<Route
path="/verify-account/:token"
element={<VerifyAccountPage />}
Expand Down
9 changes: 6 additions & 3 deletions client/src/Home/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import {
Button,
Dialog,
Expand Down Expand Up @@ -113,7 +114,7 @@ const stateChapters: StateChapters = {
acceptingRequests: true,
chapters: [
{ city: 'Columbia County', id: 'wi-1' },
{ city: 'DeForest', id: 'wi-2' },
{ city: 'DeForest', id: '67156b8f624d2639a91ee518' },
{ city: 'Madison', id: 'wi-3' },
{ city: 'Sun Prairie', id: 'wi-4' },
{ city: 'Poynette', id: 'wi-5' },
Expand All @@ -124,6 +125,7 @@ const stateChapters: StateChapters = {
export default function LandingPage() {
const [selectedState, setSelectedState] = useState<StateData | null>(null);
const [hoveredChapter, setHoveredChapter] = useState<Chapter | null>(null);
const navigate = useNavigate();

const mapHandler = (event: any) => {
const stateData = stateChapters[event.target.dataset.name];
Expand All @@ -147,7 +149,7 @@ export default function LandingPage() {
};

const handleRequestClick = (chapter: Chapter): void => {
console.log('Navigate to request form for:', chapter);
navigate(`/request-form/${chapter.id}`);
};

const handleClose = (): void => {
Expand Down Expand Up @@ -270,7 +272,8 @@ export default function LandingPage() {
bgcolor: '#DB2777',
},
}}
onClick={() => handleRequestClick(chapter)}
onClick={() =>
handleRequestClick(chapter)}
>
Request Form
</Button>
Expand Down
10 changes: 5 additions & 5 deletions client/src/Landing/LandingMap.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import USAMap from 'react-usa-map';
Expand All @@ -11,6 +12,7 @@ import {
} from '../util/constants/map.ts';

export default function LandingMap() {
const navigate = useNavigate();
const [stateData, setStateData] = useState<Chapter[] | null>(null);
const [chosenState, setChosenState] = useState<StateAbbreviation | null>(
null,
Expand Down Expand Up @@ -192,11 +194,9 @@ export default function LandingMap() {
width: '100px',
borderRadius: '20px',
}}
onClick={() =>
console.log(
`redirecting to ${chapter.city}'s form`,
)
}
onClick={() => {
navigate(`/request-form/${chapter.id}`);
}}
>
VIEW FORM
</Button>
Expand Down
Loading