From 271d42c0769876280447e61c3af2e342c862bf0f Mon Sep 17 00:00:00 2001 From: "Jihun (James) Doh" Date: Sun, 17 Nov 2024 16:41:59 -0500 Subject: [PATCH] modal content changed to buttons of chapters, with clicking showing either form or no form text --- client/src/Landing/Landing.tsx | 547 +-------------------------- client/src/Landing/LandingHeader.tsx | 42 ++ client/src/Landing/LandingMap.tsx | 219 +++++++++++ client/src/util/constants/map.ts | 137 +++++++ client/src/util/types/map.ts | 62 +++ 5 files changed, 470 insertions(+), 537 deletions(-) create mode 100644 client/src/Landing/LandingHeader.tsx create mode 100644 client/src/Landing/LandingMap.tsx create mode 100644 client/src/util/constants/map.ts create mode 100644 client/src/util/types/map.ts diff --git a/client/src/Landing/Landing.tsx b/client/src/Landing/Landing.tsx index a61f0937..01f62000 100644 --- a/client/src/Landing/Landing.tsx +++ b/client/src/Landing/Landing.tsx @@ -1,544 +1,17 @@ -import React, { useEffect, useState } from 'react'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import USAMap from 'react-usa-map'; -import { Modal, Box, Grid, Typography } from '@mui/material'; - -type StateAbbreviation = - | 'AL' - | 'AK' - | 'AZ' - | 'AR' - | 'CA' - | 'CO' - | 'CT' - | 'DE' - | 'FL' - | 'GA' - | 'HI' - | 'ID' - | 'IL' - | 'IN' - | 'IA' - | 'KS' - | 'KY' - | 'LA' - | 'ME' - | 'MD' - | 'MA' - | 'MI' - | 'MN' - | 'MS' - | 'MO' - | 'MT' - | 'NE' - | 'NV' - | 'NH' - | 'NJ' - | 'NM' - | 'NY' - | 'NC' - | 'ND' - | 'OH' - | 'OK' - | 'OR' - | 'PA' - | 'RI' - | 'SC' - | 'SD' - | 'TN' - | 'TX' - | 'UT' - | 'VT' - | 'VA' - | 'WA' - | 'WV' - | 'WI' - | 'WY'; - -type StateConfig = { - fill: string; -}; - -const STATES: Record = { - AL: { fill: '#4EC2BA' }, - AK: { fill: '#FEEA53' }, - AZ: { fill: '#D4D2D1' }, - AR: { fill: '#F48F87' }, - CA: { fill: '#4EC2BA' }, - CO: { fill: '#FEEA53' }, - CT: { fill: '#D4D2D1' }, - DE: { fill: '#F48F87' }, - FL: { fill: '#4EC2BA' }, - GA: { fill: '#FEEA53' }, - HI: { fill: '#D4D2D1' }, - ID: { fill: '#F48F87' }, - IL: { fill: '#4EC2BA' }, - IN: { fill: '#FEEA53' }, - IA: { fill: '#D4D2D1' }, - KS: { fill: '#F48F87' }, - KY: { fill: '#4EC2BA' }, - LA: { fill: '#FEEA53' }, - ME: { fill: '#D4D2D1' }, - MD: { fill: '#F48F87' }, - MA: { fill: '#4EC2BA' }, - MI: { fill: '#FEEA53' }, - MN: { fill: '#D4D2D1' }, - MS: { fill: '#F48F87' }, - MO: { fill: '#4EC2BA' }, - MT: { fill: '#FEEA53' }, - NE: { fill: '#D4D2D1' }, - NV: { fill: '#F48F87' }, - NH: { fill: '#4EC2BA' }, - NJ: { fill: '#FEEA53' }, - NM: { fill: '#D4D2D1' }, - NY: { fill: '#F48F87' }, - NC: { fill: '#4EC2BA' }, - ND: { fill: '#FEEA53' }, - OH: { fill: '#D4D2D1' }, - OK: { fill: '#F48F87' }, - OR: { fill: '#4EC2BA' }, - PA: { fill: '#FEEA53' }, - RI: { fill: '#D4D2D1' }, - SC: { fill: '#F48F87' }, - SD: { fill: '#4EC2BA' }, - TN: { fill: '#FEEA53' }, - TX: { fill: '#D4D2D1' }, - UT: { fill: '#F48F87' }, - VT: { fill: '#4EC2BA' }, - VA: { fill: '#FEEA53' }, - WA: { fill: '#D4D2D1' }, - WV: { fill: '#F48F87' }, - WI: { fill: '#4EC2BA' }, - WY: { fill: '#FEEA53' }, -}; - -interface ChapterInfo { - city: string; - leaders: string; - email: string; - bio: string; -} - -const CHAPTER_DATA: Record = { - ID: [ - { - city: 'Boise', - leaders: 'Erin Taylor', - email: 'boxofballoonsboise@gmail.com', - bio: 'Bio Coming Soon! This chapter is active!', - }, - ], - NV: [ - { - city: 'Reno', - leaders: 'Jolie Mortensen', - email: 'boxofballoons.renonv@gmail.com', - bio: 'Hi my name is Jolie Mortensen! I live in Reno, Nevada and am excited to be the Box of Balloon Chapter Leader for our area. I am married to my incredible husband, Soren. We have two adorable little girls and a fur baby. When I\'m not spending time with my family, I enjoy reading, seeing live music, traveling, and gathering with friends. I am so proud to be part of a team with such an important mission. I love to party plan and celebrate the people that I love. I believe everyone deserves to be celebrated! Here at Box of Balloons we want all children to know they are loved and special. Building BoB boxes brings our family so much joy and it\'s a wonderful way to give back to the community.', - }, - ], - AZ: [ - { - city: 'Phoenix', - leaders: 'Una Somerville & Kate Olsson', - email: 'boxofballoons.phoenixaz@gmail.com', - bio: 'The Phoenix Chapter is managed by mother and daughter volunteer team Una Somerville and Kate Olsson. With the support of a strong group of loyal volunteers, Kate and Una make sure about 50 boxes a month are delivered to deserving kiddos around the greater Phoenix area, including Tempe, Chandler, Mesa, Gilbert, Scottsdale and more. Making sure every child has a happy birthday is what it\'s all about!', - }, - ], - CO: [ - { - city: 'Denver Metro', - leaders: 'Lori Kearns', - email: 'boxofballoons.denvermetro@gmail.com', - bio: 'Hi! My name is Lori Kearns and I am a new chapter co-lead with Box of Balloons Denver. I started volunteering with Box of Balloons in the spring of 2021, both for me to be involved and also for my kids to give back, and was immediately so touched by what this organization, chapter leads and volunteers do for our communities. So when the opportunity came up in early 2022 to be a co-lead, I was instantly in.', - }, - ], - ND: [ - { - city: 'Fargo', - leaders: 'Chris Welsand & Chelsey', - email: 'boxofballoons.fargond@gmail.com', - bio: 'Hi! My name is Chris Welsand, and I serve as the Director/Co-Leader of Box of Balloons – Fargo. Since arriving in Fargo in 2012, I have been blessed to get involved with a variety of volunteer projects at my daughter\'s school, my church and in the community.', - }, - { - city: 'Minot', - leaders: 'Sarah Fagerland', - email: 'boxofballoons.minotnd@gmail.com', - bio: 'Hello! My name is Sarah Fagerland and I live in Minot, ND with my 3 teenagers, Jacie, Ben and Fallon. I am a Licensed Insurance Producer and work for Horace Mann Insurance. When I discovered Box of Balloons, I immediately knew I wanted to bring it to our community.', - }, - ], - OK: [ - { - city: 'Oklahoma City', - leaders: 'Kristi Rhoades', - email: 'boxofballoons.oklahomacityok@gmail.com', - bio: 'Greetings OKC Box of Balloons Volunteers, My name is Kristi Rhoades. I am a lifelong resident of Oklahoma. My roots are planted here, and I am so excited to have this opportunity to give back to my community.', - }, - ], - IA: [ - { - city: 'Iowa City', - leaders: 'Heather Spangler', - email: 'boxofballoons.iowacityia@gmail.com', - bio: 'Hi, I\'m Heather Spangler and I\'ve led the Iowa City/Cedar Rapids chapter since 2019. I\'m a mother of two fun girls. I have always enjoyed helping people and a good party. Box of Balloons is a great combo of those things!', - }, - ], - AR: [ - { - city: 'Northwest', - leaders: 'Quincee', - email: 'boxofballoons.northwestar@gmail.com', - bio: 'My name is Quincee and I have the privilege of leading Box of Balloons NWA. I\'m an Arkansas native and love the NWA bubble! I grew up in Springdale, and I graduated from the University of Arkansas.', - }, - ], - WI: [ - { - city: 'Columbia County', - leaders: 'Kadie & Rachel Nachreiner', - email: 'boxofballoons.portagewi@gmail.com', - bio: 'Hello, my name is Kadie, and I am proud to call Portage home. I love being active in my community, and Box of Balloons is a perfect organization for making an impact.', - }, - { - city: 'DeForest', - leaders: 'Kelsey Loughran', - email: 'boxofballoons.deforestwi@gmail.com', - bio: 'Hi my name is Kelsey Loughran! I grew up in De Forest, WI and am beyond thrilled to be the BOB Chapter Leader there. I currently am a third grade teacher in the area as well!', - }, - { - city: 'Madison', - leaders: 'Cate Valenzuela, Karen Romadka, Jennifer Javornik, Eva, Autumn', - email: 'boxofballoons.madisonWI@gmail.com', - bio: 'Hi, I\'m Cate Valenzuela, one of the co-leaders of the Madison West chapter of Box of Balloons. I enjoy working as a technical writer, traveling, and doing craft projects with my daughter.', - }, - { - city: 'Sun Prairie', - leaders: 'Kelly Davis', - email: 'boxofballoonssp@gmail.com', - bio: 'Hello, my name is Kelly! I live in Sun Prairie with my husband and two sons, Desmond and Tate. During the week, I am a marketing professional in the energy industry, supporting local not-for-profit utilities.', - }, - { - city: 'Janesville', - leaders: 'Brittany Strickert & Jessica Hickerson', - email: 'boxofballoons.janesvillewi@gmail.com', - bio: 'Hello! I am Brittany, a co-leader for the Janesville Box of Balloons Chapter. I live in Janesville with my husband of 10 years and our 7 year old daughter. I work as a Data Analyst and enjoy baking, being outdoors, playing cards and games, and spending time with my family.', - }, - { - city: 'Monroe', - leaders: 'Amanda Hirsch', - email: 'boxofballoons.monroe@gmail.com', - bio: 'Amanda Hirsch is leading Box of Balloons in the Monroe area. Amanda and her husband have been married for 10 years and have three children, ages 9, 5, and 2. She is a stay-at-home mom and enjoys all the craziness and fun her children bless her with.', - }, - ], - IL: [ - { - city: 'Aurora', - leaders: 'Laura Burgess', - email: 'boxofballoons.aurora@gmail.com', - bio: 'Hello, My name is Laura Burgess and I have been a stay at home mom for over 5 years. Prior to that I was a 1st grade teacher in the DFW area. I have always loved working with children and giving back.', - }, - ], - MI: [ - { - city: 'Grand Rapids', - leaders: 'Laura', - email: 'boxofballoons.grandrapidsmi@gmail.com', - bio: 'More info coming soon!', - }, - ], - KY: [ - { - city: 'Lexington', - leaders: 'Ellen Fairbanks & Liz Yates', - email: 'boxofballoons.lexingtonky@gmail.com', - bio: 'Hi, I\'m Ellen! I have been married for 12 years to my husband Phil and we have three children Max (8), Nicholas (6) and Emily (4). I heard about Box of Balloons on a local radio station. The mission to bring joy to children in our local community inspired me.', - }, - ], - AL: [ - { - city: 'Mobile', - leaders: 'Shilpa & Hill', - email: 'boxofballoons.mobileal@gmail.com', - bio: 'Hello! Shilpa here and I am a child of immigrants. In fact, I am actually an immigrant myself because I was born in India and moved to the United States in 1989 at the age of eight.', - }, - ], - GA: [ - { - city: 'Cumming', - leaders: 'Roxann Wruble', - email: 'boxofballoons.cummingga@gmail.com', - bio: 'Hi, My name is Roxann Wruble. I have lived in Johns Creek (formerly Alpharetta), GA, for 21 years with my husband, Tim. We are both originally from Indiana and still have family there.', - }, - ], - FL: [ - { - city: 'Palm Beach County', - leaders: 'Marci Dubler', - email: 'boxofballoons.palmbeachctyfl@gmail.com', - bio: 'Hi! I\'m Marci Dubler and I was born and raised in Wisconsin which is where I learned about Box of Balloons. I now live in North Palm Beach with my husband and son.', - }, - ], - PA: [ - { - city: 'Philadelphia', - leaders: 'Alyssa Heron', - email: 'boxofballoons.philadelphiaPA@gmail.com', - bio: 'My name is Alyssa Heron, and I am from Philadelphia, Pennsylvania. I am a financial planner and a Temple University alumni. My now husband, Jason, and I started a chapter in Philadelphia when we were in college together to bring fellow students together to spread joy in our community!', - }, - ], - NY: [ - { - city: 'Syracuse', - leaders: 'Jennifer', - email: 'boxofballoons.syracuseny@gmail.com', - bio: 'Hi Everyone! My name is Jennifer Crowell. I am born and raise in Syracuse, NY. I live with my husband, Travis, and our energetic dog, Lulu. I have worked in the non profit sector since 2005, in various positions serving adults with disabilities.', - }, - ], - MD: [ - { - city: 'Boonsboro', - leaders: 'Desi Rogers', - email: 'boxofballoonsMD@gmail.com', - bio: 'I am Desi Rogers and I am so excited to bring Box of Balloons to my community. I live in Boonsboro Maryland with my husband, 2 children, a schnauzer and a greyhound.', - }, - { - city: 'Carroll County', - leaders: 'Kelly Dynis', - email: 'boxofballoonsccmd@gmail.com', - bio: 'More information to come. Check back soon!', - }, - ], - AK: [], - CA: [], - CT: [], - DE: [], - HI: [], - IN: [], - KS: [], - LA: [], - ME: [], - MA: [], - MN: [], - MS: [], - MO: [], - MT: [], - NE: [], - NH: [], - NJ: [], - NM: [], - NC: [], - OH: [], - OR: [], - RI: [], - SC: [], - SD: [], - TN: [], - TX: [], - UT: [], - VT: [], - VA: [], - WA: [], - WV: [], - WY: [], -}; - -function getStateKeys( - obj: Record, -): StateAbbreviation[] { - return Object.keys(obj) as StateAbbreviation[]; -} +import React from 'react'; +import { Button } from '@mui/material'; +import { StateAbbreviation, StateConfig } from '../util/types/map'; +import LandingMap from './LandingMap'; +import LandingHeader from './LandingHeader'; export default function Landing() { - const [showModal, setShowModal] = useState(false); - const [stateData, setStateData] = useState(null); - const [chosenState, setChosenState] = useState(null); - - const filteredStateData = - stateData && chosenState - ? stateData.filter((chapter) => chapter.location === chosenState) - : []; - - console.log(filteredStateData); - useEffect(() => { - async function fetchChapters() { - try { - const res = await fetch('http://localhost:4000/api/chapters'); - const data = await res.json(); - setStateData(data); - } catch (error) { - console.log('error'); - } - } - fetchChapters(); - }, []); - - const statesCustomConfig = () => { - const statesConfig: Record = {}; - - getStateKeys(STATES).forEach((state) => { - statesConfig[state] = { - fill: STATES[state].fill, - clickHandler: async () => { - setChosenState(state); - setShowModal(true); - }, - }; - }); - - return statesConfig; - }; - return (
- {/* Chapter Login Button */} -
- -
- - {/* Logo and Welcome Section */} -
-
-
- Box - of - - Balloons - -
-

- Welcome! -

-

- Click on your state below to connect with a local chapter in your - area! -

-

- Email your Chapter Leader directly to: -

-
    -
  • Request a birthday box for a family in need
  • -
  • Sign up as a volunteer
  • -
  • Donate to your local chapter
  • -
  • Sign up for our Build-A-Box program
  • -
  • - Connect with your local chapter leader to learn more ways you can - support our cause -
  • -
-
-
- - {/* Map Section */} - - - - setShowModal(false)} - aria-labelledby="modal-modal-title" - aria-describedby="modal-modal-description" - > - - - {chosenState && CHAPTER_DATA[chosenState] - ? `Box of Balloons Chapters in ${chosenState}` - : `No Chapters in ${chosenState}`} - - - {chosenState && CHAPTER_DATA[chosenState] && CHAPTER_DATA[chosenState].length > 0 ? ( - CHAPTER_DATA[chosenState].map((chapter, index) => ( - - - {chapter.city} - - - Chapter Leader(s): {chapter.leaders} - - - Email: {chapter.email} - - - {chapter.bio} - - - )) - ) : ( - - Currently no active chapters in this state. Check back soon! - - )} - - - - + + +
); } diff --git a/client/src/Landing/LandingHeader.tsx b/client/src/Landing/LandingHeader.tsx new file mode 100644 index 00000000..a0a735c9 --- /dev/null +++ b/client/src/Landing/LandingHeader.tsx @@ -0,0 +1,42 @@ +import React from 'react'; + +export default function LandingHeader() { + return ( +
+
+
+ Box + of + Balloons +
+

+ Welcome! +

+

+ Click on your state below to connect with a local chapter in your + area! +

+
+
+ ); +} diff --git a/client/src/Landing/LandingMap.tsx b/client/src/Landing/LandingMap.tsx new file mode 100644 index 00000000..e424e7e3 --- /dev/null +++ b/client/src/Landing/LandingMap.tsx @@ -0,0 +1,219 @@ +import React, { useEffect, useState } from 'react'; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import USAMap from 'react-usa-map'; +import { Modal, Box, Grid, Typography, Button } from '@mui/material'; +import { Chapter, StateAbbreviation } from '../util/types/map'; +import { + CHAPTER_DATA, + StateAbbreviationToState, + STATES, +} from '../util/constants/map'; + +export default function LandingMap() { + const [stateData, setStateData] = useState(null); + const [chosenState, setChosenState] = useState( + null, + ); + const [showModal, setShowModal] = useState(false); + const [chosenChapter, setChosenChapter] = useState(null); + const [availableStates, setAvailableStates] = useState< + Set + >(new Set()); + + function getStateKeys( + obj: Record, + ): StateAbbreviation[] { + return Object.keys(obj) as StateAbbreviation[]; + } + + const filteredStateData = + stateData && chosenState + ? stateData.filter((chapter) => chapter.state === chosenState) + : []; + + useEffect(() => { + async function fetchChapters() { + try { + const res = await fetch('http://localhost:4000/api/chapters'); + const data = await res.json(); + setStateData(CHAPTER_DATA); // replace with fetched data + setAvailableStates( + new Set(CHAPTER_DATA.map((chapter) => chapter.state)), + ); + } catch (error) { + console.log('error'); + } + } + fetchChapters(); + }, []); + + const statesCustomConfig = () => { + const statesConfig: Record = {}; + + getStateKeys(STATES).forEach((state) => { + statesConfig[state] = { + fill: availableStates.has(state) ? '#4EC2BA' : '#D3D3D3', + clickHandler: availableStates.has(state) + ? async () => { + setChosenState(state); + setShowModal(true); + } + : undefined, + }; + }); + + return statesConfig; + }; + + function displayForm(chapterId: number) { + setChosenChapter(chapterId); + } + + return ( + + + + { + setShowModal(false); + setChosenChapter(null); + setChosenState(null); + }} + aria-labelledby="modal-modal-title" + aria-describedby="modal-modal-description" + > + + + + {filteredStateData + ? `${StateAbbreviationToState[chosenState!]}` + : `No Chapters in ${chosenState}`} + + + {filteredStateData && filteredStateData.length > 0 ? ( + <> + {' '} + + Local Chapters + +
    + {filteredStateData.map((chapter) => ( + + + {chosenChapter && chosenChapter === chapter.id && ( + + {chapter.isAcceptingRequests ? ( + + ) : ( + + Sorry, we are not accepting requests. Please + try again next month! + + )} + + )} + + ))} +
+ + ) : ( + + Currently no active chapters in this state. Check back soon! + + )} +
+
+
+
+
+
+ ); +} diff --git a/client/src/util/constants/map.ts b/client/src/util/constants/map.ts new file mode 100644 index 00000000..cb84a5af --- /dev/null +++ b/client/src/util/constants/map.ts @@ -0,0 +1,137 @@ +import { Chapter, StateAbbreviation, StateConfig } from '../types/map'; + +const STATES: Record = { + AL: { fill: '#4EC2BA' }, + AK: { fill: '#FEEA53' }, + AZ: { fill: '#D4D2D1' }, + AR: { fill: '#F48F87' }, + CA: { fill: '#4EC2BA' }, + CO: { fill: '#FEEA53' }, + CT: { fill: '#D4D2D1' }, + DE: { fill: '#F48F87' }, + FL: { fill: '#4EC2BA' }, + GA: { fill: '#FEEA53' }, + HI: { fill: '#D4D2D1' }, + ID: { fill: '#F48F87' }, + IL: { fill: '#4EC2BA' }, + IN: { fill: '#FEEA53' }, + IA: { fill: '#D4D2D1' }, + KS: { fill: '#F48F87' }, + KY: { fill: '#4EC2BA' }, + LA: { fill: '#FEEA53' }, + ME: { fill: '#D4D2D1' }, + MD: { fill: '#F48F87' }, + MA: { fill: '#4EC2BA' }, + MI: { fill: '#FEEA53' }, + MN: { fill: '#D4D2D1' }, + MS: { fill: '#F48F87' }, + MO: { fill: '#4EC2BA' }, + MT: { fill: '#FEEA53' }, + NE: { fill: '#D4D2D1' }, + NV: { fill: '#F48F87' }, + NH: { fill: '#4EC2BA' }, + NJ: { fill: '#FEEA53' }, + NM: { fill: '#D4D2D1' }, + NY: { fill: '#F48F87' }, + NC: { fill: '#4EC2BA' }, + ND: { fill: '#FEEA53' }, + OH: { fill: '#D4D2D1' }, + OK: { fill: '#F48F87' }, + OR: { fill: '#4EC2BA' }, + PA: { fill: '#FEEA53' }, + RI: { fill: '#D4D2D1' }, + SC: { fill: '#F48F87' }, + SD: { fill: '#4EC2BA' }, + TN: { fill: '#FEEA53' }, + TX: { fill: '#D4D2D1' }, + UT: { fill: '#F48F87' }, + VT: { fill: '#4EC2BA' }, + VA: { fill: '#FEEA53' }, + WA: { fill: '#D4D2D1' }, + WV: { fill: '#F48F87' }, + WI: { fill: '#4EC2BA' }, + WY: { fill: '#FEEA53' }, +}; + +const CHAPTER_DATA: Chapter[] = [ + { id: 1, city: 'Boise', state: 'ID', isAcceptingRequests: true }, + { id: 2, city: 'Reno', state: 'NV', isAcceptingRequests: true }, + { id: 3, city: 'Phoenix', state: 'AZ', isAcceptingRequests: true }, + { id: 4, city: 'Denver Metro', state: 'CO', isAcceptingRequests: true }, + { id: 5, city: 'Fargo', state: 'ND', isAcceptingRequests: true }, + { id: 6, city: 'Minot', state: 'ND', isAcceptingRequests: true }, + { id: 7, city: 'Oklahoma City', state: 'OK', isAcceptingRequests: true }, + { id: 8, city: 'Iowa City', state: 'IA', isAcceptingRequests: true }, + { id: 9, city: 'Northwest', state: 'AR', isAcceptingRequests: true }, + { id: 10, city: 'Columbia County', state: 'WI', isAcceptingRequests: false }, + { id: 11, city: 'DeForest', state: 'WI', isAcceptingRequests: true }, + { id: 12, city: 'Madison', state: 'WI', isAcceptingRequests: true }, + { id: 13, city: 'Sun Prairie', state: 'WI', isAcceptingRequests: true }, + { id: 14, city: 'Janesville', state: 'WI', isAcceptingRequests: true }, + { id: 15, city: 'Monroe', state: 'WI', isAcceptingRequests: true }, + { id: 16, city: 'Aurora', state: 'IL', isAcceptingRequests: true }, + { id: 17, city: 'Grand Rapids', state: 'MI', isAcceptingRequests: true }, + { id: 18, city: 'Lexington', state: 'KY', isAcceptingRequests: true }, + { id: 19, city: 'Mobile', state: 'AL', isAcceptingRequests: true }, + { id: 20, city: 'Cumming', state: 'GA', isAcceptingRequests: true }, + { id: 21, city: 'Palm Beach County', state: 'FL', isAcceptingRequests: true }, + { id: 22, city: 'Philadelphia', state: 'PA', isAcceptingRequests: true }, + { id: 23, city: 'Syracuse', state: 'NY', isAcceptingRequests: true }, + { id: 24, city: 'Boonsboro', state: 'MD', isAcceptingRequests: true }, + { id: 25, city: 'Carroll County', state: 'MD', isAcceptingRequests: true }, +]; + +const StateAbbreviationToState: Record = { + AL: 'Alabama', + AK: 'Alaska', + AZ: 'Arizona', + AR: 'Arkansas', + CA: 'California', + CO: 'Colorado', + CT: 'Connecticut', + DE: 'Delaware', + FL: 'Florida', + GA: 'Georgia', + HI: 'Hawaii', + ID: 'Idaho', + IL: 'Illinois', + IN: 'Indiana', + IA: 'Iowa', + KS: 'Kansas', + KY: 'Kentucky', + LA: 'Louisiana', + ME: 'Maine', + MD: 'Maryland', + MA: 'Massachusetts', + MI: 'Michigan', + MN: 'Minnesota', + MS: 'Mississippi', + MO: 'Missouri', + MT: 'Montana', + NE: 'Nebraska', + NV: 'Nevada', + NH: 'New Hampshire', + NJ: 'New Jersey', + NM: 'New Mexico', + NY: 'New York', + NC: 'North Carolina', + ND: 'North Dakota', + OH: 'Ohio', + OK: 'Oklahoma', + OR: 'Oregon', + PA: 'Pennsylvania', + RI: 'Rhode Island', + SC: 'South Carolina', + SD: 'South Dakota', + TN: 'Tennessee', + TX: 'Texas', + UT: 'Utah', + VT: 'Vermont', + VA: 'Virginia', + WA: 'Washington', + WV: 'West Virginia', + WI: 'Wisconsin', + WY: 'Wyoming', +}; + +export { CHAPTER_DATA, STATES, StateAbbreviationToState }; diff --git a/client/src/util/types/map.ts b/client/src/util/types/map.ts new file mode 100644 index 00000000..17497655 --- /dev/null +++ b/client/src/util/types/map.ts @@ -0,0 +1,62 @@ +export type StateAbbreviation = + | 'AL' + | 'AK' + | 'AZ' + | 'AR' + | 'CA' + | 'CO' + | 'CT' + | 'DE' + | 'FL' + | 'GA' + | 'HI' + | 'ID' + | 'IL' + | 'IN' + | 'IA' + | 'KS' + | 'KY' + | 'LA' + | 'ME' + | 'MD' + | 'MA' + | 'MI' + | 'MN' + | 'MS' + | 'MO' + | 'MT' + | 'NE' + | 'NV' + | 'NH' + | 'NJ' + | 'NM' + | 'NY' + | 'NC' + | 'ND' + | 'OH' + | 'OK' + | 'OR' + | 'PA' + | 'RI' + | 'SC' + | 'SD' + | 'TN' + | 'TX' + | 'UT' + | 'VT' + | 'VA' + | 'WA' + | 'WV' + | 'WI' + | 'WY'; + +export type StateConfig = { + fill: string; +}; + +export type Chapter = { + id: number; + state: StateAbbreviation; + city: string; + isAcceptingRequests: boolean; +};