Show runs coming up with hourglass preview and icon.
parent
b0f4ae9fc0
commit
5a0003d094
|
@ -15,6 +15,8 @@ import FormattedDuration from './localization/FormattedDuration';
|
|||
import style from './VideoListItem.module.scss';
|
||||
import sanitizeTitle from '../util/sanitizeTitle';
|
||||
|
||||
import hourglassImage from '../images/hourglass.svg';
|
||||
|
||||
export default function VideoListItem({
|
||||
thumbnailServerURL,
|
||||
duration,
|
||||
|
@ -59,46 +61,63 @@ export default function VideoListItem({
|
|||
displayDuration = videoEnd - videoStart;
|
||||
}
|
||||
const titleUrlSlug = sanitizeTitle(title);
|
||||
return (
|
||||
<Link passHref href="/[id]/[vslug]" as={`/${id}/${titleUrlSlug}`}>
|
||||
<ListGroup.Item action>
|
||||
<Media>
|
||||
<Image
|
||||
className={['mr-3', style.thumbnail].join(' ')}
|
||||
src={getThumbnailURL(thumbnailServerURL, id, fileName, 90 * 1000, {
|
||||
width: 96,
|
||||
})}
|
||||
srcSet={[96, 96 * 2, 96 * 3]
|
||||
.map((width) => [
|
||||
getThumbnailURL(thumbnailServerURL, id, fileName, 90 * 1000, {
|
||||
const listGroupItem = (
|
||||
<ListGroup.Item action>
|
||||
<Media>
|
||||
<Image
|
||||
className={['mr-3', style.thumbnail].join(' ')}
|
||||
src={
|
||||
fileName
|
||||
? getThumbnailURL(thumbnailServerURL, id, fileName, 90 * 1000, {
|
||||
width: 96,
|
||||
})
|
||||
: hourglassImage
|
||||
}
|
||||
srcSet={[96, 96 * 2, 96 * 3]
|
||||
.map((width) => [
|
||||
fileName
|
||||
? getThumbnailURL(thumbnailServerURL, id, fileName, 90 * 1000, {
|
||||
width,
|
||||
}),
|
||||
`${width}w`,
|
||||
])
|
||||
.map((item) => item.join(' '))
|
||||
.join(', ')}
|
||||
alt={title}
|
||||
/>
|
||||
<Media.Body>
|
||||
<h5 className="mt-0 mb-3">{title}</h5>
|
||||
<p>
|
||||
{displayDuration !== null ? (
|
||||
<span>
|
||||
<FontAwesomeIcon icon="clock" />
|
||||
{' '}
|
||||
<FormattedDuration
|
||||
seconds={displayDuration}
|
||||
format="{hours} {minutes} {seconds}"
|
||||
unitDisplay="short"
|
||||
/>
|
||||
</span>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</p>
|
||||
</Media.Body>
|
||||
</Media>
|
||||
</ListGroup.Item>
|
||||
</Link>
|
||||
})
|
||||
: hourglassImage,
|
||||
`${width}w`,
|
||||
])
|
||||
.map((item) => item.join(' '))
|
||||
.join(', ')}
|
||||
alt={title}
|
||||
/>
|
||||
<Media.Body>
|
||||
<h5 className="mt-0 mb-3">{title}</h5>
|
||||
<p>
|
||||
{!fileName ? (
|
||||
<span>
|
||||
<FontAwesomeIcon icon="hourglass" />
|
||||
{' '}
|
||||
Coming up
|
||||
</span>
|
||||
) : ''}
|
||||
{displayDuration !== null ? (
|
||||
<span>
|
||||
<FontAwesomeIcon icon="clock" />
|
||||
{' '}
|
||||
<FormattedDuration
|
||||
seconds={displayDuration}
|
||||
format="{hours} {minutes} {seconds}"
|
||||
unitDisplay="short"
|
||||
/>
|
||||
</span>
|
||||
) : ''}
|
||||
</p>
|
||||
</Media.Body>
|
||||
</Media>
|
||||
</ListGroup.Item>
|
||||
);
|
||||
if (fileName) {
|
||||
return (
|
||||
<Link passHref href="/[id]/[vslug]" as={`/${id}/${titleUrlSlug}`}>
|
||||
{listGroupItem}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
return listGroupItem;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="160"
|
||||
height="90"
|
||||
viewBox="0 0 42.333332 23.812501"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
|
||||
sodipodi:docname="hourglass.svg">
|
||||
<defs
|
||||
id="defs2">
|
||||
<style
|
||||
id="style10">
|
||||
.vi-primary {
|
||||
fill: #FF6E6E;
|
||||
}
|
||||
|
||||
.vi-primary, .vi-accent {
|
||||
fill-rule: evenodd;
|
||||
}
|
||||
|
||||
.vi-accent {
|
||||
fill: #0C0058;
|
||||
}
|
||||
</style>
|
||||
<filter
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Greyscale"
|
||||
id="filter52">
|
||||
<feColorMatrix
|
||||
values="0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0 0 0 1 0 "
|
||||
id="feColorMatrix50"
|
||||
result="fbSourceGraphic" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix54" />
|
||||
<feColorMatrix
|
||||
id="feColorMatrix56"
|
||||
values="0.21 0.72 0.072 9.12248 0 0.21 0.72 0.072 9.12248 0 0.21 0.72 0.072 9.12248 0 0 0 0 1 0 "
|
||||
in="fbSourceGraphic" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#4d4d4d"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.5367125"
|
||||
inkscape:cx="72.85483"
|
||||
inkscape:cy="49.015886"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:document-rotation="0"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1018"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g26"
|
||||
transform="matrix(0.42698088,-0.42532421,0.43308484,0.4314045,-0.36410666,11.911521)"
|
||||
style="filter:url(#filter52)">
|
||||
<path
|
||||
class="vi-primary"
|
||||
d="m 35.79,35.83 v 4.177 H 38 V 43 H 10 v -2.993 h 2.211 V 35.83 c 0,0 1.927,-9.357 9.789,-10.83 V 23 C 14.137,21.527 12.211,12.17 12.211,12.17 V 7.993 H 10 V 5 h 28 v 2.993 h -2.21 v 4.177 c 0,0 -1.927,9.357 -9.79,10.83 v 2 c 7.863,1.473 9.79,10.83 9.79,10.83 z"
|
||||
id="path14" />
|
||||
<path
|
||||
class="vi-accent"
|
||||
d="M 12.211,40 V 37 H 35.79 v 3 z m 0,-29 V 8 H 35.79 v 3 z"
|
||||
id="path16" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.1 KiB |
|
@ -6,12 +6,13 @@ import {
|
|||
} from '@fortawesome/fontawesome-svg-core';
|
||||
import {
|
||||
faClock,
|
||||
faCopy,
|
||||
faDownload,
|
||||
faHourglass,
|
||||
faLanguage,
|
||||
faLightbulb,
|
||||
faSearch,
|
||||
faShare,
|
||||
faLightbulb,
|
||||
faCopy,
|
||||
faLanguage,
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import { faLightbulb as farLightbulb } from '@fortawesome/free-regular-svg-icons';
|
||||
import { faTwitch as fabTwitch } from '@fortawesome/free-brands-svg-icons';
|
||||
|
@ -50,15 +51,16 @@ import withSession from '../util/session';
|
|||
fontawesomeSvgCoreConfig.autoAddCss = false;
|
||||
|
||||
library.add(
|
||||
fabTwitch,
|
||||
faClock,
|
||||
faCopy,
|
||||
faDownload,
|
||||
faHourglass,
|
||||
faLanguage,
|
||||
faSearch,
|
||||
faShare,
|
||||
fabTwitch,
|
||||
faLightbulb,
|
||||
farLightbulb,
|
||||
faSearch,
|
||||
faShare,
|
||||
);
|
||||
|
||||
Router.events.on('routeChangeStart', (url) => {
|
||||
|
|
Loading…
Reference in New Issue