Browse Source

fix: set thumbnail image to fixed size and fix label color

pull/1886/head
Jannik 6 years ago
parent
commit
a4748cfc33
  1. 12
      web/components/main-layout.tsx

12
web/components/main-layout.tsx

@ -4,7 +4,7 @@ import Link from 'next/link';
import Head from 'next/head'; import Head from 'next/head';
import { differenceInSeconds } from 'date-fns'; import { differenceInSeconds } from 'date-fns';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { Layout, Menu, Popover, Alert } from 'antd'; import { Layout, Menu, Popover, Alert, Typography } from 'antd';
import { import {
SettingOutlined, SettingOutlined,
@ -91,10 +91,16 @@ export default function MainLayout(props) {
? parseSecondsToDurationString(differenceInSeconds(new Date(), new Date(broadcaster.time))) ? parseSecondsToDurationString(differenceInSeconds(new Date(), new Date(broadcaster.time)))
: ''; : '';
const currentThumbnail = online ? ( const currentThumbnail = online ? (
<img src="/thumbnail.jpg" className="online-thumbnail" alt="current thumbnail" /> <img
src="http://localhost:8080/thumbnail.jpg"
className="online-thumbnail"
alt="current thumbnail"
style={{ width: "10rem" }}
/>
) : null; ) : null;
const statusIcon = online ? <PlayCircleFilled /> : <MinusSquareFilled />; const statusIcon = online ? <PlayCircleFilled /> : <MinusSquareFilled />;
const statusMessage = online ? `Online ${streamDurationString}` : 'Offline'; const statusMessage = online ? `Online ${streamDurationString}` : 'Offline';
const popoverTitle = <Typography.Text>Thumbnail</Typography.Text>;
const statusIndicator = ( const statusIndicator = (
<div className="online-status-indicator"> <div className="online-status-indicator">
@ -103,7 +109,7 @@ export default function MainLayout(props) {
</div> </div>
); );
const statusIndicatorWithThumb = online ? ( const statusIndicatorWithThumb = online ? (
<Popover content={currentThumbnail} title="Thumbnail" trigger="hover"> <Popover content={currentThumbnail} title={popoverTitle} trigger="hover">
{statusIndicator} {statusIndicator}
</Popover> </Popover>
) : ( ) : (

Loading…
Cancel
Save