page title upgrades

This commit is contained in:
Emi Matchu 2020-09-11 23:53:57 -07:00
parent a52bd3e3bb
commit ebb8c63ac6
4 changed files with 7 additions and 5 deletions

View file

@ -21,7 +21,7 @@ import HomepageSplashImg2x from "../images/homepage-splash@2x.png";
import SpeciesColorPicker from "./components/SpeciesColorPicker";
function HomePage() {
usePageTitle("Dress to Impress");
usePageTitle(null);
useSupportSetup();
const [previewState, setPreviewState] = React.useState(null);

View file

@ -1,11 +1,11 @@
import React from "react";
import { Badge, Box, SimpleGrid } from "@chakra-ui/core";
import { Badge, Box } from "@chakra-ui/core";
import gql from "graphql-tag";
import { useQuery } from "@apollo/client";
import { Delay } from "./util";
import HangerSpinner from "./components/HangerSpinner";
import { Heading1, Heading2 } from "./util";
import { Heading1, Heading2, usePageTitle } from "./util";
import ItemCard, {
ItemBadgeList,
ItemCardList,
@ -13,6 +13,8 @@ import ItemCard, {
} from "./components/ItemCard";
function ModelingPage() {
usePageTitle("Modeling Hub");
return (
<Box>
<Heading1 marginBottom="2">Modeling Hub</Heading1>

View file

@ -29,7 +29,7 @@ function WardrobePage() {
const toast = useToast();
const { loading, error, outfitState, dispatchToOutfit } = useOutfitState();
usePageTitle(`${outfitState.name || "Untitled outfit"} | Dress to Impress`);
usePageTitle(outfitState.name || "Untitled outfit");
// TODO: I haven't found a great place for this error UI yet, and this case
// isn't very common, so this lil toast notification seems good enough!

View file

@ -113,7 +113,7 @@ export function useDebounce(
*/
export function usePageTitle(title) {
React.useEffect(() => {
document.title = title;
document.title = title ? `${title} | Dress to Impress` : "Dress to Impress";
}, [title]);
}