Fix typescript errors

This commit is contained in:
Gabe Kangas
2020-11-08 11:51:04 -08:00
parent 24d71cec58
commit f2499ebb5d
3 changed files with 16 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ interface ItemProps {
value: string, value: string,
prefix: JSX.Element, prefix: JSX.Element,
color: string, color: string,
progress: boolean, progress?: boolean,
}; };
export default function StatisticItem(props: ItemProps) { export default function StatisticItem(props: ItemProps) {
@@ -41,8 +41,8 @@ function ProgressView({title, value, prefix, color}) {
) )
} }
function StatisticView({title, value, prefix}) { function StatisticView({title, value, prefix, color}) {
const valueStyle = { color: "#334", fontSize: "1.8rem" }; const valueStyle = { fontSize: "1.8rem" };
return ( return (
<Statistic <Statistic

View File

@@ -122,11 +122,13 @@ export default function Stats() {
title="Outbound Video Stream" title="Outbound Video Stream"
value={`${setting.videoBitrate} kbps ${setting.framerate} fps`} value={`${setting.videoBitrate} kbps ${setting.framerate} fps`}
prefix={null} prefix={null}
color="#334"
/> />
<StatisticItem <StatisticItem
title="Outbound Audio Stream" title="Outbound Audio Stream"
value={audioSetting} value={audioSetting}
prefix={null} prefix={null}
color="#334"
/> />
</Row> </Row>
); );
@@ -147,16 +149,19 @@ export default function Stats() {
)}`} )}`}
value={formatDistanceToNow(new Date(broadcaster.time))} value={formatDistanceToNow(new Date(broadcaster.time))}
prefix={<ClockCircleOutlined />} prefix={<ClockCircleOutlined />}
color="#334"
/> />
<StatisticItem <StatisticItem
title="Viewers" title="Viewers"
value={viewerCount} value={viewerCount}
prefix={<UserOutlined />} prefix={<UserOutlined />}
color="#334"
/> />
<StatisticItem <StatisticItem
title="Peak viewer count" title="Peak viewer count"
value={sessionMaxViewerCount} value={sessionMaxViewerCount}
prefix={<UserOutlined />} prefix={<UserOutlined />}
color="#334"
/> />
</Row> </Row>
@@ -165,16 +170,19 @@ export default function Stats() {
title="Input" title="Input"
value={formatIPAddress(remoteAddr)} value={formatIPAddress(remoteAddr)}
prefix={null} prefix={null}
color="#334"
/> />
<StatisticItem <StatisticItem
title="Inbound Video Stream" title="Inbound Video Stream"
value={streamVideoDetailString} value={streamVideoDetailString}
prefix={null} prefix={null}
color="#334"
/> />
<StatisticItem <StatisticItem
title="Inbound Audio Stream" title="Inbound Audio Stream"
value={streamAudioDetailString} value={streamAudioDetailString}
prefix={null} prefix={null}
color="#334"
/> />
</Row> </Row>
@@ -185,11 +193,13 @@ export default function Stats() {
title="Stream key" title="Stream key"
value={config.streamKey} value={config.streamKey}
prefix={null} prefix={null}
color="#334"
/> />
<StatisticItem <StatisticItem
title="Directory registration enabled" title="Directory registration enabled"
value={config.yp.enabled.toString()} value={config.yp.enabled.toString()}
prefix={null} prefix={null}
color="#334"
/> />
</Row> </Row>

View File

@@ -109,16 +109,19 @@ export default function ViewersOverTime() {
title="Current viewers" title="Current viewers"
value={viewerCount.toString()} value={viewerCount.toString()}
prefix={<UserOutlined />} prefix={<UserOutlined />}
color="#334"
/> />
<StatisticItem <StatisticItem
title="Peak viewers this session" title="Peak viewers this session"
value={sessionPeakViewerCount.toString()} value={sessionPeakViewerCount.toString()}
prefix={<UserOutlined />} prefix={<UserOutlined />}
color="#334"
/> />
<StatisticItem <StatisticItem
title="Peak viewers overall" title="Peak viewers overall"
value={overallPeakViewerCount.toString()} value={overallPeakViewerCount.toString()}
prefix={<UserOutlined />} prefix={<UserOutlined />}
color="#334"
/> />
</Row> </Row>
<div className="chart-container"> <div className="chart-container">