refactor: prevent duplicated title for index page by making prop optional
This commit is contained in:
committed by
Stefan Rotsch
parent
810db6aea6
commit
0d2265c57e
@@ -1,6 +1,6 @@
|
||||
import { MomentInput } from "moment";
|
||||
|
||||
import { ConfigData, radarName, radarNameShort } from "../../config";
|
||||
import { ConfigData, radarName } from "../../config";
|
||||
import { useMessages } from "../../context/MessagesContext";
|
||||
import { formatRelease } from "../../date";
|
||||
import { HomepageOption, Item, featuredOnly } from "../../model";
|
||||
@@ -38,7 +38,7 @@ export default function PageIndex({
|
||||
config.homepageContent === HomepageOption.both;
|
||||
return (
|
||||
<Fadeable leaving={leaving} onLeave={onLeave}>
|
||||
<SetTitle title={radarNameShort} />
|
||||
<SetTitle />
|
||||
<div className="headline-group">
|
||||
<HeroHeadline alt={`Version #${numberOfReleases}`}>
|
||||
{radarName}
|
||||
|
||||
@@ -3,12 +3,12 @@ import { useEffect } from "react";
|
||||
import { setTitle } from "../config";
|
||||
|
||||
type SetTitleProps = {
|
||||
title: string;
|
||||
title?: string;
|
||||
};
|
||||
|
||||
export default function SetTitle({ title }: SetTitleProps) {
|
||||
useEffect(() => {
|
||||
setTitle(document, title)
|
||||
setTitle(document, title);
|
||||
}, [title]);
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user