Skip to content

Commit

Permalink
done with commenting up ballot info
Browse files Browse the repository at this point in the history
  • Loading branch information
eelkus01 committed Jun 24, 2024
1 parent cc67b19 commit 067d5b9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 41 deletions.
4 changes: 4 additions & 0 deletions client/src/pages/ballotInfo/ballotInitDropDown.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* Hardcoded drop down for ballot initatives. Styles the outer dropdown as well
* as the contents.
*/

import * as React from 'react';
import Accordion from '@mui/material/Accordion';
import AccordionSummary from '@mui/material/AccordionSummary';
Expand Down
5 changes: 2 additions & 3 deletions client/src/pages/ballotInfo/districtForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import axios from 'axios';
import { Button, Grid, TextField } from '@mui/material';
import { localExpressURL, deployedExpressURL, setGlobalDistrictNum } from '@/common';

// localExpressURL is the URL for the local express server
// deployedExpressURL is the URL for the deployed express server

// Set base URL for Axios
const api = axios.create({
baseURL: localExpressURL, // Point this to server URL
baseURL: localExpressURL,
});


// On submit, set the district to be the result of api call
interface DistrictFormProps {
onFormSubmit: (district: string) => void;
}
Expand Down
7 changes: 2 additions & 5 deletions client/src/pages/ballotInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import ButtonFill from "@/components/button/ButtonFill"
import Checkbox from '@mui/material/Checkbox';
import * as React from 'react';
import DropDown from './whatsOnTheBallot/dropDown';
import BoxAddress from "../../components/button/boxAddress";
import NavBar from "@/components/nav/NavBar";
import BallotInitDropDown from "./ballotInitDropDown";
import ButtonFillEx from "@/components/button/ButtonFillEx";
Expand All @@ -11,8 +8,8 @@ import ElectionCheckbox from "./electionCheckBox/electionCheckbox";
import CandidateData from "./whatsOnTheBallot/candidateData";



export default function BallotInfo() {
// Below are checks for form submission and election checkbox completion
const [isFormSubmitted, setIsFormSubmitted] = React.useState<string | null>(null);
const [selectedElection, setSelectedElection] = React.useState<string | null>(null);

Expand Down Expand Up @@ -52,7 +49,7 @@ export default function BallotInfo() {
<h1 className='font-bold text-center mx-6 my-4 text-4xl text-blue-700' style={{ fontFamily: 'Arial, sans-serif' }}><strong>What&apos;s on the Ballot?</strong></h1>

<h1 className='font-semibold text-left text-2xl mt-4'>Candidates</h1>
{/*Testing*/}
{/* Don't make instance of candidate data till form and election are done */}
{isFormSubmitted && selectedElection && <CandidateData />}
{(!isFormSubmitted || !selectedElection) && <div>Please fill out the address form above and select an election to see your ballot information</div>}

Expand Down
29 changes: 0 additions & 29 deletions client/src/pages/ballotInfo/popUpBox.tsx

This file was deleted.

10 changes: 6 additions & 4 deletions client/src/pages/ballotInfo/whatsOnTheBallot/peopleCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* Card for each individual candidate.
/* Card for each individual candidate. Includes name, party, picture as a short
* profile to be displayed in the dropdown. When clicked, it takes you to a
* deeper profile including the rest of the info from strapi. Styles the small
* profile card.
*/

'use client';
Expand All @@ -20,7 +23,6 @@ type Props = {


const PeopleCard = ({ name, affiliation, picture, link }: Props) => {

const router = useRouter();
const handleClick = (page: string) => {
const candidatePath = `/ballotInfo/${name.replace(/\s+/g, '')}`;
Expand All @@ -29,7 +31,8 @@ const PeopleCard = ({ name, affiliation, picture, link }: Props) => {

return (
<Card onClick={() => handleClick(link)} sx={{
width: 300, height: 250, margin: 'auto', backgroundColor: '#f4f4f4', // Blue background color
width: 300, height: 250, margin: 'auto',
backgroundColor: '#f4f4f4', // Blue background color
color: 'white', // Text color
transition: 'background-color 0.3s ease', // Smooth transition
'&:hover': {
Expand All @@ -53,5 +56,4 @@ const PeopleCard = ({ name, affiliation, picture, link }: Props) => {
);
}


export default PeopleCard;

0 comments on commit 067d5b9

Please sign in to comment.