From 353cb2926c89805edcf65235e3601217e4efff4e Mon Sep 17 00:00:00 2001 From: Renee Pinna Date: Sun, 22 Oct 2023 20:25:45 -0600 Subject: [PATCH 1/7] Remove unused code --- src/Components/Contact/Contact.js | 79 --------------------------- src/Components/DropDown/DropDown.js | 34 ++++++------ src/Components/DropDown/DropDown.scss | 14 ++--- src/Components/Homepage/Homepage.scss | 6 -- src/Components/NavBar/NavBar.js | 4 +- src/Components/Search/Search.js | 1 - src/Components/Search/Search.scss | 1 - src/apollo-client/apollo-client.js | 2 +- 8 files changed, 26 insertions(+), 115 deletions(-) diff --git a/src/Components/Contact/Contact.js b/src/Components/Contact/Contact.js index cce958b..e6814c5 100644 --- a/src/Components/Contact/Contact.js +++ b/src/Components/Contact/Contact.js @@ -1,82 +1,3 @@ -// import React from 'react'; -// import '../Contact/Contact.scss' -// import weAllHuman from '../../images/usa-custom.jpeg'; - -// const ContactSection = () => { -// return ( -//
-//
-//
-//
-// usa-custom -//
-//
-//
-//

HELPFUL RESOURCES

-// -//
-//
- -//
-//

CONTACT US

-//

Need technical assistance with this website? Send an email to:nanajon66@gmail.com

- - -//

-// The U.S. Refugee Admissions Program (USRAP) is free of charge. -// Any requests to solicit funds for referral or access to the USRAP -// are illegitimate and not associated with the U.S. government. -//

-//

-// U.S. Department of State | -// Bureau of Population, Refugees, and Migration | -// Refugee Admissions -//

- - -// -//
-//
-// ); -// }; - -// export default ContactSection; - -import React from 'react'; import '../Contact/Contact.scss' import weAllHuman from '../../images/usa-custom.jpeg'; diff --git a/src/Components/DropDown/DropDown.js b/src/Components/DropDown/DropDown.js index 37016e7..d3eecd3 100644 --- a/src/Components/DropDown/DropDown.js +++ b/src/Components/DropDown/DropDown.js @@ -1,15 +1,15 @@ import { useState } from 'react'; import { useQuery } from '@apollo/client'; import { GET_ALL_LOCATIONS } from '../../apollo-client/queries'; -import './DropDown.scss'; import { useCombobox } from 'downshift'; import { useNavigate } from 'react-router-dom'; import Spinner from '../Spinner/Spinner'; +import './DropDown.scss'; export default function DropDown({ city, setSearchLocation }) { const [autocompleteSuggestions, setAutocompleteSuggestions] = useState([]); const { loading, error, data } = useQuery(GET_ALL_LOCATIONS); - const [selectedItem, setSelectedItem] = useState('') + const [selectedItem, setSelectedItem] = useState(''); const navigate = useNavigate(); const { getInputProps, getMenuProps, getItemProps, highlightedIndex } = @@ -31,15 +31,13 @@ export default function DropDown({ city, setSearchLocation }) { .map(location => `${location.city}, ${location.state}`) .slice(0, 5); - suggestions.forEach(location => { - const [city, - // state - ] = location.split(', '); + suggestions.forEach(location => { + const [city] = location.split(', '); - if (inputValue.toLowerCase() === city.toLowerCase()) { - suggestions = []; - } - }); + if (inputValue.toLowerCase() === city.toLowerCase()) { + suggestions = []; + } + }); } setAutocompleteSuggestions(suggestions); @@ -53,14 +51,14 @@ export default function DropDown({ city, setSearchLocation }) { }, }); - if (error) { - navigate('/error500'); - return null; - } - - if (loading) { - return ; - } + if (error) { + navigate('/error500'); + return null; + } + + if (loading) { + return ; + } return ( <> diff --git a/src/Components/DropDown/DropDown.scss b/src/Components/DropDown/DropDown.scss index 4294226..f2c6e4e 100644 --- a/src/Components/DropDown/DropDown.scss +++ b/src/Components/DropDown/DropDown.scss @@ -1,6 +1,6 @@ .suggestion-dropdown { - // background-color: white; - background-color: #30acf6; + color: black; + background-color: white; margin-right: 1rem; flex: 1; max-width: 300px; @@ -10,14 +10,14 @@ box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1); } +.suggestion[data-highlighted='true'] { + background-color: #30acf6; +} + .suggestion { padding: 0.5rem; list-style-type: none; - -} - -.suggestion[data-highlighted='true'] { - background-color: #30acf6; + border-radius: 5px; } .city-input { diff --git a/src/Components/Homepage/Homepage.scss b/src/Components/Homepage/Homepage.scss index 21f1ffd..3a408cd 100644 --- a/src/Components/Homepage/Homepage.scss +++ b/src/Components/Homepage/Homepage.scss @@ -29,12 +29,6 @@ body { } } -// below is for testing perpose only -// .content-section { border: 2px solid red; } -// .media-side { border: 2px solid green; } -// .text-side { border: 2px solid blue; } -// .refugee-image-container { border: 2px solid yellow; } - .home-header { .navbar-container { width: 100%; diff --git a/src/Components/NavBar/NavBar.js b/src/Components/NavBar/NavBar.js index 70f1932..ed4422f 100644 --- a/src/Components/NavBar/NavBar.js +++ b/src/Components/NavBar/NavBar.js @@ -1,7 +1,7 @@ -import React, { useState } from 'react'; -import './NavBar.scss'; +import { useState } from 'react'; import { NavLink } from 'react-router-dom'; import logoImage from '../../images/refuge.png'; +import './NavBar.scss'; export default function NavBar({ isLoggedIn, handleLogin }) { diff --git a/src/Components/Search/Search.js b/src/Components/Search/Search.js index 7c360ed..84c270a 100644 --- a/src/Components/Search/Search.js +++ b/src/Components/Search/Search.js @@ -37,7 +37,6 @@ export default function Search({ selectOrganization }) { placeholder='State' required /> - {/* */}