mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 23:16:17 -05:00
Adding useTitle to every function page.
This commit is contained in:
parent
1033b0c38f
commit
5bf648001b
12 changed files with 55 additions and 12 deletions
|
|
@ -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('');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue