Adding useTitle to every function page.

This commit is contained in:
Roland 2022-10-25 15:57:44 -06:00
parent 1033b0c38f
commit 5bf648001b
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
12 changed files with 55 additions and 12 deletions

View file

@ -22,6 +22,7 @@ import {
secondsToDate,
secondsToFrequency,
Toggle,
useTitle,
WROLModeMessage
} from "./Common";
import {Link, useNavigate, useParams} from "react-router-dom";
@ -124,6 +125,12 @@ function ChannelPage({create, header}) {
const {channelId} = useParams();
const {channel, changeValue, fetchChannel} = useChannel(channelId);
let title;
if (channel && channel.name) {
title = channel.name;
}
useTitle(title);
if (!channel) {
return <Loader active/>;
}
@ -455,6 +462,7 @@ export function EditChannel(props) {
}
export function NewChannel(props) {
useTitle('New Channel');
return <ChannelPage header='New Channel' {...props} create/>
}
@ -507,6 +515,7 @@ function MobileChannelRow({channel}) {
export function Channels() {
useTitle('Channels');
const {channels} = useChannels();
const [searchStr, setSearchStr] = useState('');