diff --git a/frontend/src/components/utils/DropDown.tsx b/frontend/src/components/utils/DropDown.tsx index 9c6210a9..30b40735 100644 --- a/frontend/src/components/utils/DropDown.tsx +++ b/frontend/src/components/utils/DropDown.tsx @@ -1,29 +1,3 @@ -/** - * DropDown Component - * - * @remarks - * A dropdown component that displays a button and a menu with selectable items. - * The component uses Material-UI components for consistent styling. - * - * @component - * @example - * ```typescript - * const menuItems = [ - * { item: 'Price', callback: () => setSortBy('avgPrice')}, - * { item: 'Rating', callback: () => setSortBy('avgRating')}, - * { item: 'Date Added', callback: () => setSortBy('id')}, - * ]; - * - * function App() { - * return ( - * - * ); - * } - *``` - * @param {Object} props - The props of the component. - * @param {MenuElement[]} props.menuItems - An array of menu items, each containing an item name and a callback function. - * @returns {JSX.Element} The rendered dropdown component. - */ import React, { useState } from 'react'; import { Button, Menu, MenuItem, SvgIcon } from '@material-ui/core'; import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown'; @@ -72,6 +46,33 @@ const useStyles = makeStyles({ }, }); +/** + * DropDown Component + * + * @remarks + * A dropdown component that displays a button and a menu with selectable items. + * The component uses Material-UI components for consistent styling. + * + * @component + * @example + * ```typescript + * const menuItems = [ + * { item: 'Price', callback: () => setSortBy('avgPrice')}, + * { item: 'Rating', callback: () => setSortBy('avgRating')}, + * { item: 'Date Added', callback: () => setSortBy('id')}, + * ]; + * + * function App() { + * return ( + * + * ); + * } + *``` + * @param {Object} props - The props of the component. + * @param {MenuElement[]} props.menuItems - An array of menu items, each containing an item name and a callback function. + * @returns {JSX.Element} The rendered dropdown component. + */ + export default function DropDown({ menuItems, isMobile, defaultValue, className, icon }: Props) { const [anchorEl, setAnchorEl] = useState(null); const [selected, setSelected] = useState(defaultValue ? defaultValue : menuItems[0].item); diff --git a/frontend/src/components/utils/DropDownWithLabel.tsx b/frontend/src/components/utils/DropDownWithLabel.tsx index f62b78aa..0acfa94c 100644 --- a/frontend/src/components/utils/DropDownWithLabel.tsx +++ b/frontend/src/components/utils/DropDownWithLabel.tsx @@ -1,3 +1,19 @@ +import React from 'react'; +import { Typography, Grid } from '@material-ui/core'; +import DropDown from './DropDown'; + +type MenuElement = { + item: string; + callback: () => void; +}; + +interface DropDownWithLabelProps { + label: string; + menuItems: MenuElement[]; + labelStyle?: React.CSSProperties; + isMobile: boolean; +} + /** * A dropdown component with a label. * @@ -20,21 +36,6 @@ * * */ -import React from 'react'; -import { Typography, Grid } from '@material-ui/core'; -import DropDown from './DropDown'; - -type MenuElement = { - item: string; - callback: () => void; -}; - -interface DropDownWithLabelProps { - label: string; - menuItems: MenuElement[]; - labelStyle?: React.CSSProperties; - isMobile: boolean; -} const DropDownWithLabel: React.FC = ({ label, diff --git a/frontend/src/components/utils/Footer/CantFindApartmentModal.tsx b/frontend/src/components/utils/Footer/CantFindApartmentModal.tsx deleted file mode 100644 index 10362662..00000000 --- a/frontend/src/components/utils/Footer/CantFindApartmentModal.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { - Button, - Dialog, - DialogActions, - DialogContent, - DialogTitle, - Grid, - makeStyles, - Typography, -} from '@material-ui/core'; -import { colors } from '../../../colors'; -import React from 'react'; -import { useModal } from './ContactModalContext'; -import apartmentIcon from '../../../assets/apartmentIcon.svg'; -import questionMarkIcon from '../../../assets/questionMark.svg'; - -const useStyles = makeStyles((theme) => ({ - modalStyle: { - width: '640px', - padding: '32px', - borderRadius: '13px', - }, - optionGrid: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - }, - optionButton: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - borderRadius: '8px', - border: '1px solid', - borderColor: colors.red1 + '!important', - padding: '32px 36px', - gap: '16px', - height: '169px', - justifyContent: 'center', - '& > span': { - flexDirection: 'column', - }, - '&:hover': { - backgroundColor: colors.red5, - boxShadow: '0px 4px 10px 0px rgba(0, 0, 0, 0.25)', - }, - }, - optionText: { - fontSize: '18px', - fontWeight: 500, - textTransform: 'none', - }, - optionIcon: { - paddingBottom: '16px', - }, -})); - -const CantFindApartmentModal: React.FC = () => { - const { modalOpen, closeModal } = useModal(); - - const { modalStyle, optionGrid, optionButton, optionText, optionIcon } = useStyles(); - - return ( - - -

Contact Us

-
- - - Choose from the following: - - - - - - - - - - - -
- ); -}; - -export default CantFindApartmentModal; diff --git a/frontend/src/constants/HomeConsts.ts b/frontend/src/constants/HomeConsts.ts index 5a022517..a3f956e3 100644 --- a/frontend/src/constants/HomeConsts.ts +++ b/frontend/src/constants/HomeConsts.ts @@ -1,4 +1,14 @@ export const loadingLength = 5; + +/** + * admins – List of CUApts' admins' email addresses. + * + * @remarks + * This array contains the emails of users who have access to the admin system on CUApts. Each email should be followed with a comment indicating + * the admin's name. This array should be updated periodically to remove old admins and add new admins. + * + * @return {string[]} – An array of admin email addresses. + */ export const admins: string[] = [ 'gs622@cornell.edu', // Grace 'tpp38@cornell.edu', // Sophia