diff --git a/frontend/public/index.html b/frontend/public/index.html index 697f396c..ea2b667e 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -11,6 +11,8 @@ + + - CUAPTS + CUAPTS - Cornell's Off-campus Housing Finder diff --git a/frontend/src/pages/AdminPage.tsx b/frontend/src/pages/AdminPage.tsx index da73b8c5..93948e88 100644 --- a/frontend/src/pages/AdminPage.tsx +++ b/frontend/src/pages/AdminPage.tsx @@ -3,6 +3,7 @@ import { Typography, makeStyles, Grid, Container } from '@material-ui/core'; import { ReviewWithId } from '../../../common/types/db-types'; import { get } from '../utils/call'; import AdminReviewComponent from '../components/Admin/AdminReview'; +import { useTitle } from '../utils'; const useStyles = makeStyles((theme) => ({ container: { @@ -24,6 +25,8 @@ const AdminPage = (): ReactElement => { const { container } = useStyles(); + useTitle('Admin'); + // calls the APIs and the callback function to set the reviews for each review type useEffect(() => { const reviewTypes = new Map>>([ diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx index 376ed209..40d93a5b 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/frontend/src/pages/HomePage.tsx @@ -8,6 +8,7 @@ import ApartmentCards from '../components/ApartmentCard/ApartmentCards'; import { CardData } from '../App'; import { get } from '../utils/call'; import { loadingLength } from '../constants/HomeConsts'; +import { useTitle } from '../utils'; const useStyles = makeStyles({ jumboText: { @@ -40,6 +41,8 @@ const HomePage = (): ReactElement => { const [isMobile, setIsMobile] = useState(false); const [drawerOpen] = useState(false); + useTitle('Home'); + useEffect(() => { get(`/api/page-data/home/${loadingLength}`, { callback: setData, diff --git a/frontend/src/pages/Policies.tsx b/frontend/src/pages/Policies.tsx index 15596c1c..094e0484 100644 --- a/frontend/src/pages/Policies.tsx +++ b/frontend/src/pages/Policies.tsx @@ -1,6 +1,7 @@ import React, { ReactElement } from 'react'; import { Container, Link, Typography, makeStyles } from '@material-ui/core'; import { colors } from '../colors'; +import { useTitle } from '../utils'; const useStyles = makeStyles(() => ({ h2: { @@ -42,6 +43,9 @@ const useStyles = makeStyles(() => ({ const Policies = (): ReactElement => { const { h2, h3, h4, body, link } = useStyles(); + + useTitle('Policies'); + return ( diff --git a/frontend/src/pages/ProfilePage.tsx b/frontend/src/pages/ProfilePage.tsx index d700cb9a..522d33c0 100644 --- a/frontend/src/pages/ProfilePage.tsx +++ b/frontend/src/pages/ProfilePage.tsx @@ -12,6 +12,7 @@ import { colors } from '../colors'; import questionIcon from '../assets/question.svg'; import { signOut } from '../utils/firebase'; import { useHistory } from 'react-router-dom'; +import { useTitle } from '../utils'; type Props = { user: firebase.User | null; @@ -144,6 +145,8 @@ const ProfilePage = ({ user, setUser }: Props): ReactElement => { const theme = useTheme(); const isXsScreen = useMediaQuery(theme.breakpoints.down('xs')); + useTitle('Profile'); + /** This function opens the 'Who can view my profile?' modal **/ const openModal = () => { setIsModalOpen(true); diff --git a/frontend/src/pages/SearchResultsPage.tsx b/frontend/src/pages/SearchResultsPage.tsx index a7d274d2..0201009d 100644 --- a/frontend/src/pages/SearchResultsPage.tsx +++ b/frontend/src/pages/SearchResultsPage.tsx @@ -5,6 +5,7 @@ import { get } from '../utils/call'; import { colors } from '../colors'; import { CardData } from '../App'; import ApartmentCards from '../components/ApartmentCard/ApartmentCards'; +import { useTitle } from '../utils'; const useStyles = makeStyles({ searchText: { @@ -20,6 +21,8 @@ const SearchResultsPage = (): ReactElement => { const query = location.search.substring(3); const isMobile = useMediaQuery('(max-width:600px)'); + useTitle('Search Result'); + useEffect(() => { get(`/api/search-results?q=${query}`, { callback: setSearchResults,