Handling situation where React Router may not be available for a Tag Label.

This commit is contained in:
Roland 2023-05-03 12:46:57 -06:00
parent 0920383963
commit 2cbc6e00e0
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
8 changed files with 56 additions and 33 deletions

View file

@ -440,7 +440,7 @@ function ChannelRow({channel}) {
const {inverted} = React.useContext(ThemeContext);
const editTo = `/videos/channel/${channel.id}/edit`;
const buttonClass = `ui button secondary ${inverted ? 'inverted' : ''}`;
const buttonClass = `ui button secondary ${inverted}`;
return <TableRow>
<TableCell>

View file

@ -1,11 +1,7 @@
import React from "react";
import _ from "lodash";
import {
Grid,
Header as SHeader,
Image,
} from "semantic-ui-react";
import {TagsSelector} from "../Tags";
import {Grid, Header as SHeader, Image,} from "semantic-ui-react";
import {TagsProvider, TagsSelector} from "../Tags";
import {Media} from "../contexts/contexts";
import {encodeMediaPath} from "./Common";
import {addTag, fetchFile, removeTag} from "../api";
@ -152,7 +148,7 @@ export const FilePreviewContext = React.createContext({
const MAXIMUM_TEXT_SIZE = 5_000_000;
export function FilePreviewWrapper({children}) {
export function FilePreviewProvider({children}) {
const [previewFile, setPreviewFile] = React.useState(null);
const [previewModal, setPreviewModal] = React.useState(null);
const [callbacks, setCallbacks] = React.useState(null);

View file

@ -38,7 +38,7 @@ export const defaultTheme = lightTheme;
export const systemTheme = 'system';
export const themeSessionKey = 'color-scheme';
export function ThemeWrapper({children, ...props}) {
export function ThemeProvider({children, ...props}) {
if (!_.isEmpty(props)) {
console.log(props);
console.error('ThemeWrapper does not support props!');

View file

@ -183,7 +183,7 @@ function VideoPage({videoFile, prevFile, nextFile, fetchVideo, ...props}) {
>
<source src={videoUrl} type="video/mp4"/>
{/* Only WebVTT captions can be displayed. */}
{captionUrls.map(i => <track kind="captions" label="English" src={i} srcLang="en" default/>)}
{captionUrls.map(i => <track key={i} kind="captions" label="English" src={i} srcLang="en" default/>)}
</video>
<Container style={{marginTop: '1em'}}>