Put stream title input in the global header
This commit is contained in:
@@ -15,8 +15,6 @@ import { ServerStatusContext } from "../utils/server-status-context";
|
||||
import StatisticItem from "./components/statistic"
|
||||
import LogTable from "./components/log-table";
|
||||
import Offline from './offline-notice';
|
||||
import TextFieldWithSubmit from './components/config/form-textfield-with-submit';
|
||||
import { TEXTFIELD_PROPS_STREAM_TITLE } from './components/config/constants';
|
||||
|
||||
import {
|
||||
LOGS_WARN,
|
||||
@@ -40,10 +38,8 @@ export default function Home() {
|
||||
const serverStatusData = useContext(ServerStatusContext);
|
||||
const { broadcaster, serverConfig: configData } = serverStatusData || {};
|
||||
const { remoteAddr, streamDetails } = broadcaster || {};
|
||||
const { instanceDetails } = configData;
|
||||
|
||||
const encoder = streamDetails?.encoder || "Unknown encoder";
|
||||
const [streamTitle, setStreamTitle] = useState('');
|
||||
|
||||
const [logsData, setLogs] = useState([]);
|
||||
const getLogs = async () => {
|
||||
@@ -58,10 +54,6 @@ export default function Home() {
|
||||
getLogs();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setStreamTitle(instanceDetails.streamTitle);
|
||||
}, [instanceDetails]);
|
||||
|
||||
useEffect(() => {
|
||||
getMoreStats();
|
||||
|
||||
@@ -83,11 +75,6 @@ export default function Home() {
|
||||
);
|
||||
}
|
||||
|
||||
const handleStreamTitleChanged = ({ value }: UpdateArgs) => {
|
||||
setStreamTitle(value);
|
||||
}
|
||||
|
||||
|
||||
if (!broadcaster) {
|
||||
return <Offline logs={logsData} />;
|
||||
}
|
||||
@@ -156,18 +143,6 @@ export default function Home() {
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<div className="section online-details-section">
|
||||
<Card title="Stream description">
|
||||
<TextFieldWithSubmit
|
||||
fieldName="streamTitle"
|
||||
{...TEXTFIELD_PROPS_STREAM_TITLE}
|
||||
value={streamTitle}
|
||||
initialValue={instanceDetails.streamTitle}
|
||||
onChange={handleStreamTitleChanged}
|
||||
/>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<div className="section stream-details-section">
|
||||
|
||||
<div className="details outbound-details">
|
||||
|
||||
Reference in New Issue
Block a user